% course_file_num = visable_attachemnts_incourse(@course).count%>
<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) %>
<% course_board = @course.boards.where("parent_id is NULL").first %>
<% if show_nav?(course_board ? course_board.topics.count : 0) %>
讨论区
<%= link_to( "",course_boards_path(@course, :flag => true, :is_new => 1), :class => 'sy_class_add', :title =>"#{l(:label_message_new)}") %>
<% unless course_board.children.empty? %>
<% end %>
<% end %>
<% if show_nav?(@course.homework_commons.count) %>
作业
<%= 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 %>
<% end %>
<% if show_nav?(@course.news.count) %>
通知
<%= link_to( "",new_course_news_path(@course,:is_new=>1), :class => 'sy_class_add', :title =>"#{l(:label_course_news_new)}") if is_teacher %>
<% end %>
<% if show_nav?(course_file_num) %>
资源库
<% if is_teacher || (@course.publish_resource == 1 && User.current.member_of_course?(@course)) %>
<% end %>
<% end %>
<% if show_nav?(course_feedback_count) %>
留言
<% if is_teacher || (@course.publish_resource == 1 && User.current.member_of_course?(@course)) %>
<%= link_to "", course_feedback_path(@course), :class => 'sy_class_add', :title =>"#{l(:label_course_feedback)}"%>
<% end %>
<% end %>
<% if show_nav?(course_poll_count) %>
@course.id) %>">问卷调查
<%= 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 %>
<% end %>
<% count = User.current.allowed_to?(:as_teacher,@course)? @course.exercises.count : @course.exercises.where("exercise_status <> 1").count %>
<% if show_nav?(count) %>
在线测验
<%= link_to( "", new_exercise_path(:course_id => @course.id), :class => 'sy_class_add', :title =>"新建试卷") if is_teacher %>
<% end %>
<% 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?) %>
<%=link_to "分班", course_member_path(@course, :role => 2) %>
<% end %>
<% if show_nav?(0) %>
统计
<% end %>