<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) %> <% teacher_num = TeacherAndAssistantCount(@course) %> <% student_num = studentCount(@course) %> <% course_file_num = visable_attachemnts_incourse(@course).count %>

<%= link_to(@course.teacher.show_name, user_path(@course.teacher), :class => 'sy_cgrey') %>  >  <% if @course.syllabus %> <%=link_to @course.syllabus.title, syllabus_path(@course.syllabus_id), :class => 'sy_cgrey' %>  >  <% end %> <%=link_to @course.name, course_path(@course), :class => 'sy_cgrey' %>

<% if is_teacher %>
<% end %>

邀 请 码
<% if User.current.admin? || User.current.member_of_course?(@course) %> <%=@course.generate_invite_code %> <% else %> 请询问老师 <% end %>

<%= link_to @course.syllabus.title, syllabus_path(@course.syllabus_id), :class =>'c_dark', :target => '_blank'%>  ·  <%=@course.name %>

教师:<%= course_teacher_link teacher_num %> 学生:<%= course_student_link student_num %> 资源:<%= link_to course_file_num, course_files_path(@course), :class => 'sy_cblue',:id=>'courses_files_count_info' %>

主讲老师:<%= link_to(@course.teacher.show_name, user_path(@course.teacher), :class => 'sy_cblue') %> 学时:<%= @course.class_period %>学时 学期:<%= current_time_and_term @course %> 单位:<%= get_occupation_from_user(@course.teacher).blank? ? '无' : get_occupation_from_user(@course.teacher) %>

<% if is_teacher %> <%= link_to "班级设置", {:controller => 'courses', :action => 'settings', :id => @course}, :class => "sy_btn_grey mr10 fl" %> <% end %> <% is_TA = get_user_member_roles_course @course, User.current, 7 %> <% is_TE = get_user_member_roles_course @course, User.current, 9 %> <% is_ST = get_user_member_roles_course @course, User.current, 10 %> <% if !is_teacher && (is_TA || is_TE) %> <%= link_to '教师身份', switch_role_course_path(@course, :user_id => User.current.id, :curr_role => 10, :tar_role => (is_TA ? 7 : 9)), :class => "sy_btn_orange mr10 fl", :title => "由学生身份切换至教师身份" %> <% elsif is_teacher && is_ST %> <%= link_to '学生身份', switch_role_course_path(@course, :user_id => User.current.id, :curr_role => (is_TA ? 7 : 9), :tar_role => 10), :class => "sy_btn_orange mr10 fl", :title => "由教师身份切换至学生身份" %> <% end %> <% unless (is_teacher || is_TA || is_TE) %>
<%= join_in_course_header(@course, User.current) %>
<% end %>
<% if is_teacher %>

请将邀请码告诉学生和教辅

他们可以主动加入班级

<% end %>