From 4b0d3fdf6cbd5a875f0c8908d790b728acb64189 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Mon, 29 Jul 2019 13:42:25 +0800 Subject: [PATCH 1/5] add join project operate to navbar --- .../_applied_join_project.html.erb | 4 ++-- app/views/layouts/_logined_header.html.erb | 15 +++++++-------- app/views/layouts/_unlogin_header.html.erb | 2 +- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/app/views/applied_project/_applied_join_project.html.erb b/app/views/applied_project/_applied_join_project.html.erb index f8401b1e..60340a94 100644 --- a/app/views/applied_project/_applied_join_project.html.erb +++ b/app/views/applied_project/_applied_join_project.html.erb @@ -9,12 +9,12 @@ <% if @is_teacher && @is_teacher == 1 %>
  • - +
  • <% else %>
  • - +
  • <% end %> diff --git a/app/views/layouts/_logined_header.html.erb b/app/views/layouts/_logined_header.html.erb index 0ce03673..b583b8b3 100644 --- a/app/views/layouts/_logined_header.html.erb +++ b/app/views/layouts/_logined_header.html.erb @@ -90,14 +90,13 @@
  • <%= link_to '新建项目', new_project_path() %>
  • diff --git a/app/views/layouts/_unlogin_header.html.erb b/app/views/layouts/_unlogin_header.html.erb index 9121732b..87e2912b 100644 --- a/app/views/layouts/_unlogin_header.html.erb +++ b/app/views/layouts/_unlogin_header.html.erb @@ -75,7 +75,7 @@ From e6cb59cfef53dd885196a0f100aa6f14654ef552 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 29 Jul 2019 17:50:03 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/myshixun.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/myshixun.rb b/app/models/myshixun.rb index b5e9df62..74841156 100644 --- a/app/models/myshixun.rb +++ b/app/models/myshixun.rb @@ -129,7 +129,8 @@ class Myshixun < ActiveRecord::Base if current_game.blank? current_game = Game.find_by_sql("SELECT g.* FROM games g, challenges c where g.myshixun_id=#{self.id} and g.challenge_id = c.id and g.status = 2 order by c.position desc").first end - return current_game + + return current_game.blank? ? games.first : current_game # # if self.status == 1 # current_game = Game.find_by_sql("SELECT g.* FROM games g, challenges c where g.myshixun_id=#{self.id} and g.challenge_id = c.id and g.status = 2 order by c.position desc").first From 7c2ee93546d8974f27da5d159fe7aa7d7ce83f4e Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Mon, 29 Jul 2019 18:13:29 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_logined_header.html.erb | 121 +++++++++++---------- app/views/layouts/_unlogin_header.html.erb | 2 + 2 files changed, 63 insertions(+), 60 deletions(-) diff --git a/app/views/layouts/_logined_header.html.erb b/app/views/layouts/_logined_header.html.erb index b583b8b3..2d6a8f4f 100644 --- a/app/views/layouts/_logined_header.html.erb +++ b/app/views/layouts/_logined_header.html.erb @@ -53,70 +53,71 @@ -
    - <%= link_to (image_tag(url_to_avatar(User.current), :width =>"34", :height => "34", :class => "radius mt13", :nhname => "avatar_image", :alt=>"头像", :id => "nh_user_logo")), user_path(User.current),:class => "fl" %> -
    - <% if User.current.department_members.count > 0 %> -
  • <%= link_to '学院统计', statistics_college_path(User.current.department_members.first.try(:department)) %>
  • - <% end %> -
  • <%= link_to '账号管理', my_account_path %>
  • -
  • <%= link_to '退出', signout_path %>
  • - - -
    - - - -
    - -
    -
    -
      - <% unless User.current.identity == "学生" %> -
    • <%= link_to '新建课堂', new_course_path() %>
    • - <% end %> -
    • <%= link_to '新建实训', new_shixun_path() %>
    • -
    • <%= link_to '新建实践课程', new_subject_path() %>
    • -
    • <%= link_to '新建项目', new_project_path() %>
    • -
    -
      - <% if User.current.profile_completed? %> -
    • <%= link_to "加入课堂", join_private_courses_path, :remote => true %>
    • -
    • <%= link_to "加入项目", applied_join_project_path, :remote => true %>
    • - <% else %> -
    • <%= link_to "加入课堂", 'javascript:void(0)', onclick: 'showUserProfileModal()' %>
    • -
    • <%= link_to "加入项目", 'javascript:void(0)', onclick: 'showUserProfileModal()' %>
    • - <% end %> -
    -
    +
    + <%= link_to (image_tag(url_to_avatar(User.current), :width =>"34", :height => "34", :class => "radius mt13", :nhname => "avatar_image", :alt=>"头像", :id => "nh_user_logo")), user_path(User.current),:class => "fl" %> +
      + <%= User.current.show_name %> +
    • <%= link_to '我的课堂', user_path(User.current) %>
    • +
    • <%= link_to '我的实训', user_path(User.current, :type => 'a_shixun') %>
    • +
    • <%= link_to '我的实践课程', user_path(User.current, :type => 'a_path') %>
    • + <% if User.current.partner.present? %> +
    • <%= link_to '客户管理', partner_list_cooperate_path(User.current.partner) %>
    • + <% end %> +
    • <%= link_to '我的项目', user_path(User.current, :type => 'a_project') %>
    • +
    • <%= link_to '我的众包', user_path(User.current, :type => 'a_package') %>
    • + + <% if User.current.department_members.count > 0 %> +
    • <%= link_to '学院统计', statistics_college_path(User.current.department_members.first.try(:department)) %>
    • + <% end %> +
    • <%= link_to '账号管理', my_account_path %>
    • +
    • <%= link_to '退出', signout_path %>
    • +
    +
    +
    + + + +
    + +
    +
    +
      + <% unless User.current.identity == "学生" %> +
    • <%= link_to '新建课堂', new_course_path() %>
    • + <% end %> +
    • <%= link_to '新建实训', new_shixun_path() %>
    • +
    • <%= link_to '新建实践课程', new_subject_path() %>
    • +
    • <%= link_to '新建项目', new_project_path() %>
    • +
    +
      + <% if User.current.profile_completed? %> +
    • <%= link_to "加入课堂", join_private_courses_path, :remote => true %>
    • +
    • <%= link_to "加入项目", applied_join_project_path, :remote => true %>
    • + <% else %> +
    • <%= link_to "加入课堂", 'javascript:void(0)', onclick: 'showUserProfileModal()' %>
    • +
    • <%= link_to "加入项目", 'javascript:void(0)', onclick: 'showUserProfileModal()' %>
    • + <% end %> +
    +
    -
    - - - - - <% new_tidings_count = User.current.tidings.where("created_at > '#{User.current.onclick_time.onclick_time}'").count %> - <% new_pri_message_count = User.current.private_messages.where("created_at > '#{User.current.onclick_time.onclick_time}'").count %> - <% count = new_tidings_count + new_pri_message_count %> - <% if count > 0 %> - <%= count > 99 ? "99+" : count %> - - <% end %> -
    +
    + + + + + <% new_tidings_count = User.current.tidings.where("created_at > '#{User.current.onclick_time.onclick_time}'").count %> + <% new_pri_message_count = User.current.private_messages.where("created_at > '#{User.current.onclick_time.onclick_time}'").count %> + <% count = new_tidings_count + new_pri_message_count %> + <% if count > 0 %> + <%= count > 99 ? "99+" : count %> + + <% end %>
    diff --git a/app/views/layouts/_unlogin_header.html.erb b/app/views/layouts/_unlogin_header.html.erb index 87e2912b..e8b7a64d 100644 --- a/app/views/layouts/_unlogin_header.html.erb +++ b/app/views/layouts/_unlogin_header.html.erb @@ -52,7 +52,9 @@
    + +
    登录 From 9a5c5cea7be5c7ef3843325fe080bfa268ea70dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 29 Jul 2019 18:38:09 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/educoder/edu-all.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/stylesheets/educoder/edu-all.css b/public/stylesheets/educoder/edu-all.css index 2a185e56..4c9974d6 100644 --- a/public/stylesheets/educoder/edu-all.css +++ b/public/stylesheets/educoder/edu-all.css @@ -6,7 +6,7 @@ float: left; width: 97px; } -.head-nav{float: left;width: 890px;text-align: center;height: 60px;box-sizing: border-box; min-width: 400px;} +.head-nav{float: left;width: 810px;text-align: center;height: 60px;box-sizing: border-box; min-width: 400px;} .head-nav ul#header-nav{position: absolute;top: 0px;z-index: 3;height: 60px;box-sizing: border-box;} .head-nav ul#header-nav li{float: left;height: 60px;line-height: 60px;margin-right: 30px;cursor: pointer;position: relative;font-size: 16px} .head-nav ul#header-nav li a{display: block;height: 100%;width: 100%;color: #fff} From b869d5ba0ab42a73a59cd8e37e9d271743935df8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 29 Jul 2019 19:01:41 +0800 Subject: [PATCH 5/5] b --- public/react/src/modules/tpm/NewHeader.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index 4f656269..b6e09a7c 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -351,10 +351,21 @@ class NewHeader extends Component {
    - + {ImageUrlType===true?高校智能化教学与实训平台:高校智能化教学与实训平台} -
    + + +
    {/*<%= link_to image_tag("/images/educoder/logo.png", alt:"高校智能化教学与实训平台", className:"logoimg"), home_path %>*/}
    @@ -477,7 +488,7 @@ class NewHeader extends Component { ` } -
    +
    登录 @@ -486,7 +497,7 @@ class NewHeader extends Component {
    -