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 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..2d6a8f4f 100644 --- a/app/views/layouts/_logined_header.html.erb +++ b/app/views/layouts/_logined_header.html.erb @@ -53,71 +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 %> - <% else %> - <%= 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 9121732b..e8b7a64d 100644 --- a/app/views/layouts/_unlogin_header.html.erb +++ b/app/views/layouts/_unlogin_header.html.erb @@ -52,7 +52,9 @@
    + +
    登录 @@ -75,7 +77,7 @@
    diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index c1d7e8b7..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 {
    -
    +
    diff --git a/public/stylesheets/educoder/edu-all.css b/public/stylesheets/educoder/edu-all.css index 99e244b1..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: 820px;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}