Merge remote-tracking branch 'origin/szzh' into szzh

This commit is contained in:
sw 2014-05-20 08:49:00 +08:00
commit c141501085
3 changed files with 280 additions and 244 deletions

View File

@ -31,6 +31,31 @@ module CoursesHelper
# searchStudent(project).count # searchStudent(project).count
end end
# garble count 混淆数量
# alias projectCountOrigin projectCount
# def projectCount project
# count = projectCountOrigin project
# garble count
# end
alias teacherCountOrigin teacherCount
def teacherCount project
count = teacherCountOrigin project
garble count
end
alias studentCountOrigin studentCount
def studentCount project
count = studentCountOrigin project
garble count
end
def garble count
count = count.round( 1-count.to_s.size ).to_i
return count.to_s if count.to_s.size.eql?(1)
count.to_s << '+'
end
# ===================================================================================== # =====================================================================================
# return people list # return people list
def searchTeacherAndAssistant project def searchTeacherAndAssistant project

View File

@ -44,7 +44,9 @@
</tr> </tr>
<tr> <tr>
<td style="padding-left: 8px"><%= link_to request.host()+"/course", :controller => 'projects', :action => 'course' %></td> <td style="padding-left: 8px"><%= link_to request.host()+"/course", :controller => 'projects', :action => 'course' %></td>
<td><p class="top-content-list"><%=link_to "主页", home_path %> > <%=link_to l(:label_course_practice), :controller => 'projects', :action => 'course' %> > <%=link_to @project.name, nil %></p></td> <td><p class="top-content-list"><%= link_to "主页", home_path %>
> <%= link_to l(:label_course_practice), :controller => 'projects', :action => 'course' %>
> <%= link_to @project.name, nil %></p></td>
</tr> </tr>
</table> </table>
</div> </div>
@ -57,7 +59,8 @@
<% @project = Project.find_by_id(@project.id) %> <% @project = Project.find_by_id(@project.id) %>
<% @course = Course.find_by_extra(@project.identifier) %> <% @course = Course.find_by_extra(@project.identifier) %>
<table> <table>
<tr><td valign="top"> <tr>
<td valign="top">
<% if (@project.project_type==1) %> <% if (@project.project_type==1) %>
<% if get_avatar?(@project) %> <% if get_avatar?(@project) %>
<%= image_tag(url_to_avatar(@project), :class => "avatar2") %> <%= image_tag(url_to_avatar(@project), :class => "avatar2") %>
@ -68,10 +71,12 @@
<%= image_tag(url_to_avatar(@project), :class => "avatar2") %> <%= image_tag(url_to_avatar(@project), :class => "avatar2") %>
<% end %> </td> <% end %> </td>
<td> <td>
<table><tr> <table>
<tr>
<td class="info-course"><%= @project.name %></td> <td class="info-course"><%= @project.name %></td>
</tr> </tr>
<tr><td align="center"> <tr>
<td align="center">
<div id="join_in_course"> <div id="join_in_course">
<% if User.current.logged? %> <% if User.current.logged? %>
<% if @course.teacher.id == User.current.id %> <% if @course.teacher.id == User.current.id %>
@ -89,7 +94,9 @@
<% end %> <% end %>
<% end %> <% end %>
</div> </div>
</td></tr></table> </td>
</tr>
</table>
</td> </td>
</tr> </tr>
</table> </table>
@ -106,7 +113,6 @@
<% end %> <% end %>
<td class="font_index"> <td class="font_index">
<!-- %= link_to "#{@project.members.count}", project_member_path(@project) ,:course =>'1'% -->
<!-- 1 教师; 2 学生0 全部--> <!-- 1 教师; 2 学生0 全部-->
<%= link_to "#{teacherCount(@project)}", project_member_path(@project, :role => 1), :course => '1' %> <%= link_to "#{teacherCount(@project)}", project_member_path(@project, :role => 1), :course => '1' %>
</td> </td>
@ -138,33 +144,40 @@
<!-- addedby bai 教师姓名加超链接、加入开课时间、结课时间与课时 --> <!-- addedby bai 教师姓名加超链接、加入开课时间、结课时间与课时 -->
<tr> <tr>
<td valign="top" style="padding-left: 8px; width:60px"><%= l(:label_main_teacher) %> :</td><td class="font_lighter_sidebar"><%= link_to(@course.teacher.lastname+@course.teacher.firstname, user_path(@course.teacher)) %></td> <td valign="top" style="padding-left: 8px; width:60px"><%= l(:label_main_teacher) %> :</td>
<td class="font_lighter_sidebar"><%= link_to(@course.teacher.lastname+@course.teacher.firstname, user_path(@course.teacher)) %></td>
</tr> </tr>
<tr class="hidden"> <tr class="hidden">
<td valign="top" style="padding-left: 8px;"><%= l(:label_setup_time) %> :</td><td class="font_lighter_sidebar"><%= @course.setup_time %></td> <td valign="top" style="padding-left: 8px;"><%= l(:label_setup_time) %> :</td>
<td class="font_lighter_sidebar"><%= @course.setup_time %></td>
</tr> </tr>
<tr class="hidden"> <tr class="hidden">
<td valign="top" style="padding-left: 8px;"><%= l(:label_endup_time) %> :</td><td class="font_lighter_sidebar"><%= @course.endup_time %></td> <td valign="top" style="padding-left: 8px;"><%= l(:label_endup_time) %> :</td>
<td class="font_lighter_sidebar"><%= @course.endup_time %></td>
</tr> </tr>
<tr> <tr>
<td valign="top" style="padding-left: 8px;"><%= l(:label_class_period) %> :</td><td class="font_lighter_sidebar"><%= @course.class_period %>&nbsp;<%= l(:label_class_hour)%></td> <td valign="top" style="padding-left: 8px;"><%= l(:label_class_period) %> :</td>
<td class="font_lighter_sidebar"><%= @course.class_period %>&nbsp;<%= l(:label_class_hour) %></td>
</tr> </tr>
<tr> <tr>
<td valign="top" style="padding-left: 8px;"><%= l(:label_main_term) %> :</td><td class="font_lighter_sidebar"><%= @course.time %> <%= @course.term %></td> <td valign="top" style="padding-left: 8px;"><%= l(:label_main_term) %> :</td>
<td class="font_lighter_sidebar"><%= @course.time %> <%= @course.term %></td>
</tr> </tr>
<!-- end --> <!-- end -->
<% unless @course.teacher.user_extensions.nil? %> <% unless @course.teacher.user_extensions.nil? %>
<tr> <tr>
<td valign="top" style="padding-left: 8px;"><%= l(:label_teacher_work_unit) %> :</td><td class="font_lighter_sidebar"><%= @course.teacher.user_extensions.school %></td> <td valign="top" style="padding-left: 8px;"><%= l(:label_teacher_work_unit) %> :</td>
<td class="font_lighter_sidebar"><%= @course.teacher.user_extensions.school %></td>
</tr> </tr>
<% else %> <% else %>
<tr> <tr>
<td valign="top" style="padding-left: 8px;"><%= l(:label_teacher_work_unit) %> :</td><td class="font_lighter_sidebar"><%= l(:field_course_un) %></td> <td valign="top" style="padding-left: 8px;"><%= l(:label_teacher_work_unit) %> :</td>
<td class="font_lighter_sidebar"><%= l(:field_course_un) %></td>
</tr> </tr>
<% end %> <% end %>

View File

@ -109,7 +109,7 @@
<div class='desc_item text_nowrap' style="width: 310px;"> <div class='desc_item text_nowrap' style="width: 310px;">
[<%= get_course_term project %>] [<%= get_course_term project %>]
<%= link_to( project.name, project_path(project.id), :class => "d-g-blue d-p-project-name",:title => "#{project.name}" )%> <%= link_to( project.name, project_path(project.id), :class => "d-g-blue d-p-project-name",:title => "#{project.name}" )%>
(<%= "#{studentCount(project)}人" %><%#= link_to "#{studentCount(project)}人", project_member_path(project, :role => 2) ,:course =>'1' %>) (<%= "#{studentCount(project)}人" %>)
<% files_count = (project.attachments.count.to_i+Version.joins(:project).where("projects.id=#{project.id}").count.to_i).to_s %> <% files_count = (project.attachments.count.to_i+Version.joins(:project).where("projects.id=#{project.id}").count.to_i).to_s %>
(<%=link_to "#{files_count}份", project_files_path(project) %>资料) (<%=link_to "#{files_count}份", project_files_path(project) %>资料)
</div> </div>
@ -161,13 +161,11 @@
<div class='desc_item text_nowrap' style="width: 310px;"> <div class='desc_item text_nowrap' style="width: 310px;">
[<%= get_course_term project %>] [<%= get_course_term project %>]
<%= link_to( project.name, project_path(project.id), :class => "d-g-blue d-p-project-name",:title => "#{project.name}" )%> <%= link_to( project.name, project_path(project.id), :class => "d-g-blue d-p-project-name",:title => "#{project.name}" )%>
(<%= link_to "#{studentCount(project)}人", project_member_path(project, :role => 2) ,:course =>'1' %>) (<%= "#{studentCount(project)}人" %>)
<% files_count = (project.attachments.count.to_i+Version.joins(:project).where("projects.id=#{project.id}").count.to_i).to_s %> <% files_count = (project.attachments.count.to_i+Version.joins(:project).where("projects.id=#{project.id}").count.to_i).to_s %>
(<%=link_to "#{files_count}份", project_files_path(project) %>资料) (<%=link_to "#{files_count}份", project_files_path(project) %>资料)
</div> </div>
<!-- <div class='desc_item' style="">
<span class='font_lighter' title=<%#=project.description.to_s%>><%#=project.description.truncate(25, omission: '...')%></span>
</div> -->
<div class='join_course_link'> <div class='join_course_link'>
<% if !course_endTime_timeout?(project)%> <% if !course_endTime_timeout?(project)%>
<div > <div >
@ -207,7 +205,7 @@
<div class='desc_item text_nowrap' style="width: 310px;"> <div class='desc_item text_nowrap' style="width: 310px;">
[<%= get_course_term project %>] [<%= get_course_term project %>]
<%= link_to( project.name, project_path(project.id), :class => "d-g-blue d-p-project-name",:title => "#{project.name}" )%> <%= link_to( project.name, project_path(project.id), :class => "d-g-blue d-p-project-name",:title => "#{project.name}" )%>
(<%= link_to "#{studentCount(project)}人", project_member_path(project, :role => 2) ,:course =>'1' %>) <%= "#{studentCount(project)}人" %> )
<% files_count = (project.attachments.count.to_i+Version.joins(:project).where("projects.id=#{project.id}").count.to_i).to_s %> <% files_count = (project.attachments.count.to_i+Version.joins(:project).where("projects.id=#{project.id}").count.to_i).to_s %>
(<%=link_to "#{files_count}份", project_files_path(project) %>资料) (<%=link_to "#{files_count}份", project_files_path(project) %>资料)
</div> </div>