<% if User.current.projects.count>0 %>
    <li id="project_loggedas_li" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
      <%= link_to l(:label_my_projects), {:controller => 'users', :action => 'user_projects', id: User.current.id, host: Setting.host_name} %>
      <ul class="project_sub_menu" style="top:<%= hasCourse ? 35 : 0 %>px;">
        <% 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| %>
            <li style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" title="<%=project.name%>">
              <%= link_to project.name, {:controller => 'projects', :action => 'show',id: project.id, host: Setting.host_name } %>
            </li>
        <% end %>
      </ul>
    </li>
<% end %>
