2015-03-17 15:30:15 +08:00
<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">
2015-03-18 16:16:18 +08:00
<div id="menu">
<ul class="menu">
2015-03-17 15:30:15 +08:00
<!--右侧登录、登出、注册按钮-->
<% if User.current.logged? -%>
2015-03-18 16:16:18 +08:00
<li id="current_user_li">
2015-06-03 14:33:53 +08:00
<%= link_to "#{User.current.login}<span class='pic_triangle'></span>".html_safe, {:controller=> 'users', :action => 'show', id: User.current.id, host: Setting.host_user}, target:"_blank", :class => "uses_name"%>
2015-04-22 17:01:36 +08:00
<ul id="user_sub_menu" style="right: 0px;display: none;">
2015-07-02 15:30:30 +08:00
<% if @show_course == 1 %>
2015-03-17 15:30:15 +08:00
<% user_course = get_user_course User.current%>
<% unless user_course.empty? %>
<li id="my_courses_li">
2015-06-03 14:33:53 +08:00
<%=link_to l(:label_my_course), {:controller => 'users', :action => 'user_courses', id: User.current.id},target:"_blank", :class => "parent" %>
2015-03-17 15:30:15 +08:00
<ul id="my_courses_ul">
2015-08-13 11:08:02 +08:00
<% user_course.each do |course| %>
2015-03-17 15:30:15 +08:00
<li title="<%=course.name%>">
2015-06-03 14:33:53 +08:00
<%= link_to course.name, {:controller => 'courses',:action => 'show',:id => course.id},target:"_blank" %>
2015-03-17 15:30:15 +08:00
</li>
<% end %>
</ul>
</li>
<% end %>
<% end %>
2015-06-10 16:16:23 +08:00
<% 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},target:"_blank", :class => "parent" %>
<ul id="my_projects_ul" >
2015-08-13 11:08:02 +08:00
<% User.current.projects.select("projects.*,(SELECT MAX(created_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a desc").each do |project| %>
2015-06-10 16:16:23 +08:00
<li title="<%=project.name%>">
<%= link_to project.name, {:controller => 'projects', :action => 'show',id: project.id, host: Setting.host_name }, target:"_blank" %>
</li>
<% end %>
</ul>
</li>
<% end %>
2015-03-17 15:30:15 +08:00
<li>
2015-05-14 21:40:34 +08:00
<%=link_to l(:label_user_edit), {:controller => 'my', :action=> 'account', host: Setting.host_user}%>
2015-03-17 15:30:15 +08:00
</li>
</ul>
</li>
2015-08-12 17:45:17 +08:00
2015-03-17 15:30:15 +08:00
<% end -%>
2015-03-18 16:16:18 +08:00
<%= header_render_menu :account_menu -%>
2015-03-17 15:30:15 +08:00
</ul>
</div><!--topuser_nav end-->
</div>
</div>