From 8c83bbfff382bc243f443a13b2ec6dc2ec769ec8 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 27 Nov 2015 00:48:08 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E8=8B=B1=E9=9B=84=E6=A6=9C?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/courses_helper.rb | 4 +- app/views/courses/_tool_expand.html.erb | 92 ++++++------- app/views/layouts/base_courses.html.erb | 4 +- ...1125072235_add_course_contributor_score.rb | 64 +++++---- ...total_score_to_course_contributor_score.rb | 5 + db/schema.rb | 3 +- lib/trustie/gitlab/manage_member.rb | 126 +++++++++--------- 7 files changed, 155 insertions(+), 143 deletions(-) create mode 100644 db/migrate/20151126160252_add_total_score_to_course_contributor_score.rb diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index aa42d247e..022d86d9b 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -757,8 +757,8 @@ module CoursesHelper homework_scores end - def contributor_course_scor(course) - + def contributor_course_scor(course_id) + ccs = CourseContributorScore.where("course_id =?", course_id).limit(9) end end diff --git a/app/views/courses/_tool_expand.html.erb b/app/views/courses/_tool_expand.html.erb index 01454c8a8..cec5311c6 100644 --- a/app/views/courses/_tool_expand.html.erb +++ b/app/views/courses/_tool_expand.html.erb @@ -1,47 +1,47 @@ -<% course_file_num = visable_attachemnts_incourse(@course).count%> -<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) %> -<% if show_nav?(@course.homework_commons.count) %> - -<% end %> -<% if show_nav?(@course.news.count) %> - -<% end %> -<% if show_nav?(course_file_num) %> - -<% end %> -<% if show_nav?(@course.boards.first ? @course.boards.first.topics.count : 0) %> - -<% end %> -<% if show_nav?(course_feedback_count) %> - -<% end %> -<% if show_nav?(course_poll_count) %> - -<% end %> -<% if show_nav?(User.current.allowed_to?(:as_teacher,@course)? @course.exercises.count : @course.exercises.where("exercise_status=2").count) %> - +<% course_file_num = visable_attachemnts_incourse(@course).count%> +<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) %> +<% if show_nav?(@course.homework_commons.count) %> + +<% end %> +<% if show_nav?(@course.news.count) %> + +<% end %> +<% if show_nav?(course_file_num) %> + +<% end %> +<% if show_nav?(@course.boards.first ? @course.boards.first.topics.count : 0) %> + +<% end %> +<% if show_nav?(course_feedback_count) %> + +<% end %> +<% if show_nav?(course_poll_count) %> + +<% end %> +<% if show_nav?(User.current.allowed_to?(:as_teacher,@course)? @course.exercises.count : @course.exercises.where("exercise_status=2").count) %> + <% end %> \ No newline at end of file diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index c214145cc..604bf2601 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -205,7 +205,7 @@