% courses.each do |course|%>
<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,course)) %>
<%#= link_to course.name+"("+current_time_and_term_short(course)+")", course_path(course.id,:host=>Setting.host_course),
:id => "show_course_#{course.id}", :class => 'course_list_menu hidden', :target => '_blank', :title => (course.is_public? ? "公开班级:":"私有班级:")+course.name+"("+current_time_and_term(course)+")"%>
<% count = ShieldActivity.where("container_type='User' and container_id=#{user.id} and shield_type='Course' and shield_id=#{course.id}").count %>
<% wechat_count = ShieldWechatMessage.where("container_type='User' and container_id=#{user.id} and shield_type='Course' and shield_id=#{course.id}").count %>
-
<% if is_teacher %>
-
<%= link_to "作业",homework_common_index_path(:course => course.id), :class => 'user_navmore_li fl', :target => '_blank' %>
<%= link_to '+',homework_common_index_path(:course => course.id,:is_new => 1), :class => 'user_navmore_add fl', :title => '发布作业',:target => '_blank' %>
-
<%= link_to "通知", course_news_index_path(course), :class => 'user_navmore_li fl',:target => '_blank' %>
<%= link_to "+", new_course_news_path(course,:is_new=>1), :class => 'user_navmore_add fl', :title => '发布通知',:target => '_blank' %>
<% else %>
-
<%= link_to "作业",homework_common_index_path(:course => course.id), :class => 'user_navmore_li', :target => '_blank' %>
-
<%= link_to "通知", course_news_index_path(course), :class => 'user_navmore_li',:target => '_blank' %>
<% end %>
<% if is_teacher || (course.publish_resource == 1 && User.current.member_of_course?(course)) %>
-
<%= link_to "资源",course_files_path(course), :class => 'user_navmore_li fl',:target => '_blank' %>
<%= link_to "+",upload_files_menu_path(:course_id => course.id), :class => 'user_navmore_add fl',:remote => true, :title => '上传资源' %>
<% else %>
-
<%= link_to "资源",course_files_path(course), :class => 'user_navmore_li',:target => '_blank' %>
<% end %>
-
<%= 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' %>
<% if !course.syllabus.nil? %>
-
<%= link_to "所属课程",syllabus_path(course.syllabus_id), :class => 'user_navmore_li',:target => '_blank' %>
<% end %>
<% if User.current == user %>
-
<%= link_to "取消收藏", cancel_or_collect_user_path(user, :course => course.id), :class => 'user_navmore_li',:target => '_blank', :remote => true %>
-
<% if count == 0 %>
<%= link_to "屏蔽动态", shield_activities_path(:user_id => user.id, :course_id => course.id), :method => 'post', :class => 'user_navmore_li',:remote => true %>
<% else %>
<%= link_to "显示动态", show_acts_shield_activities_path(:user_id => user.id, :course_id => course.id),:remote => true,:method => 'delete', :class => 'user_navmore_li' %>
<% end %>
-
<% if wechat_count == 0 %>
<%= link_to "屏蔽微信消息", shield_wechat_messages_path(:user_id => user.id, :course_id => course.id), :method => 'post',:remote => true, :class => 'user_navmore_li' %>
<% else %>
<%= link_to "接收微信消息", show_messages_shield_wechat_messages_path(:user_id => user.id, :course_id => course.id),:remote => true,:method => 'delete', :class => 'user_navmore_li' %>
<% end %>
<% end %>
<% if User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,course)) %>
-
<%= link_to course.is_public == 0 ? "设为公开" : "设为私有", {:controller => 'courses', :action => 'private_or_public', :id => course,:user_page => true},
:id => "set_course_public_#{course.id.to_s}",:remote=>true, :class => 'user_navmore_li',:confirm=>"您确定要设置为"+(course.is_public == 0 ? "公开" : "私有")+"吗"%>
<% end %>
<% end %>
<% if all_count > (page.to_i+1) * 10%>
<% end%>