diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index 35a907ecc..97cca617e 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -31,6 +31,31 @@ module CoursesHelper # searchStudent(project).count 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 def searchTeacherAndAssistant project diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index 41e0c2a12..bbdfbfe66 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -1,257 +1,270 @@ <% @nav_dispaly_course_label = 1 %> - - - <%= h html_title %> - - - <%= csrf_meta_tag %> - <%= favicon %> - <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', 'nyan', :media => 'all' %> - <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %> - <%= javascript_heads %> - <%= javascript_include_tag "jquery.leanModal.min" %> - <%= heads_for_theme %> - <%= call_hook :view_layouts_base_html_head %> - - <%= yield :header_tags -%> - - - -
-
-
- <%= render :partial => 'layouts/base_header'%> -
- -
- <% @project = Project.find_by_id(@project.id)%> - <% @course = Course.find_by_extra(@project.identifier)%> - - - - - - - - - - -
高校课程实践社区<%= l(:label_user_location) %> : - -
<%=link_to request.host()+"/course", :controller => 'projects', :action => 'course' %>

<%=link_to "主页", home_path %> > <%=link_to l(:label_course_practice), :controller => 'projects', :action => 'course' %> > <%=link_to @project.name, nil %>

-
- - - -
-
-
    -
  • - <%= link_to l(:label_course_overview), project_path(@project), :class => link_class(:overview) %> -
  • -
  • - <%= link_to l(:label_homework), homework_project_path(@project), :class => link_class(:homework) ,:project_type => 1 %> -
  • -
  • - <%= link_to l(:label_course_file), project_files_path(@project), :class => link_class(:files)%> -
  • -
  • - <%= link_to l(:label_course_news), {:controller => 'news', :action => 'index', :project_id => @project}, :class => link_class(:news) %> -
  • -
  • - <%= link_to l(:label_course_board), { :controller => 'boards', :action => 'index', :project_id => @project}, :class => link_class(:boards) %> -
  • -
  • - <%= link_to l(:label_course_feedback), project_feedback_path(@project), :class => link_class(:feedback)%> -
  • - - <% if User.current.logged? && (User.current.admin? || (!Member.where('user_id = ? and project_id = ?', User.current.id, @project.id).first.nil? && (Member.where('user_id = ? and project_id = ?', User.current.id, @project.id).first.roles&Role.where('id = ? or id = ?', 7, 9)).size >0))%> +
+
+ +
+
+ <%= l(:label_project_overview) %> +
- <% end %> - -
- <%= render_flash_messages %> - <%= yield %> - <%= call_hook :view_layouts_base_content %> -
- - -
- - <%= render :partial => 'layouts/base_footer'%> -
- - -
-
- <%= call_hook :view_layouts_base_body_bottom %> - +
+ <% if @project.description.size>0 %> +
+ + <%= textilizable @project.description %> +
+ <% else %> +
+ <%= l(:label_course_description_no) %> +
+ <% end %> +
+ <%= l(:label_create_time) %>:<%= format_time(@project.created_on) %> +
+
+
+
+ + +
+ +
+
+ <%= render :partial => 'tags/tag', :locals => {:obj => @project, :object_flag => "2"} %> +
+
+
+ +
+ + +
+
+ +
+ <%= render_flash_messages %> + <%= yield %> + <%= call_hook :view_layouts_base_content %> +
+ + +
+ +<%= render :partial => 'layouts/base_footer' %> + + + + + +<%= call_hook :view_layouts_base_body_bottom %> + \ No newline at end of file diff --git a/app/views/welcome/course.html.erb b/app/views/welcome/course.html.erb index 48546b006..06269665e 100644 --- a/app/views/welcome/course.html.erb +++ b/app/views/welcome/course.html.erb @@ -109,7 +109,7 @@
[<%= get_course_term project %>] <%= 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 %> (<%=link_to "#{files_count}份", project_files_path(project) %>资料)
@@ -161,13 +161,11 @@
[<%= 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 "#{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 %> (<%=link_to "#{files_count}份", project_files_path(project) %>资料)
- +