2015-11-27 00:48:08 +08:00
|
|
|
<% course_file_num = visable_attachemnts_incourse(@course).count%>
|
|
|
|
<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) %>
|
2016-10-14 14:28:19 +08:00
|
|
|
<% course_board = @course.boards.where("parent_id is NULL").first %>
|
|
|
|
<% if show_nav?(course_board ? course_board.topics.count : 0) %>
|
2016-07-22 15:32:37 +08:00
|
|
|
<li>
|
2016-08-25 15:59:09 +08:00
|
|
|
<a href="<%=course_boards_path(@course) %>">讨论区</a>
|
2016-07-22 15:32:37 +08:00
|
|
|
<%= link_to( "",course_boards_path(@course, :flag => true, :is_new => 1), :class => 'sy_class_add', :title =>"#{l(:label_message_new)}") %>
|
|
|
|
</li>
|
2016-10-14 14:28:19 +08:00
|
|
|
<% unless course_board.children.empty? %>
|
|
|
|
<ul class="sub-menu">
|
|
|
|
<% course_board.children.each do |board| %>
|
|
|
|
<li>
|
|
|
|
<% count = board ? (board.topics.count + Message.where("board_id =? and parent_id is not ?", board.id, nil).count) : 0 %>
|
|
|
|
<a href="<%=course_boards_path(@course, :board_id =>board.id) %>"><%=board.name %><span><%=count %></span></a>
|
|
|
|
<%= link_to( "",course_boards_path(@course, :board_id =>board.id, :flag => true, :is_new => 1), :class => 'sy_class_add', :title =>"#{l(:label_message_new)}") %>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
|
|
|
</ul>
|
|
|
|
<% end %>
|
2016-07-22 15:32:37 +08:00
|
|
|
<% end %>
|
2015-11-27 00:48:08 +08:00
|
|
|
<% if show_nav?(@course.homework_commons.count) %>
|
2016-07-22 15:32:37 +08:00
|
|
|
<li>
|
|
|
|
<a href="<%= homework_common_index_path(:course => @course.id) %>">作业</a>
|
|
|
|
<%= link_to( "",homework_common_index_path(:course => @course.id,:is_new => 1), :class => 'sy_class_add', :title =>"#{l(:label_course_homework_new)}") if is_teacher %>
|
|
|
|
</li>
|
2015-11-27 00:48:08 +08:00
|
|
|
<% end %>
|
|
|
|
<% if show_nav?(@course.news.count) %>
|
2016-07-22 15:32:37 +08:00
|
|
|
<li>
|
|
|
|
<a href="<%=course_news_index_path(@course) %>">通知</a>
|
|
|
|
<%= link_to( "",new_course_news_path(@course,:is_new=>1), :class => 'sy_class_add', :title =>"#{l(:label_course_news_new)}") if is_teacher %>
|
|
|
|
</li>
|
2015-11-27 00:48:08 +08:00
|
|
|
<% end %>
|
|
|
|
<% if show_nav?(course_file_num) %>
|
2016-07-22 15:32:37 +08:00
|
|
|
<li>
|
|
|
|
<a href="<%=course_files_path(@course) %>">资源库</a>
|
2015-11-27 00:48:08 +08:00
|
|
|
<% if is_teacher || (@course.publish_resource == 1 && User.current.member_of_course?(@course)) %>
|
2016-07-22 15:32:37 +08:00
|
|
|
<a class="sy_class_add" title="上传资源" href="javascript:void(0);" onclick="course_files_upload();"> </a>
|
2015-11-27 00:48:08 +08:00
|
|
|
<% end %>
|
2016-07-22 15:32:37 +08:00
|
|
|
</li>
|
2015-11-27 00:48:08 +08:00
|
|
|
<% end %>
|
|
|
|
<% if show_nav?(course_feedback_count) %>
|
2016-07-22 15:32:37 +08:00
|
|
|
<li>
|
|
|
|
<a href="<%=course_feedback_path(@course) %>">留言</a>
|
2016-10-14 09:29:53 +08:00
|
|
|
<% if is_teacher || (@course.publish_resource == 1 && User.current.member_of_course?(@course)) %>
|
2016-07-27 10:20:27 +08:00
|
|
|
<%= link_to "", course_feedback_path(@course), :class => 'sy_class_add', :title =>"#{l(:label_course_feedback)}"%>
|
2016-10-14 09:29:53 +08:00
|
|
|
<% end %>
|
2016-07-22 15:32:37 +08:00
|
|
|
</li>
|
2015-11-27 00:48:08 +08:00
|
|
|
<% end %>
|
|
|
|
<% if show_nav?(course_poll_count) %>
|
2016-07-22 15:32:37 +08:00
|
|
|
<li>
|
|
|
|
<a href="<%=poll_index_path(:polls_type => "Course", :polls_group_id => @course.id) %>">问卷调查</a>
|
|
|
|
<%= link_to( "", new_poll_path(:polls_type => "Course",:polls_group_id => @course.id), :class => 'sy_class_add', :title =>"#{l(:label_new_poll)}") if is_teacher %>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
|
|
|
<% count = User.current.allowed_to?(:as_teacher,@course)? @course.exercises.count : @course.exercises.where("exercise_status <> 1").count %>
|
|
|
|
<% if show_nav?(count) %>
|
|
|
|
<li>
|
|
|
|
<a href="<%=exercise_index_path(:course_id => @course.id) %>">在线测验</a>
|
|
|
|
<%= link_to( "", new_exercise_path(:course_id => @course.id), :class => 'sy_class_add', :title =>"新建试卷") if is_teacher %>
|
|
|
|
</li>
|
2015-11-27 00:48:08 +08:00
|
|
|
<% end %>
|
2016-09-30 17:12:40 +08:00
|
|
|
<% group_count = @course.course_groups.count %>
|
|
|
|
<% if show_nav?(group_count) && ((User.current.logged? && @course.open_student == 1) || (User.current.member_of_course?(@course)) || User.current.admin?) %>
|
2016-09-09 15:49:24 +08:00
|
|
|
<li>
|
|
|
|
<%=link_to "分班", course_member_path(@course, :role => 2) %>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
2016-07-22 15:32:37 +08:00
|
|
|
<% if show_nav?(0) %>
|
|
|
|
<li>
|
|
|
|
<a href="<%=statistics_course_course_path(@course) %>">统计</a>
|
|
|
|
</li>
|
2015-11-24 17:29:57 +08:00
|
|
|
<% end %>
|