2016-07-22 15:32:37 +08:00
|
|
|
<% 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 %>
|
|
|
|
<p class="sy_cgrey mb10">
|
2016-07-26 16:54:34 +08:00
|
|
|
<% if @course.syllabus %>
|
|
|
|
<%=link_to @course.syllabus.title, syllabus_path(@course.syllabus_id), :class => 'sy_cgrey' %>
|
|
|
|
>
|
|
|
|
<% end %>
|
2016-07-22 15:32:37 +08:00
|
|
|
<%=link_to @course.name, course_path(@course), :class => 'sy_cgrey' %>
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<% if is_teacher %>
|
|
|
|
<div class="homepagePostSetting" >
|
|
|
|
<ul>
|
|
|
|
<li class="homepagePostSettingIcon">
|
|
|
|
<ul class="homepagePostSettiongText">
|
|
|
|
<li><%= link_to "班级配置", {:controller => 'courses', :action => 'settings', :id => @course}, :class => "postOptionLink" %></li>
|
|
|
|
<li><%= link_to @course.is_public == 0 ? "设为公开" : "设为私有", {:controller => 'courses', :action => 'private_or_public', :id => @course},:remote=>true,:confirm=>"您确定要设置为"+(@course.is_public == 0 ? "公开" : "私有")+"吗", :class => "postOptionLink" %></li>
|
|
|
|
<li><%= link_to "复制学期", copy_course_course_path(@course.id),:remote=>true, :class => "postOptionLink" %></li>
|
2016-07-26 16:54:34 +08:00
|
|
|
<% if @course.syllabus %>
|
|
|
|
<li><%= link_to "进入课程", syllabus_path(@course.syllabus), :class => "postOptionLink", :target => "_blank" %></li>
|
|
|
|
<% end %>
|
2016-07-22 15:32:37 +08:00
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
<div class="sy_class_logo fl">
|
|
|
|
<%= image_tag(url_to_avatar(@course), :width => "110", :height => "110", :alt => "班级logo") %>
|
|
|
|
</div>
|
|
|
|
<div class="sy_class_id fl">
|
|
|
|
<p>邀请码<br /><span class="sy_corange"><%=@course.generate_invite_code %></span></p>
|
|
|
|
</div>
|
|
|
|
<div class="sy_class_info fl ml15">
|
|
|
|
<div class="sy_class_titbox">
|
|
|
|
<h3 class="fl sy_class_title"><%=@course.name %></h3>
|
|
|
|
<span class="icon_si fl mr20"><%=@course.is_public == 0 ? '私有' : '公开' %></span>
|
|
|
|
<p class="sy_cgrey fl mt3">
|
|
|
|
<span class=" mr15">教师:<%= course_teacher_link teacher_num %></span>
|
|
|
|
<span class=" mr15">学生:<%= course_student_link student_num %></span>
|
|
|
|
<span class=" mr15">资源:<%= link_to course_file_num, course_files_path(@course), :class => 'sy_cblue',:id=>'courses_files_count_info' %></span>
|
|
|
|
</p>
|
|
|
|
<div class="cl"></div>
|
|
|
|
</div>
|
|
|
|
<p class="sy_cgrey mb10">
|
|
|
|
<span class=" mr15">主讲老师:<%= link_to(@course.teacher.show_name, user_path(@course.teacher), :class => 'sy_cblue') %></span>
|
|
|
|
<span class=" mr15">学时:<span class="sy_cblack"><%= @course.class_period %>学时</span></span>
|
|
|
|
<span class=" mr15">学期:<span class="sy_cblack"><%= current_time_and_term @course %></span></span>
|
2016-07-22 18:20:11 +08:00
|
|
|
<span class=" mr15">单位:<span class="sy_cblack"><%= get_occupation_from_user(@course.teacher).blank? ? '无' : get_occupation_from_user(@course.teacher) %></span></span>
|
2016-07-22 15:32:37 +08:00
|
|
|
</p>
|
|
|
|
<!--<a href="javascript:void(0);" class="sy_btn_orange mr10" > 教师身份</a>-->
|
|
|
|
<% unless is_teacher %>
|
|
|
|
<div id="join_in_course_header"><%= join_in_course_header(@course, User.current) %></div>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
<div class="cl"></div>
|