班级和项目收藏夹

This commit is contained in:
cxt 2016-08-24 15:58:23 +08:00
parent 6af43070c7
commit 7d89f69981
4 changed files with 43 additions and 28 deletions

View File

@ -45,12 +45,6 @@
<%= link_to "论坛",course_boards_path(course), :class => 'user_navmore_li fl',:target => '_blank' %>
<%= link_to "+",course_boards_path(course, :flag => true, :is_new => 1), :class => 'user_navmore_add fl', :title => '发布帖子',:target => '_blank' %>
</li>
<li>
<%= link_to "取消收藏", :class => 'user_navmore_li',:target => '_blank' %>
<div class="cl"></div>
</li>
<% if !course.syllabus.nil? %>
<li>
<%= link_to "所属课程",syllabus_path(course.syllabus_id), :class => 'user_navmore_li',:target => '_blank' %>
@ -58,6 +52,10 @@
</li>
<% end %>
<% if User.current == user %>
<li>
<%= link_to "取消收藏", '', :class => 'user_navmore_li',:target => '_blank' %>
<div class="cl"></div>
</li>
<li>
<% if count == 0 %>
<%= link_to "屏蔽动态", shield_activities_path(:user_id => user.id, :course_id => course.id), :method => 'post', :class => 'user_navmore_li',:remote => true %>

View File

@ -1,31 +1,43 @@
<% unless courses.nil? %>
<% courses.each_with_index do |course, i| %>
<li class="syllabus_class_list <%=i > 2 ? 'none' : '' %>">
<li class="syllabus_class_list <%= i > 2 ? 'none' : '' %>">
<% allow_visit = User.current.member_of_course?(course) || User.current.admin? || course.is_public == 1 %>
<a href="<%= allow_visit ? course_path(course.id) : "javascript:void(0)" %>" target="_blank" title="<%= allow_visit ? "" : "私有班级不可访问"%>">
<span class="icons_sy_favorite " title="点击将其从个人主页的班级列表中移除"></span>
<span class="icons_sy_star " title="点击将其添加至个人主页的班级列表中"></span>
<div class="fl">
<div class="syllabus_class_w ">
<p class="syllabus_class_title fl"><%=course.name %></p>
<span class="<%= course.is_public == 0 ? 'syllabus_class_private' : 'syllabus_class_open' %> fl ml10 mt3 syllabus_class_property"><%= course.is_public == 0 ? '私有' : '公开' %></span>
<span class="fr sy_p_grey hidden" style="max-width: 120px;">主讲老师:<%=course.teacher.show_name %></span>
<div class="cl"></div>
</div>
<div class="">
<p class="fl grayTxt ">更新:<%=format_date Time.at(course.updatetime) %><span class="mr10"></span>学期:<%=current_time_and_term(course) %></p>
<p class="list-info fr grayTxt"><span><%=studentCount course %></span><span>学生</span><span>|</span><span><%=visable_course_homework course %></span><span>作业</span><span>|</span><span><%=visable_attachemnts_incourse(course).count %></span><span>资源</span></p>
<div class="cl"></div>
</div>
<span class="icons_sy_favorite " title="点击将其从个人主页的班级列表中移除"></span>
<span class="icons_sy_star " title="点击将其添加至个人主页的班级列表中"></span>
<div class="fl">
<div class="syllabus_class_w ">
<a href="<%= allow_visit ? course_path(course.id) : "javascript:void(0)" %>" class="syllabus_class_title fl" target="_blank" title="<%= allow_visit ? "" : "私有班级不可访问" %>"><%= course.name %></a>
<span class="<%= course.is_public == 0 ? 'syllabus_class_private' : 'syllabus_class_open' %> fl ml10 mt3 syllabus_class_property"><%= course.is_public == 0 ? '私有' : '公开' %></span>
<span class="fr sy_p_grey hidden" style="max-width: 120px;">主讲老师:<%= link_to course.teacher.show_name, user_path(course.teacher) %></span>
<div class="cl"></div>
</div>
<span class="icons_sy_arrow fl mt19 ml10" ></span>
<div class="cl"></div>
</a>
<div class="">
<p class="fl grayTxt ">更新:<%= format_date Time.at(course.updatetime) %><span class="mr10"></span>
学期:<%= current_time_and_term(course) %></p>
<p class="list-info fr grayTxt">
<% student_link = (User.current.logged? && course.open_student == 1 && course.is_public == 1) || (User.current.member_of_course?(course)) || User.current.admin? %>
<span><a href="<%= student_link ? course_member_path(course, :role => 2) : "javascript:void(0)" %>" target="_blank" title="<%= student_link ? "" : "学生列表不对外公开" %>"><%= studentCount course %></a></span><span>学生</span>
<span>|</span>
<span><a href="<%= allow_visit ? homework_common_index_path(:course => course.id) : "javascript:void(0)" %>" target="_blank" title="<%= allow_visit ? "" : "私有班级不可访问" %>"><%= visable_course_homework course %></a></span><span>作业</span>
<span>|</span>
<span><a href="<%= allow_visit ? course_files_path(course) : "javascript:void(0)" %>" target="_blank" title="<%= allow_visit ? "" : "私有班级不可访问" %>"><%= visable_attachemnts_incourse(course).count %></a></span><span>资源</span>
</p>
<div class="cl"></div>
</div>
</div>
<span class="icons_sy_arrow fl mt19 ml10"></span>
<div class="cl"></div>
</li>
<% end %>
<% if courses.count > 3 %>
<li class="syllabus_class_list_more" id="syllabus_class_list_more_<%=syllabus.id %>">
<a href="javascript:void(0);" id="expand_list_<%=syllabus.id %>" data-init="0" onclick="expand_course_list(<%=syllabus.id %>,'#syllabus_course_ul_<%=syllabus.id %> li','#expand_list_<%=syllabus.id %>',<%=courses.count %>)">共<%=courses.count %>个班级,点击全部展开</a>
<li class="syllabus_class_list_more" id="syllabus_class_list_more_<%= syllabus.id %>">
<a href="javascript:void(0);" id="expand_list_<%= syllabus.id %>" data-init="0" onclick="expand_course_list(<%=syllabus.id %>,'#syllabus_course_ul_<%=syllabus.id %> li','#expand_list_<%=syllabus.id %>',<%=courses.count %>)">共<%= courses.count %>
个班级,点击全部展开</a>
</li>
<% end %>
<% end %>

View File

@ -0,0 +1,5 @@
class AddIsCollectToMembers < ActiveRecord::Migration
def change
add_column :is_collect, :members, :integer, :default => 1
end
end

View File

@ -96,7 +96,7 @@ input.syllabus_input_min{
.syllabus_class_list_more{padding:8px; text-align:center;border-left:1px solid #e7e7e7;border-bottom:1px solid #e7e7e7;}
.syllabus_class_list_more:hover{ background:#ececec;}
.syllabus_class_list_more a{ color:#ff7e00;}
.syllabus_class_title{ font-size:14px; color:#333; max-width:480px; margin-bottom:3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
a.syllabus_class_title{ font-size:14px; color:#333; max-width:480px; margin-bottom:3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.syllabus_class_w{ width:650px;}
.syllabus_class_property {font-size:12px; padding:0 5px; border-radius:3px; line-height:14px;}
.syllabus_class_private {color:#ff4a1b; border:1px solid #ff4a1b;}