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] =?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 @@
    + +
    登录