2016-01-14 15:59:50 +08:00
|
|
|
|
<% courses.each do |course|%>
|
|
|
|
|
<li class="homepageLeftMenuCoursesLine pr">
|
|
|
|
|
<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,course)) %>
|
2016-03-17 16:17:33 +08:00
|
|
|
|
<%= link_to course.name+"("+current_time_and_term_short(course)+")", course_path(course.id,:host=>Setting.host_course), :class => "coursesLineGrey hidden #{course_endTime_timeout?(course) ? 'c_dark_grey' : ''}",
|
2016-03-11 11:34:16 +08:00
|
|
|
|
:id => "show_course_#{course.id}", :target => '_blank', :title => (course.is_public? ? "公开课程:":"私有课程:")+course.name+"("+current_time_and_term(course)+")"%>
|
2016-01-14 15:59:50 +08:00
|
|
|
|
<% count = ShieldActivity.where("container_type='User' and container_id=#{user.id} and shield_type='Course' and shield_id=#{course.id}").count %>
|
|
|
|
|
<ul class="<%= count > 0 ? 'shild shildP':'subNavArrow'%>">
|
|
|
|
|
<li>
|
|
|
|
|
<ul class="subNavMenu boxShadow">
|
|
|
|
|
<% if is_teacher %>
|
|
|
|
|
<li class="subNavRow">
|
|
|
|
|
<%= link_to "作业",homework_common_index_path(:course => course.id), :class => 'fl fontGrey2 w48', :target => '_blank' %>
|
|
|
|
|
<%= link_to '+',homework_common_index_path(:course => course.id,:is_new => 1), :class => 'fr fb', :title => '发布作业',:target => '_blank' %>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
</li>
|
|
|
|
|
<li class="subNavRow">
|
|
|
|
|
<%= link_to "通知", course_news_index_path(course), :class => 'fl w48',:target => '_blank' %>
|
|
|
|
|
<%= link_to "+", new_course_news_path(course,:is_new=>1), :class => 'fr fb', :title => '发布通知',:target => '_blank' %>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
</li>
|
|
|
|
|
<% else %>
|
|
|
|
|
<li class="subNavRow">
|
|
|
|
|
<%= link_to "作业",homework_common_index_path(:course => course.id), :target => '_blank' %>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
</li>
|
|
|
|
|
<li class="subNavRow">
|
|
|
|
|
<%= link_to "通知", course_news_index_path(course),:target => '_blank' %>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
</li>
|
|
|
|
|
<% end %>
|
|
|
|
|
<% if is_teacher || (course.publish_resource == 1 && User.current.member_of_course?(course)) %>
|
|
|
|
|
<li class="subNavRow">
|
|
|
|
|
<%= link_to "资源",course_files_path(course), :class => 'fl w48',:target => '_blank' %>
|
|
|
|
|
<%= link_to "+",upload_files_menu_path(:course_id => course.id), :class => 'fr fb',:remote => true, :title => '上传资源' %>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
</li>
|
|
|
|
|
<% else %>
|
|
|
|
|
<li class="subNavRow">
|
|
|
|
|
<%= link_to "资源",course_files_path(course),:target => '_blank' %>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
</li>
|
|
|
|
|
<% end %>
|
|
|
|
|
<li class="subNavRow">
|
|
|
|
|
<%= link_to "论坛",course_boards_path(course), :class => 'fl w48',:target => '_blank' %>
|
|
|
|
|
<%= link_to "+",course_boards_path(course, :flag => true, :is_new => 1), :class => 'fr fb', :title => '发布帖子',:target => '_blank' %>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
</li>
|
|
|
|
|
<% if User.current == @user %>
|
|
|
|
|
<li class="subNavRow">
|
|
|
|
|
<% if count == 0 %>
|
|
|
|
|
<%= link_to "屏蔽动态", shield_activities_path(:user_id => user.id, :course_id => course.id), :method => 'post',:remote => true %>
|
|
|
|
|
<% else %>
|
|
|
|
|
<%= link_to "显示动态", show_acts_shield_activities_path(:user_id => user.id, :course_id => course.id),:remote => true,:method => 'delete' %>
|
|
|
|
|
<% end %>
|
|
|
|
|
</li>
|
|
|
|
|
<% end %>
|
|
|
|
|
<% if User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,course)) %>
|
|
|
|
|
<li class="subNavRow">
|
|
|
|
|
<%= 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,:confirm=>"您确定要设置为"+(course.is_public == 0 ? "公开" : "私有")+"吗"%>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
</li>
|
|
|
|
|
<% end %>
|
|
|
|
|
</ul>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
</li>
|
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
|
|
<% if courses.size == 5%>
|
|
|
|
|
<li class="homepageLeftMenuMore" id="user_show_more_course">
|
|
|
|
|
<input type="hidden" value="<%= page%>" id="course_page_num">
|
|
|
|
|
<a href="javascript:void(0);" class="homepageLeftMenuMoreIcon" onclick="show_more_course('<%= user_courses4show_user_path(user.id)%>');"></a>
|
|
|
|
|
</li>
|
2015-08-24 14:44:22 +08:00
|
|
|
|
<% end%>
|