Merge branch 'szzh' of http://repository.trustie.net/xianbo/trustie2 into szzh
This commit is contained in:
commit
209c1aeaab
|
@ -98,11 +98,11 @@ module CoursesHelper
|
|||
end
|
||||
|
||||
|
||||
alias teacherCountOrigin teacherCount
|
||||
def teacherCount project
|
||||
count = teacherCountOrigin project
|
||||
garble count
|
||||
end
|
||||
#alias teacherCountOrigin teacherCount
|
||||
#def teacherCount project
|
||||
# count = teacherCountOrigin project
|
||||
# garble count
|
||||
#end
|
||||
|
||||
# 注意:此方法有问题,速度慢且结果不准
|
||||
# alias studentCountOrigin studentCount
|
||||
|
@ -114,7 +114,7 @@ module CoursesHelper
|
|||
# 学生人数计算
|
||||
# add by nwb
|
||||
def studentCount course
|
||||
count = course.student.count
|
||||
count = searchStudent(course).count#course.student.count
|
||||
if count <= 5
|
||||
result = count.to_s
|
||||
elsif count < 10 && count > 5
|
||||
|
@ -125,6 +125,19 @@ module CoursesHelper
|
|||
result
|
||||
end
|
||||
|
||||
#课程成员数计算
|
||||
def memberCount course
|
||||
count = searchStudent(course).count + searchTeacherAndAssistant(course).count
|
||||
if count <= 5
|
||||
result = count.to_s
|
||||
elsif count < 10 && count > 5
|
||||
result = "5+"
|
||||
else
|
||||
result = (count-count % 10).to_s + "+"
|
||||
end
|
||||
result
|
||||
end
|
||||
|
||||
def eventToLanguageCourse event_type, course
|
||||
case event_type
|
||||
when "issue-note"
|
||||
|
|
|
@ -26,9 +26,9 @@
|
|||
|
||||
|
||||
<div class="autoscroll">
|
||||
<table class="list">
|
||||
<table class="list" style="width: 100%;table-layout: fixed">
|
||||
<thead>
|
||||
<tr>
|
||||
<tr >
|
||||
<%= sort_header_tag('login', :caption => l(:field_login)) %>
|
||||
<%= sort_header_tag('firstname', :caption => l(:field_firstname)) %>
|
||||
<%= sort_header_tag('lastname', :caption => l(:field_lastname)) %>
|
||||
|
@ -40,16 +40,25 @@
|
|||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<col style="width: 20%" />
|
||||
<col style="width: 10%" />
|
||||
<col style="width: 5%" />
|
||||
<col style="width: 20%" />
|
||||
<col style="width: 5%" />
|
||||
<col style="width: 15%" />
|
||||
<col style="width: 15%" />
|
||||
<col style="width: 5%" />
|
||||
<col style="width: 5%" />
|
||||
<tbody>
|
||||
<% for user in @users -%>
|
||||
<tr class="<%= user.css_classes %> <%= cycle("odd", "even") %>">
|
||||
<td class="username"><%= avatar(user, :size => "14") %><%= link_to h(user.login), edit_user_path(user) %></td>
|
||||
<td class="firstname"><%= h(user.firstname) %></td>
|
||||
<td class="lastname"><%= h(user.lastname) %></td>
|
||||
<td class="email"><%= mail_to(h(user.mail)) %></td>
|
||||
<td align="center"><%= checked_image user.admin? %></td>
|
||||
<td class="created_on" align="center"><%= format_time(user.created_on) %></td>
|
||||
<td class="last_login_on" align="center"><%= format_time(user.last_login_on) unless user.last_login_on.nil? %></td>
|
||||
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="username" title='<%=user.login%>'> <%= avatar(user, :size => "14") %><%= link_to h(user.login), edit_user_path(user) %></td>
|
||||
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="firstname" align="center" title='<%=user.firstname%>'><%= h(user.firstname) %></td>
|
||||
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="lastname" align="center" title='<%=user.lastname%>'><%= h(user.lastname) %></td>
|
||||
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="email" align="center" title='<%=user.mail%>'><%= mail_to(h(user.mail)) %></td>
|
||||
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" align="center" align="center"><%= checked_image user.admin? %></td>
|
||||
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="created_on" align="center" title='<%=format_time(user.created_on)%>'><%= format_time(user.created_on) %></td>
|
||||
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="last_login_on" align="center" title='<%= format_time(user.last_login_on)%>'><%= format_time(user.last_login_on) unless user.last_login_on.nil? %></td>
|
||||
<td class="buttons"> <%= change_status_link(user) %>
|
||||
<%= delete_link user_path(user, :back_url => admin_users_path(params)) unless User.current == user %> </td>
|
||||
</tr>
|
||||
|
|
|
@ -123,7 +123,7 @@
|
|||
<div class='desc_item text_nowrap'>
|
||||
[<%= get_course_term course %>]
|
||||
<%= link_to(course.name.truncate(30, omission: '...'), course_path(course.id), :class => "d-g-blue d-p-project-name", :title => "#{course.name}") %>
|
||||
(<%= "#{studentCount(course)}人" %>)
|
||||
(<%= "#{memberCount(course)}人" %>)
|
||||
<% files_count = course.attachments.count.to_s %>
|
||||
(<%= link_to "#{files_count}份", course_files_path(course) %>资料)
|
||||
</div>
|
||||
|
@ -164,7 +164,7 @@
|
|||
<div class='desc_item text_nowrap'>
|
||||
[<%= get_course_term course %>]
|
||||
<%= link_to(course.name.truncate(30, omission: '...'), course_path(course.id), :class => "d-g-blue d-p-project-name", :title => "#{course.name}") %>
|
||||
(<%= "#{studentCount(course)}人" %>)
|
||||
(<%= "#{memberCount(course)}人" %>)
|
||||
<% files_count = course.attachments.count.to_s %>
|
||||
(<%= link_to "#{files_count}份", course_files_path(course) %>资料)
|
||||
</div>
|
||||
|
@ -211,7 +211,7 @@
|
|||
<div class='desc_item text_nowrap'>
|
||||
[<%= get_course_term course %>]
|
||||
<%= link_to(course.name.truncate(30, omission: '...'), course_path(course.id), :class => "d-g-blue d-p-project-name", :title => "#{course.name}") %>
|
||||
(<%= "#{studentCount(course)}人" %> )
|
||||
(<%= "#{memberCount(course)}人" %> )
|
||||
<% files_count = course.attachments.count.to_i.to_s %>
|
||||
(<%= link_to "#{files_count}份", course_files_path(course) %>资料)
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue