学生没有课程和项目时,课程和项目导航有2条线

This commit is contained in:
sw 2015-09-15 15:16:49 +08:00
parent 6127e0cee0
commit fff9c44271
1 changed files with 4 additions and 4 deletions

View File

@ -109,9 +109,9 @@
<% end%>
<% end%>
</div>
<div class="homepageLeftMenuCourses" id="homepageLeftMenuCourses">
<% 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)%>
<div class="homepageLeftMenuCourses <%= courses.empty? ? 'none' : ''%>" 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>
@ -122,9 +122,9 @@
<%=link_to "", new_project_path, :class => "homepageMenuSetting fr", :title => "新建项目"%>
<% end%>
</div>
<div class="homepageLeftMenuCourses" id="homepageLeftMenuForge">
<% 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)%>
<div class="homepageLeftMenuCourses <%= projects.empty? ? 'none' : ''%>" 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} %>
</ul>
</div>