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
|
end
|
||||||
|
|
||||||
|
|
||||||
alias teacherCountOrigin teacherCount
|
#alias teacherCountOrigin teacherCount
|
||||||
def teacherCount project
|
#def teacherCount project
|
||||||
count = teacherCountOrigin project
|
# count = teacherCountOrigin project
|
||||||
garble count
|
# garble count
|
||||||
end
|
#end
|
||||||
|
|
||||||
# 注意:此方法有问题,速度慢且结果不准
|
# 注意:此方法有问题,速度慢且结果不准
|
||||||
# alias studentCountOrigin studentCount
|
# alias studentCountOrigin studentCount
|
||||||
|
@ -114,7 +114,7 @@ module CoursesHelper
|
||||||
# 学生人数计算
|
# 学生人数计算
|
||||||
# add by nwb
|
# add by nwb
|
||||||
def studentCount course
|
def studentCount course
|
||||||
count = course.student.count
|
count = searchStudent(course).count#course.student.count
|
||||||
if count <= 5
|
if count <= 5
|
||||||
result = count.to_s
|
result = count.to_s
|
||||||
elsif count < 10 && count > 5
|
elsif count < 10 && count > 5
|
||||||
|
@ -125,6 +125,19 @@ module CoursesHelper
|
||||||
result
|
result
|
||||||
end
|
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
|
def eventToLanguageCourse event_type, course
|
||||||
case event_type
|
case event_type
|
||||||
when "issue-note"
|
when "issue-note"
|
||||||
|
|
|
@ -26,9 +26,9 @@
|
||||||
|
|
||||||
|
|
||||||
<div class="autoscroll">
|
<div class="autoscroll">
|
||||||
<table class="list">
|
<table class="list" style="width: 100%;table-layout: fixed">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr >
|
||||||
<%= sort_header_tag('login', :caption => l(:field_login)) %>
|
<%= sort_header_tag('login', :caption => l(:field_login)) %>
|
||||||
<%= sort_header_tag('firstname', :caption => l(:field_firstname)) %>
|
<%= sort_header_tag('firstname', :caption => l(:field_firstname)) %>
|
||||||
<%= sort_header_tag('lastname', :caption => l(:field_lastname)) %>
|
<%= sort_header_tag('lastname', :caption => l(:field_lastname)) %>
|
||||||
|
@ -40,16 +40,25 @@
|
||||||
<th></th>
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</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>
|
<tbody>
|
||||||
<% for user in @users -%>
|
<% for user in @users -%>
|
||||||
<tr class="<%= user.css_classes %> <%= cycle("odd", "even") %>">
|
<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 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 class="firstname"><%= h(user.firstname) %></td>
|
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="firstname" align="center" title='<%=user.firstname%>'><%= h(user.firstname) %></td>
|
||||||
<td class="lastname"><%= h(user.lastname) %></td>
|
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="lastname" align="center" title='<%=user.lastname%>'><%= h(user.lastname) %></td>
|
||||||
<td class="email"><%= mail_to(h(user.mail)) %></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 align="center"><%= checked_image user.admin? %></td>
|
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" align="center" align="center"><%= checked_image user.admin? %></td>
|
||||||
<td class="created_on" align="center"><%= format_time(user.created_on) %></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 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="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) %>
|
<td class="buttons"> <%= change_status_link(user) %>
|
||||||
<%= delete_link user_path(user, :back_url => admin_users_path(params)) unless User.current == user %> </td>
|
<%= delete_link user_path(user, :back_url => admin_users_path(params)) unless User.current == user %> </td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -123,7 +123,7 @@
|
||||||
<div class='desc_item text_nowrap'>
|
<div class='desc_item text_nowrap'>
|
||||||
[<%= get_course_term course %>]
|
[<%= 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}") %>
|
<%= 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 %>
|
<% files_count = course.attachments.count.to_s %>
|
||||||
(<%= link_to "#{files_count}份", course_files_path(course) %>资料)
|
(<%= link_to "#{files_count}份", course_files_path(course) %>资料)
|
||||||
</div>
|
</div>
|
||||||
|
@ -164,7 +164,7 @@
|
||||||
<div class='desc_item text_nowrap'>
|
<div class='desc_item text_nowrap'>
|
||||||
[<%= get_course_term course %>]
|
[<%= 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}") %>
|
<%= 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 %>
|
<% files_count = course.attachments.count.to_s %>
|
||||||
(<%= link_to "#{files_count}份", course_files_path(course) %>资料)
|
(<%= link_to "#{files_count}份", course_files_path(course) %>资料)
|
||||||
</div>
|
</div>
|
||||||
|
@ -211,7 +211,7 @@
|
||||||
<div class='desc_item text_nowrap'>
|
<div class='desc_item text_nowrap'>
|
||||||
[<%= get_course_term course %>]
|
[<%= 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}") %>
|
<%= 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 %>
|
<% files_count = course.attachments.count.to_i.to_s %>
|
||||||
(<%= link_to "#{files_count}份", course_files_path(course) %>资料)
|
(<%= link_to "#{files_count}份", course_files_path(course) %>资料)
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue