增加项目、课程的收起
This commit is contained in:
parent
e5bf355a17
commit
f01b5681a5
|
@ -94,7 +94,7 @@
|
|||
<%= link_to "动态",user_activities_path(@user.id),:class => "homepageMenuText"%>
|
||||
</div>
|
||||
<div class="homepageLeftMenuBlock">
|
||||
<a href="javascript:void(0);" class="homepageMenuText">课程</a>
|
||||
<a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuCourses').slideToggle();">课程</a>
|
||||
<% if is_current_user%>
|
||||
<% if User.current.user_extensions && User.current.user_extensions.identity == 0 && User.current.allowed_to?(:add_course, nil, :global => true)%>
|
||||
<%=link_to image_tag("../images/menu_setting.png",width:"14px", height: "14px",class: "homepageMenuSetting"), new_course_path%>
|
||||
|
@ -103,20 +103,20 @@
|
|||
<% end%>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="homepageLeftMenuCourses">
|
||||
<div class="homepageLeftMenuCourses" id="homepageLeftMenuCourses">
|
||||
<ul>
|
||||
<% courses = @user.courses.visible.select("courses.*,(SELECT MAX(created_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(5)%>
|
||||
<%= render :partial => 'layouts/user_courses', :locals => {:courses => courses,:user => @user, :page => 0} %>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="homepageLeftMenuBlock">
|
||||
<a href="javascript:void(0);" class="homepageMenuText">项目</a>
|
||||
<a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuForge').slideToggle();">项目</a>
|
||||
|
||||
<% if is_current_user%>
|
||||
<%=link_to image_tag("../images/menu_setting.png",width:"14px", height: "14px",class: "homepageMenuSetting"), new_project_path%>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="homepageLeftMenuCourses">
|
||||
<div class="homepageLeftMenuCourses" id="homepageLeftMenuForge">
|
||||
<ul>
|
||||
<% projects = @user.projects.visible.select("projects.*,(SELECT MAX(created_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a desc").limit(5)%>
|
||||
<%= render :partial => 'layouts/user_projects', :locals => {:projects => projects,:user => @user, :page => 0} %>
|
||||
|
|
Loading…
Reference in New Issue