课程统计信息优化
This commit is contained in:
parent
cb4b26762d
commit
ff2340baf9
|
@ -751,7 +751,7 @@ module CoursesHelper
|
|||
#加入课程、退出课程按钮
|
||||
def join_in_course_header(course, user, options=[])
|
||||
if user.logged?
|
||||
joined = course.members.map{|member| member.user_id}.include? user.id
|
||||
joined = course.members.includes(:user).map{|member| member.user_id}.include? user.id
|
||||
text = joined ? l(:label_course_exit_student) : l(:label_course_join_student)
|
||||
url = joined ? join_path(:object_id => course.id) : try_join_path(:object_id => course.id)
|
||||
method = joined ? 'delete' : 'post'
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) %>
|
||||
<% teacher_num = TeacherAndAssistantCount(@course) %>
|
||||
<% student_num = studentCount(@course) %>
|
||||
<% teacher_num = 0 %>
|
||||
<% student_num = 0 %>
|
||||
<div class="pr_info_logo fl mr10 mb5">
|
||||
<% if is_excellent_course(@course) %>
|
||||
<img src="/images/course/boutique.png" width="50" height="auto" alt="精品" class="boutiqueP" />
|
||||
<% end %>
|
||||
<%= image_tag(url_to_avatar(@course), :width => "60", :height => "60") %>
|
||||
</div>
|
||||
<div class="pr_info_id fl mb5 f14">ID:<%= @course.id%><%= @course.is_public == 0 ? "(私有)" : "(公开)" %>
|
||||
<div class="pr_info_id fl mb5 f14">ID:<%= @course.id %><%= @course.is_public == 0 ? "(私有)" : "(公开)" %>
|
||||
<% if is_excellent_course(@course) %>
|
||||
<img src="/images/course/medal.png" alt="精品课程" style="vertical-align:bottom;" class="ml5" />
|
||||
<% end %>
|
||||
|
|
Loading…
Reference in New Issue