socialforge/app/views/layouts/_new_header.html.erb

61 lines
2.8 KiB
Plaintext

<div id="Header" >
<!-- logo -->
<div class="logo fl" >
<a href="#" target="_blank">
<%=link_to image_tag("/images/logo.png",weight:"35px", height: "30px")%>
</a>
</div>
<!-- 导航栏 -->
<div id="TopNav" class="fl">
<%= render_dynamic_nav if User.current.logged? || !Setting.login_required? -%>
</div>
<div id="TopUser" class="fr">
<div id="menu">
<ul class="menu">
<!--右侧登录、登出、注册按钮-->
<% if User.current.logged? -%>
<li id="current_user_li">
<%= link_to "#{User.current.login}<span class='pic_triangle'></span>".html_safe, {:controller=> 'users', :action => 'show', id: User.current.id, host: Setting.host_user}, :class => "uses_name"%>
<ul id="user_sub_menu" style="right: 0px;display: none;">
<% unless User.current.projects.empty? %>
<li id="my_projects_li">
<%= link_to l(:label_my_projects), {:controller => 'users', :action => 'user_projects', id: User.current.id, host: Setting.host_name}, :class => "parent" %>
<ul id="my_projects_ul">
<% User.current.projects.each do |project| %>
<li title="<%=project.name%>">
<%= link_to project.name, {:controller => 'projects', :action => 'show',id: project.id, host: Setting.host_name } %>
</li>
<% end %>
</ul>
</li>
<% end %>
<% if @show_course == 1 && User.current.user_extensions && [UserExtensions::TEACHER, UserExtensions::STUDENT].include?(User.current.user_extensions.identity) %>
<% user_course = get_user_course User.current%>
<% unless user_course.empty? %>
<li id="my_courses_li">
<%=link_to l(:label_my_course), {:controller => 'users', :action => 'user_courses', id: User.current.id}, :class => "parent" %>
<ul id="my_courses_ul">
<% user_course.each do |course| %>
<li title="<%=course.name%>">
<%= link_to course.name, {:controller => 'courses',:action => 'show',:id => course.id} %>
</li>
<% end %>
</ul>
</li>
<% end %>
<% end %>
<li>
<%=link_to l(:label_user_edit), {:controller => 'my', :action=> 'account', host: Setting.host_user}%>
</li>
</ul>
</li>
<% end -%>
<%= header_render_menu :account_menu -%>
</ul>
</div><!--topuser_nav end-->
</div>
</div>