From da8d83c8ef5046ae0948b06c4fb4c373249e7edc Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Mon, 29 Apr 2019 12:37:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E8=88=AA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_logined_header.html.erb | 75 +++++++++++++++------- app/views/layouts/_unlogin_header.html.erb | 55 +++++++++------- 2 files changed, 85 insertions(+), 45 deletions(-) diff --git a/app/views/layouts/_logined_header.html.erb b/app/views/layouts/_logined_header.html.erb index 55cd14c9..30ef0658 100644 --- a/app/views/layouts/_logined_header.html.erb +++ b/app/views/layouts/_logined_header.html.erb @@ -6,8 +6,25 @@
  • "><%= link_to "翻转课堂", courses_path %>
  • "><%= link_to "开发社区", shixuns_path %>
  • + + <% careers = Career.published.order("created_at asc") %> + <% if careers.present? %> +
  • " style="cursor: auto;"> +

    职业路径

    + +
  • + <% end %>
  • "><%= link_to "竞赛", competitions_path %>
  • "><%= link_to "问答", forums_path %>
  • + <% if User.current.ec_school.present? %> +
  • " id="ec_banner"> + <%= link_to "认证", department_ecs_path(:school_id => User.current.ec_school) %> +
  • + <% end %> - <% if User.current.logged? %> -
    - <%= 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" %> - -
    - <% else %> - - <%= link_to '登录', signin_path, :class => "mr5 color-white" %> - - <%= link_to '注册', user_join_path, :class => "ml5 color-white" %> - - <% 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" %> + +
    @@ -58,9 +73,7 @@
      - <% unless User.current.user_extensions.try(:identity) == 1 %> -
    • <%= link_to '新建课堂', new_course_path() %>
    • - <% end %> +
    • <%= link_to '新建课堂', new_course_path() %>
    • <%= link_to '新建实训', new_shixun_path() %>
    • <%= link_to '新建实训课程', new_subject_path() %>
    • <%= link_to '新建项目', new_project_path() %>
    • @@ -72,6 +85,22 @@
    + +
    + + + + + <% 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 72dd2731..f38a1dce 100644 --- a/app/views/layouts/_unlogin_header.html.erb +++ b/app/views/layouts/_unlogin_header.html.erb @@ -8,36 +8,47 @@
  • "><%= link_to "开发社区", shixuns_path %>
  • + <% careers = Career.published.order("created_at asc") %> + <% if careers.present? %> +
  • " style="cursor: auto;"> +

    职业路径

    + +
  • + <% end %>
  • "><%= link_to "竞赛", competitions_path %>
  • "><%= link_to "问答", forums_path %>
  • - + <%= link_to '登录', signin_path, :class => "mr5 color-white" %> - - <%= link_to '注册', user_join_path, :class => "ml5 color-white" %> + + <%= link_to '注册', user_join_path, :class => "ml5 color-white" %>