增加项目、课程的收起

This commit is contained in:
sw 2015-08-29 11:33:58 +08:00
parent e5bf355a17
commit f01b5681a5
1 changed files with 4 additions and 4 deletions

View File

@ -94,7 +94,7 @@
<%= link_to "动态",user_activities_path(@user.id),:class => "homepageMenuText"%> <%= link_to "动态",user_activities_path(@user.id),:class => "homepageMenuText"%>
</div> </div>
<div class="homepageLeftMenuBlock"> <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 is_current_user%>
<% if User.current.user_extensions && User.current.user_extensions.identity == 0 && User.current.allowed_to?(:add_course, nil, :global => true)%> <% 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%> <%=link_to image_tag("../images/menu_setting.png",width:"14px", height: "14px",class: "homepageMenuSetting"), new_course_path%>
@ -103,20 +103,20 @@
<% end%> <% end%>
<% end%> <% end%>
</div> </div>
<div class="homepageLeftMenuCourses"> <div class="homepageLeftMenuCourses" id="homepageLeftMenuCourses">
<ul> <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)%> <% 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} %> <%= render :partial => 'layouts/user_courses', :locals => {:courses => courses,:user => @user, :page => 0} %>
</ul> </ul>
</div> </div>
<div class="homepageLeftMenuBlock"> <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%> <% if is_current_user%>
<%=link_to image_tag("../images/menu_setting.png",width:"14px", height: "14px",class: "homepageMenuSetting"), new_project_path%> <%=link_to image_tag("../images/menu_setting.png",width:"14px", height: "14px",class: "homepageMenuSetting"), new_project_path%>
<% end%> <% end%>
</div> </div>
<div class="homepageLeftMenuCourses"> <div class="homepageLeftMenuCourses" id="homepageLeftMenuForge">
<ul> <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)%> <% 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} %> <%= render :partial => 'layouts/user_projects', :locals => {:projects => projects,:user => @user, :page => 0} %>