From cf2810f1c68bab0f722b451814eeeaad619de4f3 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 15 Dec 2014 15:13:11 +0800 Subject: [PATCH 01/14] =?UTF-8?q?#1712=E7=82=B9=E5=87=BB=E6=89=93=E5=BC=80?= =?UTF-8?q?=E6=9F=90=E7=AB=9E=E8=B5=9B=E4=BD=9C=E5=93=81=EF=BC=8C=E7=BD=91?= =?UTF-8?q?=E9=A1=B5=E5=90=8D=E6=98=BE=E7=A4=BA=E4=B8=BA=E6=89=98=E7=AE=A1?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=9A=84=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/softapplications_controller.rb | 2 +- .../layouts/_base_softapplication_top_content.html.erb | 3 ++- app/views/softapplications/show.html.erb | 6 ++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/controllers/softapplications_controller.rb b/app/controllers/softapplications_controller.rb index 5b6111187..e47cfc2ff 100644 --- a/app/controllers/softapplications_controller.rb +++ b/app/controllers/softapplications_controller.rb @@ -48,7 +48,7 @@ class SoftapplicationsController < ApplicationController def show @softapplication = Softapplication.find(params[:id]) - @project = @softapplication.project + #@project = @softapplication.project # 打分统计 stars_reates = @softapplication. rates(:quality) diff --git a/app/views/layouts/_base_softapplication_top_content.html.erb b/app/views/layouts/_base_softapplication_top_content.html.erb index afa2e1d29..46d45c903 100644 --- a/app/views/layouts/_base_softapplication_top_content.html.erb +++ b/app/views/layouts/_base_softapplication_top_content.html.erb @@ -17,7 +17,8 @@ <%=link_to l(:field_homepage), home_path %> > <%= l(:label_contest_innovate) %> - <% contest = @softapplication.contests.first %><%= contest ? link_to(contest.name, show_contest_contest_path(contest)) : '尚未加入竞赛'%> + <% contest = @softapplication.contests.first %> + <%= contest ? link_to(">" + contest.name, show_contest_contest_path(contest)) : '尚未加入竞赛'%> diff --git a/app/views/softapplications/show.html.erb b/app/views/softapplications/show.html.erb index 7a2edfa1f..77cc6aa71 100644 --- a/app/views/softapplications/show.html.erb +++ b/app/views/softapplications/show.html.erb @@ -1,4 +1,5 @@ <%= render :partial => 'layouts/base_softapplication_top_content' %> +<% html_title(@softapplication.name) -%>
@@ -47,8 +48,9 @@ - <% if @project %> - <%=l(:label_attendingcontestwork_deposit_project)%>:<%= link_to "#@project", project_path(@project) %> + <% if @softapplication.project %> + <%=l(:label_attendingcontestwork_deposit_project)%>: + <%= link_to "#{@softapplication.project}", project_path(@softapplication.project) %> <% end %> From 9280da5b61e298ec2b473647b560f27c4c1dedb3 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 15 Dec 2014 15:19:03 +0800 Subject: [PATCH 02/14] =?UTF-8?q?=E5=8F=96=E6=B6=88=E6=8F=8F=E8=BF=B0?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E4=B8=BA=E7=A9=BA=E7=9A=84=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/course.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/course.rb b/app/models/course.rb index ef42d91e8..196e7168d 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -36,7 +36,7 @@ class Course < ActiveRecord::Base acts_as_attachable :view_permission => :view_course_files, :delete_permission => :manage_files - validates_presence_of :password, :term,:name,:description + validates_presence_of :password, :term,:name validates_format_of :class_period, :with =>/^[1-9]\d*$/ validates_format_of :name,:with =>/^[a-zA-Z0-9_\u4e00-\u9fa5]+$/ validates_length_of :description, :maximum => 10000 From 5966a1edb6ac417d6fe74163422a5209cd4326f1 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 15 Dec 2014 16:20:58 +0800 Subject: [PATCH 03/14] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=80=81=E5=B8=88?= =?UTF-8?q?=E5=BC=80=E5=90=AF=E5=8C=BF=E8=AF=84=E6=97=B6=E7=9A=84=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_attach_controller.rb | 2 +- app/views/bids/_alert_anonyoms.html.erb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/homework_attach_controller.rb b/app/controllers/homework_attach_controller.rb index 72755dc6a..5c4542944 100644 --- a/app/controllers/homework_attach_controller.rb +++ b/app/controllers/homework_attach_controller.rb @@ -348,7 +348,7 @@ class HomeworkAttachController < ApplicationController else end else - render_403 :message => :notice_not_authorized + render_403 end end diff --git a/app/views/bids/_alert_anonyoms.html.erb b/app/views/bids/_alert_anonyoms.html.erb index e4e9076a5..567a3f81f 100644 --- a/app/views/bids/_alert_anonyoms.html.erb +++ b/app/views/bids/_alert_anonyoms.html.erb @@ -50,8 +50,8 @@

开启匿评功能

开启匿评后学生将不能对作业进行 - 提交、修改、删除 - 等操作,目前有 + 提交作业 + 操作,目前有 <%= totle_size%>个 学生,共提交了 <%= cur_size %> From 3d81331f439939039b49b868abc71ccf5fd9051b Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 15 Dec 2014 16:21:17 +0800 Subject: [PATCH 04/14] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=80=81=E5=B8=88?= =?UTF-8?q?=E5=BC=80=E5=90=AF=E5=8C=BF=E8=AF=84=E6=97=B6=E7=9A=84=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/bids/_alert_anonyoms.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/bids/_alert_anonyoms.html.erb b/app/views/bids/_alert_anonyoms.html.erb index 567a3f81f..f26487126 100644 --- a/app/views/bids/_alert_anonyoms.html.erb +++ b/app/views/bids/_alert_anonyoms.html.erb @@ -50,8 +50,8 @@

开启匿评功能

开启匿评后学生将不能对作业进行 - 提交作业 - 操作,目前有 + 修改、删除 + 等操作,目前有 <%= totle_size%>个 学生,共提交了 <%= cur_size %> From 7c1b86556dbab1592de5aa35595ec176b3303560 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Wed, 17 Dec 2014 17:36:12 +0800 Subject: [PATCH 05/14] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E3=80=8A=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A=E8=AF=84=E5=88=86=E5=BC=B9=E7=AA=97=E3=80=8B=E3=80=8A?= =?UTF-8?q?=E5=AD=A6=E7=94=9F=E5=88=97=E8=A1=A8=E5=A2=9E=E5=8A=A0=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A=E8=AF=84=E5=88=86=E3=80=8B=E4=B8=A4=E9=A1=B9=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=20Signed-off-by:=20alan=20<547533434@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 12 +++- app/helpers/courses_helper.rb | 26 ++++++- app/models/member.rb | 41 +++++++++++ app/models/user.rb | 4 +- app/views/courses/_member_list.html.erb | 53 ++++++++++---- app/views/courses/_show_member_score.html.erb | 58 +++++++++++++++ app/views/courses/show_member_score.js.erb | 3 + app/views/layouts/contest_base.html.erb | 2 +- app/views/layouts/course_base.html.erb | 6 +- .../projects/show_projects_score.html.erb | 71 ------------------- app/views/users/_user_score.html.erb | 2 +- config/locales/zh.yml | 1 + config/routes.rb | 2 + public/stylesheets/course_group.css | 14 ++-- 14 files changed, 192 insertions(+), 103 deletions(-) create mode 100644 app/views/courses/_show_member_score.html.erb create mode 100644 app/views/courses/show_member_score.js.erb delete mode 100644 app/views/projects/show_projects_score.html.erb diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index bf964fbaf..63b8294e7 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -318,7 +318,6 @@ class CoursesController < ApplicationController @canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1' @role = params[:role] @course_groups = @course.course_groups if @course.course_groups - @course_group_id = params[:@course_group_id] unless params[:@course_group_id].nil? @show_serch = params[:role] == '2' case params[:role] when '1' @@ -340,6 +339,15 @@ class CoursesController < ApplicationController render_403 end + end + # 显示每个学生的作业评分详情 + def show_member_score + @member_score = Member.find(params[:member_id]) if params[:member_id] + respond_to do |format| + format.html {render :layout => 'course_base'} + format.js + end + end #判断指定用户是否为课程教师 @@ -840,4 +848,6 @@ class CoursesController < ApplicationController render_404 end end + + end diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index a1199a55a..6f0265132 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -166,11 +166,27 @@ module CoursesHelper def searchStudent project #searchPeopleByRoles(project, StudentRoles) members = [] + project.members.each do |m| - members << m if m && m.user && m.user.allowed_to?(:as_student,project) + if m && m.user && m.user.allowed_to?(:as_student,project) + members << m + + end end members end + def search_student_and_score project + #searchPeopleByRoles(project, StudentRoles) + members = [] + scores = [] + project.members.each do |m| + if m && m.user && m.user.allowed_to?(:as_student,project) + members << m + + end + end + members + end def searchStudent_by_name project, name #searchPeopleByRoles(project, StudentRoles) members = [] @@ -392,7 +408,13 @@ module CoursesHelper return teacher_score_for_homework homework end end - + def score_for_homework_new homework + if teacher_score_for_homework(homework) != 0 + return teacher_score_for_homework homework + else + return student_score_for_homework homework + end + end #获取作业的互评得分 def student_score_for_homework homework #member = searchTeacherAndAssistant(homework.bid.courses.first).first#searchPeopleByRoles(homework.bid.courses.first,TeacherRoles).first diff --git a/app/models/member.rb b/app/models/member.rb index 716f6a7c5..32d0f5c73 100644 --- a/app/models/member.rb +++ b/app/models/member.rb @@ -114,9 +114,50 @@ class Member < ActiveRecord::Base member end + # 查找每个学生每个作业的评分 + def student_homework_score + teachers = find_course_teachers(self.course) + + score_count = 0 + homework_scores = HomeworkAttach.find_by_sql("SELECT homework_attaches.bid_id as bid_id, bids.name as name, + (SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' + AND rateable_id = homework_attaches.id AND rater_id IN (#{teachers}) ) AS t_score, + (SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' + AND rateable_id = homework_attaches.id AND rater_id NOT IN (#{teachers})) AS s_score + FROM homework_attaches, bids where homework_attaches.user_id = #{self.user_id} + and homework_attaches.bid_id IN (SELECT bid_id FROM homework_for_courses where course_id = #{self.course_id} + and homework_attaches.bid_id = bids.id)") + homework_scores.each do |homework| + if !homework.t_score.nil? && homework.t_score != 0 + score = homework.t_score + else + if !homework.s_score.nil? + score= homework.s_score + else + score = 0 + end + end + score_count = score_count + score + end + [homework_scores, format("%0.2f", score_count)] + end protected def validate_role errors.add_on_empty :role if member_roles.empty? && roles.empty? end + + + #获取课程的老师列表 + def find_course_teachers course + searchTeacherAndAssistant(course).map{|teacher| teacher.user_id}.join(",") + end + def searchTeacherAndAssistant project + #searchPeopleByRoles(project, TeacherRoles) + members = [] + project.members.each do |m| + members << m if m && m.user && m.user.allowed_to?(:as_teacher,project) + end + members + end end diff --git a/app/models/user.rb b/app/models/user.rb index 70e4e8187..cae5f1aa2 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -90,7 +90,7 @@ class User < Principal has_many :contesting_projects, :dependent => :destroy belongs_to :softapplication, :foreign_key => 'id', :dependent => :destroy ##ended by xianbo - + #####fq has_many :jours, :class_name => 'JournalsForMessage', :dependent => :destroy has_many :journals_messages, :class_name => 'JournalsForMessage', :foreign_key => "user_id", :dependent => :destroy @@ -105,7 +105,7 @@ class User < Principal #has_many :courses, :through => :students_for_courses, :source => :project has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy has_many :file_commit, :class_name => 'Attachment', :foreign_key => 'author_id', :conditions => "container_type = 'Project' or container_type = 'Version'" -#### +#### # added by bai has_many :join_in_contests, :dependent => :destroy has_many :news, :foreign_key => 'author_id' diff --git a/app/views/courses/_member_list.html.erb b/app/views/courses/_member_list.html.erb index 58a0da0b2..25d32716f 100644 --- a/app/views/courses/_member_list.html.erb +++ b/app/views/courses/_member_list.html.erb @@ -1,4 +1,4 @@ -

+
<% if User.current.logged? && User.current.member_of_course?(@course) && @group %> <% if !@canShowCode %> <%= join_in_course_group(@course.course_groups,@group, User.current) %> @@ -26,31 +26,56 @@ <% if @result_count %>

<%= l(:label_search_member_count) %><%= @result_count %><%= l(:label_member_people) %>

<% end %> - <% members.each do |member| %> -
+
+
+ + <% members.each do |member| %> + +
+
<% next if member.new_record? %> - <% unless member.created_on.nil? %> - <%= content_tag "p", "#{format_date(member.created_on)}#{l(:label_member_since)}", :class => "float_right member_since" %> - <% end %> - <%= member.user.nil? ? '' : (image_tag(url_to_avatar(member.user), :class => 'avatar')) %> + + <%= member.user.nil? ? '' : (image_tag(url_to_avatar(member.user), :width => 40, :height => 40)) %> +
    <% if @canShowCode %> - <%= content_tag "div", link_to(member.user.show_name, user_path(member.user)), :class => "nomargin avatar_name" %> +
  • + <%= l(:label_bidding_user_studentname) %> : + <%= link_to member.user.show_name, user_path(member.user) %> + +

  • + <%#= content_tag "li", "#{l(:label_bidding_user_studentname)}#{' : '}"link_to(member.user.show_name, user_path(member.user)) %> <% else %> - <%= content_tag "div", link_to(member.user.name, user_path(member.user)), :class => "nomargin avatar_name" %> + <%= content_tag "li", link_to(member.user.name, user_path(member.user)) %> <% end %> <% if @canShowCode %> - <%= content_tag "p", "#{l(:label_bidding_user_studentcode)}#{' : '}#{member.user.user_extensions.student_id}", :class => "nomargin avatar_name" %> +
  • + <%= l(:label_bidding_user_studentcode) %> : + <%= link_to member.user.user_extensions.student_id, user_path(member.user) %> +
  • + <%#= content_tag "li", "#{l(:label_bidding_user_studentcode)}#{' : '}#{member.user.user_extensions.student_id}", :style=> "color:#1c9ec7;" %> <% end %> -
      -

    -

    -
    +
+ + <%= link_to member.student_homework_score[1].to_s, { + :action => 'show_member_score', + :member_id => member.id, + :remote => true}, + :class => 'ml258 c_red', :style => "color:red;" %> + + <% unless member.created_on.nil? %> + <%= content_tag "span", "#{format_date(member.created_on)}#{l(:label_member_since)}", :class => "ml65 c_grey" %> + <% end %> + <%= call_hook(:view_projects_settings_members_table_row, { :course => @course, :member => member}) %>
<% end; reset_cycle %> +
<% else %>

diff --git a/app/views/courses/_show_member_score.html.erb b/app/views/courses/_show_member_score.html.erb new file mode 100644 index 000000000..57dd7b2be --- /dev/null +++ b/app/views/courses/_show_member_score.html.erb @@ -0,0 +1,58 @@ + + + +

+

<%= @member_score.user.name %> 历次作业积分

+
    +
  • 作业名称得分
  • + <% @member_score.student_homework_score[0].each do |homework_score| %> + <% if !homework_score.t_score.nil? && homework_score.t_score != 0 %> + <% score = homework_score.t_score %> + <% else %> + <% if !homework_score.s_score.nil? %> + <% score = homework_score.s_score %> + <% else %> + <% score = 0 %> + <% end %> + <% end %> +
  • <%= homework_score.name %><%= format("%0.2f",score) %>
  • + <% end %> +
  • 作业积分(总得分)<%= @member_score.student_homework_score[1] %>
  • +
+ + +
diff --git a/app/views/courses/show_member_score.js.erb b/app/views/courses/show_member_score.js.erb new file mode 100644 index 000000000..fe8d52a2b --- /dev/null +++ b/app/views/courses/show_member_score.js.erb @@ -0,0 +1,3 @@ +$('#ajax-modal').html('<%= escape_javascript(render :partial => 'courses/show_member_score', :locals => {:member => @member_score}) %>'); +showModal('ajax-modal', '400px'); +$('#ajax-modal').addClass('new-watcher'); diff --git a/app/views/layouts/contest_base.html.erb b/app/views/layouts/contest_base.html.erb index ba187be3e..98663f6c4 100644 --- a/app/views/layouts/contest_base.html.erb +++ b/app/views/layouts/contest_base.html.erb @@ -30,7 +30,7 @@
<%= render_flash_messages %> <%= yield %> - <%= call_hook :view_layouts_base_content %> + <%= call_hook :view_layouts_base_course %>
<%=render :partial => 'layouts/base_footer'%>
diff --git a/app/views/layouts/course_base.html.erb b/app/views/layouts/course_base.html.erb index 198252a52..af376b1f5 100644 --- a/app/views/layouts/course_base.html.erb +++ b/app/views/layouts/course_base.html.erb @@ -1,7 +1,5 @@ -<% @nav_dispaly_course_all_label = 1 - @nav_dispaly_forum_label = 1 - @nav_dispaly_course_label = nil - @nav_dispaly_store_all_label = 1 %> +<% @nav_dispaly_project_label = 1 + @nav_dispaly_forum_label = 1 %> diff --git a/app/views/projects/show_projects_score.html.erb b/app/views/projects/show_projects_score.html.erb deleted file mode 100644 index 836e0a05c..000000000 --- a/app/views/projects/show_projects_score.html.erb +++ /dev/null @@ -1,71 +0,0 @@ - - - - <%= 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 %> - <%= heads_for_theme %> - <%= hubspot_head %> - <%= call_hook :view_layouts_base_html_head %> - - <%= yield :header_tags -%> - -<% if @project %> -

<%= l(:label_projects_score) %>

-
- - - - - - -
<%= image_tag(url_to_avatar(@project), :class => 'avatar2') %> - - - -
<%= @project.name %>
-
- - - -
<%= l(:label_projects_score) %>
<%= format("%.2f" , project_scores(@project) ).to_i %>
-
-
- -
-
    -
  • - <%= link_to l(:label_projects_score), {:controller => 'projects', :action => 'show_projects_score', :remote => true}%> : - <%= format("%.2f" , project_scores(@project) ).to_i %> -
  • -
  • - <%= link_to l(:label_issue_score), {:controller => 'projects', :action => 'issue_score_index', :remote => true}%> : - <%= format("%.2f" , issue_score(@project)).to_i %> -
  • -
  • - <%= link_to l(:label_news_score), {:controller => 'projects', :action => 'news_score_index', :remote => true}%> : - <%= format("%.2f" , news_score(@project)).to_i %> -
  • -
  • - <%= link_to l(:label_file_score), {:controller => 'projects', :action => 'file_score_index', :remote => true}%> : - <%= format("%.2f" , documents_score(@project)).to_i %> -
  • -
  • - <%= link_to l(:label_code_submit_score), {:controller => 'projects', :action => 'code_submit_score_index', :remote => true}%> : - <%= format("%.2f" , changesets_score(@project)).to_i %> -
  • -
  • - <%= link_to l(:label_topic_score), {:controller => 'projects', :action => 'projects_topic_score_index', :remote => true}%> : - <%= format("%.2f" , board_message_score(@project)).to_i %> -
  • -
-
-
- <%= render :partial => 'projects/project_score_index', :locals => {:index => 0,:project => @project } %> -
-<% end %> \ No newline at end of file diff --git a/app/views/users/_user_score.html.erb b/app/views/users/_user_score.html.erb index e9334a047..71f8f60a5 100644 --- a/app/views/users/_user_score.html.erb +++ b/app/views/users/_user_score.html.erb @@ -5,4 +5,4 @@ :action => 'show_new_score', :remote => true, :id => user.id -}, :style => 'color :#E8770D;',:id => 'user_score') %> \ No newline at end of file + }, :style => 'color :#E8770D;',:id => 'user_score') %> \ No newline at end of file diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 236af39c1..8f23d3025 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -1572,6 +1572,7 @@ zh: label_bidding_user: 应标人: label_bidding_user_homework: 作业提交者 label_bidding_user_studentcode: 学号 + label_bidding_user_studentname: 姓名 label_bidding_reason: 应标宣言: label_bidding_reason_homewrok: 作业提交说明 label_username: 用户名: diff --git a/config/routes.rb b/config/routes.rb index 45f3071b3..f4fff69d4 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -641,6 +641,7 @@ RedmineApp::Application.routes.draw do get 'file', :action => 'file', :as => 'file' get 'feedback', :action => 'feedback', :as => 'course_feedback' get 'member', :controller => 'courses', :action => 'member', :as => 'member' + get 'member_score', :to => 'courses#member_score' post 'finishcourse' post 'restartcourse' match "searchmembers", :controller => 'courses', :action => 'searchmembers', :via => [:post,:get] @@ -648,6 +649,7 @@ RedmineApp::Application.routes.draw do match "updategroupname", :via => [:post, :get] match "addgroups", :via => [:post, :get] match 'deletegroup', :via => [:delete] + match 'show_member_score', :via => [:get] post 'join_in/join_group', :to => 'courses#join_group', :as => 'join_group' delete 'join_in/join_group', :to => 'courses#unjoin_group' end diff --git a/public/stylesheets/course_group.css b/public/stylesheets/course_group.css index edfcb9091..92cc5f08d 100644 --- a/public/stylesheets/course_group.css +++ b/public/stylesheets/course_group.css @@ -60,15 +60,15 @@ input.f_2 { .st_down{ display: block; width:8px; float:left; height:13px; background:url(../images/pic_up.png) 0 -22px no-repeat; margin-top:5px; margin-left:3px;} a.st_img { display:block;width:40px; height:40px; border:1px solid #CCC; padding:1px;} a:hover.st_img { border:1px solid #1c9ec7; } -.st_boxlist{ border-bottom:1px dashed #CCC; height:53px; padding-top:10px; } -.st_boxlist a{ float:left;} +.st_boxlist{ border-bottom:1px dashed #CCC; height:53px; padding-top:10px;padding-bottom: 10px; } +.st_boxlist a{ } .st_boxlist ul{ float:left; width:200px; margin-left:10px;} -.st_boxlist ul li a{ color:#5d5d5d;} -.st_boxlist ul li a span{ color:#1c9ec7;} -.st_boxlist ul li a:hover span{ color:#ff8e15;} + +.st_boxlist ul li a { color:#1c9ec7;} +.st_boxlist ul li a:hover{ color:#ff8e15;} .ml50{ margin-left:50px;} -.ml358{ margin-left:358px;} -.ml258{ margin-left:254px;} +.ml358{ margin-left:360px;} +.ml258{ margin-left:110px;} .ml65{ margin-left:65px;} a:hover.st_add{ color:#ff8e15;} From 42205734253a1668555db067ce9e7dd1a5cebcf3 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Wed, 17 Dec 2014 21:12:25 +0800 Subject: [PATCH 06/14] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E3=80=8A=E5=85=B3?= =?UTF-8?q?=E4=BA=8E=E6=B7=BB=E5=8A=A0=E5=88=86=E7=8F=AD=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=9A=E8=80=81=E5=B8=88=E6=B7=BB=E5=8A=A0=E5=88=86?= =?UTF-8?q?=E7=8F=AD=E6=88=90=E5=8A=9F=E5=90=8E=EF=BC=8C=E5=86=8D=E6=AC=A1?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=86=E7=8F=AD=E6=97=B6=E8=BE=93=E5=85=A5?= =?UTF-8?q?=E6=A1=86=E4=B8=AD=E8=AE=B0=E5=BD=95=E7=9A=84=E6=98=AF=E4=B8=8A?= =?UTF-8?q?=E6=AC=A1=E5=88=86=E7=8F=AD=E5=90=8D=E7=A7=B0=E3=80=8Bbug=20Sig?= =?UTF-8?q?ned-off-by:=20alan=20<547533434@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/_groups_name.html.erb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/courses/_groups_name.html.erb b/app/views/courses/_groups_name.html.erb index ca0fed9c2..e1b138666 100644 --- a/app/views/courses/_groups_name.html.erb +++ b/app/views/courses/_groups_name.html.erb @@ -20,7 +20,7 @@ %> <% end %> <% if @canShowCode %> - 编辑班级 + 编辑班级 <% end %>
  • @@ -36,7 +36,7 @@ <% end %> <% if @canShowCode %>
  • - +添加分班 + +添加分班
  • From 813f2d10266ad907b885c997a8b3282449393e38 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 18 Dec 2014 09:33:26 +0800 Subject: [PATCH 07/14] =?UTF-8?q?1.=E4=BF=AE=E5=A4=8D=E6=9F=90=E4=BA=9B?= =?UTF-8?q?=E6=83=85=E5=86=B5=E4=B8=8B=EF=BC=8C=E7=BC=BA=E9=99=B7=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E7=82=B9=E8=B5=9E=E5=9B=BE=E6=A0=87=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E9=94=99=E4=BD=8D=202.=E4=BF=AE=E5=A4=8D=E5=BD=93=E6=8F=8F?= =?UTF-8?q?=E8=BF=B0=E9=9D=9E=E5=B8=B8=E7=9F=AD=EF=BC=8C=E6=88=96=E8=80=85?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E6=8F=8F=E8=BF=B0=E6=97=B6=EF=BC=8C=E7=BC=BA?= =?UTF-8?q?=E9=99=B7=E5=88=97=E8=A1=A8=E4=B8=AD=E7=BC=BA=E9=99=B7=E7=9A=84?= =?UTF-8?q?=E6=8C=87=E6=B4=BE=E4=BA=BA=E3=80=81=E6=9F=A5=E7=9C=8B=E8=AF=84?= =?UTF-8?q?=E8=AE=BA=E6=8C=89=E9=92=AE=E6=98=BE=E7=A4=BA=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/issues/_list.html.erb | 116 ++++++++++++++++---------------- 1 file changed, 59 insertions(+), 57 deletions(-) diff --git a/app/views/issues/_list.html.erb b/app/views/issues/_list.html.erb index 39fd3776f..58960df4c 100644 --- a/app/views/issues/_list.html.erb +++ b/app/views/issues/_list.html.erb @@ -1,67 +1,69 @@
    -
      - <% issue_list(issues) do |issue, level| -%> - <% if @query.grouped? && (group = @query.group_by_column.value(issue)) != previous_group %> +
        + <% issue_list(issues) do |issue, level| -%> + <% if @query.grouped? && (group = @query.group_by_column.value(issue)) != previous_group %> <% reset_cycle %> <% previous_group = group %> - <% end %> -
        -
      • "> - <% column_content = ( query.inline_columns.map {|column| "#{column_content_new(column, issue)}"}) %> + <% end %> +
        +
      • "> + <% column_content = ( query.inline_columns.map {|column| "#{column_content_new(column, issue)}"}) %> + <% if issue.tracker_id == 1 %> + <%= image_tag("/images/task.png", :class => "img-tag-issues") %> + <% end %> + <% if issue.tracker_id == 2 %> + <%= image_tag("/images/feature.png", :class => "img-tag-issues") %> + <% end %> + <% if issue.tracker_id == 3 %> + <%= image_tag("/images/support.png", :class => "img-tag-issues") %> + <% end %> + <% if issue.tracker_id == 4 %> + <%= image_tag("/images/issues.png", :class => "img-tag-issues") %> + <% end %> - - - <%= render :partial => "/praise_tread/praise_tread",:locals => - {:obj => issue,:show_flag => true,:user_id =>User.current.id,:horizontal => false}%> - +
          + <% unless issue.author.nil? || issue.author.name == "Anonymous" %> +
            + + + <%= render :partial => "/praise_tread/praise_tread",:locals => + {:obj => issue,:show_flag => true,:user_id =>User.current.id,:horizontal => false}%> + + + <%= link_to issue.author.name, user_path(issue.author), :class => "bid_user_u" %> + + <%= l(:label_post_on)%> + <% a = [] %> + <% a << column_content[1] %> + <%# a << "##{column_content[0]}" << "(#{raw column_content[2]}):" << column_content[4] %> + <% a << "#{issue.source_from}" << "(#{raw column_content[2]}):" << column_content[4] %> + <%= link_to a.join(' '), issue_path(issue.id), :class => "issue-link" , :target =>"_blank"%> - <% if issue.tracker_id == 1 %> - <%= image_tag("/images/task.png", :class => "img-tag-issues") %> - <% end %> - <% if issue.tracker_id == 2 %> - <%= image_tag("/images/feature.png", :class => "img-tag-issues") %> - <% end %> - <% if issue.tracker_id == 3 %> - <%= image_tag("/images/support.png", :class => "img-tag-issues") %> - <% end %> - <% if issue.tracker_id == 4 %> - <%= image_tag("/images/issues.png", :class => "img-tag-issues") %> - <% end %> - -
              - <% unless issue.author.nil? || issue.author.name == "Anonymous" %> -
                - <%= link_to issue.author.name, user_path(issue.author), :class => "bid_user_u" %> - <%= l(:label_post_on)%> <% a = [] %> - <% a << column_content[1] %> - <%# a << "##{column_content[0]}" << "(#{raw column_content[2]}):" << column_content[4] %> - <% a << "#{issue.source_from}" << "(#{raw column_content[2]}):" << column_content[4] %> - <%= link_to a.join(' '), issue_path(issue.id), :class => "issue-link" , :target =>"_blank"%> -
              - <% end -%> -
                -
                - <%= textilizable issue, :description %> -
                -
              -
                - <% unless issue.assigned_to_id.nil? %> - - <%= l(:field_assigned_to)%>  - +
                  +
                  + <%= textilizable issue, :description %> +
                  +
                +
              +
                + <% unless issue.assigned_to_id.nil? %> + + <%= l(:field_assigned_to)%>  + <%= raw column_content[5] %>  - <% end %> - <%= l(:label_updated_time_on, format_date(issue.updated_on)).html_safe %> -
                + <% end %> + <%= l(:label_updated_time_on, format_date(issue.updated_on)).html_safe %> +
                <%= link_to l(:label_find_all_comments), issue_path(issue.id) %> - <%= l(:label_comments_count, :count => issue.journals.all.count) %> -
                -
              -
            - -
      • - <% end -%> -
      + <%= l(:label_comments_count, :count => issue.journals.all.count) %> +
    + + <% end -%> + +
  • +
    + <% end -%> +
    \ No newline at end of file From 6b2fb87b2c5af506444f2c035165ad0e6c0630c7 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Thu, 18 Dec 2014 09:57:19 +0800 Subject: [PATCH 08/14] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E3=80=8A=E6=95=99?= =?UTF-8?q?=E5=B8=88=E5=88=97=E8=A1=A8=E5=87=BA=E7=8E=B0=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E7=A7=AF=E5=88=86=E3=80=8Bbug=20Signed-off-by:=20alan=20<54753?= =?UTF-8?q?3434@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/_member_list.html.erb | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/app/views/courses/_member_list.html.erb b/app/views/courses/_member_list.html.erb index 25d32716f..2800c78ea 100644 --- a/app/views/courses/_member_list.html.erb +++ b/app/views/courses/_member_list.html.erb @@ -29,8 +29,13 @@
    <% members.each do |member| %> @@ -52,7 +57,7 @@ <% end %> - <% if @canShowCode %> + <% if @canShowCode %>
  • <%= l(:label_bidding_user_studentcode) %> : <%= link_to member.user.user_extensions.student_id, user_path(member.user) %> @@ -60,16 +65,21 @@ <%#= content_tag "li", "#{l(:label_bidding_user_studentcode)}#{' : '}#{member.user.user_extensions.student_id}", :style=> "color:#1c9ec7;" %> <% end %> - + <% if @subPage_title == l(:label_student_list) %> <%= link_to member.student_homework_score[1].to_s, { :action => 'show_member_score', :member_id => member.id, :remote => true}, :class => 'ml258 c_red', :style => "color:red;" %> + <% unless member.created_on.nil? %> + <%= content_tag "span", "#{format_date(member.created_on)}#{l(:label_member_since)}", :class => "ml65 c_grey" %> + <% end %> + <% else %> <% unless member.created_on.nil? %> - <%= content_tag "span", "#{format_date(member.created_on)}#{l(:label_member_since)}", :class => "ml65 c_grey" %> - <% end %> + <%= content_tag "span", "#{format_date(member.created_on)}#{l(:label_member_since)}", :class => "ml65 c_grey", :style=>"margin-left:195px" %> + <% end %> + <% end %> <%= call_hook(:view_projects_settings_members_table_row, { :course => @course, :member => member}) %> From 5ad2d22f98d893ed22a30fa07a3ef287d30b4c3e Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 18 Dec 2014 09:58:16 +0800 Subject: [PATCH 09/14] =?UTF-8?q?#1724=20=E4=BF=AE=E5=A4=8D=E9=83=A8?= =?UTF-8?q?=E5=88=86=E7=94=A8=E6=88=B7=E5=9C=A8=E8=AF=BE=E7=A8=8B=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E4=B8=AD=E6=9C=892=E4=B8=AA=E9=80=80=E5=87=BA?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E7=9A=84=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_course_form.html.erb | 47 +++++++++++++++-------- app/views/users/_my_joinedcourse.html.erb | 16 ++++---- app/views/users/user_courses.html.erb | 1 - 3 files changed, 38 insertions(+), 26 deletions(-) diff --git a/app/views/users/_course_form.html.erb b/app/views/users/_course_form.html.erb index 6784faf89..02ba782ec 100644 --- a/app/views/users/_course_form.html.erb +++ b/app/views/users/_course_form.html.erb @@ -4,31 +4,40 @@
  • - +
    <%= image_tag(url_to_avatar(membership.course), :class => 'avatar') %> + <%= image_tag(url_to_avatar(membership.course), :class => 'avatar') %> + + ( + + <%= link_to (membership.course.news.count), {:controller => 'news', :action => 'index', :course_id => membership.course.id} %> + ) + + diff --git a/app/views/users/_my_joinedcourse.html.erb b/app/views/users/_my_joinedcourse.html.erb index 74be37b55..8314974d3 100644 --- a/app/views/users/_my_joinedcourse.html.erb +++ b/app/views/users/_my_joinedcourse.html.erb @@ -1,15 +1,15 @@
    <% if @memberships.empty? %> <% if @user != User.current %> -

    - <%= l(:label_project_course_un) %> -

    +

    + <%= l(:label_project_course_un) %> +

    <% else %> -

    - - <%= l(:label_project_cousre_studentun) %><%= link_to"#{l(:label_course_join_student)}",{:controller=>'courses',:action=>'index'}, :class => 'icon icon-add' %> - <%= link_to "#{l(:label_course_new)}", {:controller => 'courses', :action => 'new'}, :class => 'icon icon-add' %> -

    +

    + <%= l(:label_project_cousre_studentun) %> + <%= link_to"#{l(:label_course_join_student)}",{:controller=>'courses',:action=>'index'}, :class => 'icon icon-add' %> + <%= link_to "#{l(:label_course_new)}", {:controller => 'courses', :action => 'new'}, :class => 'icon icon-add' %> +

    <% end %> <% else %>
    From 3dfb0358c154b24f100eaf8059409e04451ce4f8 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 18 Dec 2014 14:53:21 +0800 Subject: [PATCH 11/14] =?UTF-8?q?#1718=20=E4=BF=AE=E5=A4=8D=E4=BD=9C?= =?UTF-8?q?=E5=93=81=E4=B8=8B=E8=BD=BD=E6=B7=BB=E5=8A=A0=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E6=A1=86=E4=B8=8D=E8=83=BD=E6=AD=A3=E5=B8=B8=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/files/_project_file.html.erb | 34 +++--- app/views/tags/_tag.html.erb | 6 +- app/views/tags/_tag_name.html.erb | 147 ++++++++++++------------- 3 files changed, 91 insertions(+), 96 deletions(-) diff --git a/app/views/files/_project_file.html.erb b/app/views/files/_project_file.html.erb index f52b7d353..e2f928332 100644 --- a/app/views/files/_project_file.html.erb +++ b/app/views/files/_project_file.html.erb @@ -2,22 +2,21 @@ <% attachmenttypes = @project.attachmenttypes %> <% sufixtypes = @project.contenttypes %> -<%= (@project.project_type == 1) ? t(:label_user_course) : t(:label_project) %>资源共享区 + + <%= (@project.project_type == 1) ? t(:label_user_course) : t(:label_project) %> + 资源共享区 +
    - <%#= link_to(l(:label_attachment_new), 'javascript:void(0);', :onclick=>"$('#file_buttons').slideToggle();", :class => 'icon icon-add') if User.current.allowed_to?(:manage_files, @project) %>
    <%= link_to(l(:label_upload_files), 'javascript:void(0);', :class => 'icon m5p5 button_submit', :onclick => "$('#relation_file_div').slideUp();$('#upload_file_div').slideToggle('slow');") if User.current.allowed_to?(:manage_files, @project) %> <%= link_to(l(:label_relation_files), 'javascript:void(0);', :onclick => "$('#upload_file_div').slideUp();$('#relation_file_div').slideToggle();", :class => 'icon m5p5 button_submit') if User.current.allowed_to?(:manage_files, @project) %>

    - - -
    - + <% if attachmenttypes.any? %>       - - <%= select_tag "attachment_browse", content_tag(:option, l(:attachment_all), :value => '0') +options_from_collection_for_select(attachmenttypes, "id", "typeName",params[:type]), + + <%= select_tag "attachment_browse", content_tag(:option, l(:attachment_all), :value => '0') +options_from_collection_for_select(attachmenttypes, "id", "typeName",params[:type]), :onchange => "attachmenttypes_searchex(this.value)" %> <% end %> <% if sufixtypes.any? %>   - + <%= select_tag "attach_sufix_browse", content_tag(:option, l(:attachment_all), :value => '0') +options_for_select(sufixtypes), :onchange => "attachment_contenttypes_searchex(this.value)" %> <% end %> @@ -65,20 +71,14 @@
    <%= javascript_tag "observeSearchfield('attach_search', null, '#{ escape_javascript attachments_autocomplete_path(:project_id => @project.id, :format => 'js') }')" %> - <% delete_allowed = User.current.allowed_to?(:manage_files, @project) %>
    <%#= render :partial => 'show_all_attachment' %> <% if (@attachtype==0 && @contenttype=='0') || (@attachtype.nil? && @contenttype.nil?) %> - - <%= render partial: "show_all_attachment"%> - - + <%= render partial: "show_all_attachment"%> <%else%> - - <%= render partial: "sort_by_attachtypel"%> - + <%= render partial: "sort_by_attachtypel"%> <%end%>
    diff --git a/app/views/tags/_tag.html.erb b/app/views/tags/_tag.html.erb index 06680d373..c08a3b553 100644 --- a/app/views/tags/_tag.html.erb +++ b/app/views/tags/_tag.html.erb @@ -1,6 +1,6 @@
    <%#begin - 1 代表是user类型 + 1 代表是user类型 2 代表是project类型 3 代表是issue类型 4 代表是bid类型 @@ -44,14 +44,14 @@ <%= link_to (image_tag "/images/sidebar/add.png"), 'javascript:void(0);', :class => "tags_icona", - :onclick=>"$('#put-tag-form-#{obj.class}-#{obj.id}').slideToggle(); readmore(this);" if User.current.logged? %> + :onclick=>"$('#put-tag-form-#{obj.class}-#{obj.id}').toggle(); readmore(this);" if User.current.logged? %> <%#= toggle_link (image_tag "/images/sidebar/add.png"), "put-tag-form-#{obj.class}-#{obj.id}", {:focus => "put-tag-form-#{obj.class}-#{obj.id} #name"} if User.current.logged? %>   
    <%= render :partial => "tags/tag_name",:locals => {:obj => obj,:non_list_all => false ,:object_flag => object_flag} %>
    -
    - <%= link_to_course(membership.course) %> + + <%= link_to_course(membership.course) %> + <%= render :partial => 'courses/set_course_time', :locals => {:course => membership.course} %> - <% if User.current == @user %> - <% (membership.roles).each do |role| %> - <% unless (role == Role.find(9) || role == Role.find(3)) %> - <%= join_in_course(membership.course, User.current) %> - <% end %> - <% end %> - <% else %> + <% if (User.current == @user && (!@user.allowed_to?(:as_teacher,membership.course)))%> + <%= join_in_course(membership.course, User.current) %> <% end %> +      <%= l(:label_x_base_courses_member, :count => membership.course.members.count) %> - (<%= "#{membership.course.members.count}" %>)   + (<%= "#{membership.course.members.count}" %>) +    <%= l(:label_homework) %> - (<%= link_to (membership.course.homeworks.count), {:controller => 'courses', :action => 'homework', :id => membership.course.id} %>) + ( + + <%= link_to (membership.course.homeworks.count), {:controller => 'courses', :action => 'homework', :id => membership.course.id} %> + + )    <%= l(:label_course_news) %> - (<%= link_to (membership.course.news.count), {:controller => 'news', :action => 'index', :course_id => membership.course.id} %>) -
    @@ -42,10 +51,14 @@ <% @course = Course.find_by_extra(membership.course.extra) %> <% unless (@course.nil? || @course.teacher.nil? || @course.teacher.name.nil?) %> - <%= l(:label_main_teacher) %> - : <%= link_to(@course.teacher.realname, user_path(@course.teacher)) %> - <%= l(:label_course_term) %> - : <%= @course.time %><%= @course.term %> + + <%= l(:label_main_teacher) %> + : <%= link_to(@course.teacher.realname, user_path(@course.teacher)) %> + + + <%= l(:label_course_term) %> + : <%= @course.time %><%= @course.term %> + <% end %>
    -
    @@ -20,19 +20,41 @@
    - - <%= link_to request.host()+"/contests", contests_path %> - - - <%=link_to l(:field_homepage), home_path %> > <%= l(:label_contest_innovate) %> @@ -43,14 +65,14 @@ <% end %> <% if @contests.size > 0%> - <%= sort_contest(@s_state)%> + <%#= sort_contest(@s_state)%>
    <%= render :partial => 'contest_list', :locals => {:contests => @contests, :contest_pages => @contest_pages} %>
    <% elsif @is_search%> <%= render :partial => "layouts/no_content"%> <% else %> - <%= sort_contest(@s_state)%> + <%#= sort_contest(@s_state)%>
    <%= render :partial => 'contest_list', :locals => {:contests => @contests, :contest_pages => @contest_pages} %>
    From 0f9a82637ec5ecbb8c60cee60f50679c35008f4d Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 18 Dec 2014 15:58:33 +0800 Subject: [PATCH 13/14] =?UTF-8?q?#1716=20=E8=AF=BE=E7=A8=8B=E8=AE=A8?= =?UTF-8?q?=E8=AE=BA=E5=8C=BA-=E5=8F=91=E5=B8=83=E6=96=B0=E8=B4=B4?= =?UTF-8?q?=E7=82=B92=E6=AC=A1=E6=89=8D=E8=83=BD=E6=88=90=E5=8A=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/boards/_course_show.html.erb | 5 +---- app/views/messages/new.html.erb | 12 ++++++++++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/app/views/boards/_course_show.html.erb b/app/views/boards/_course_show.html.erb index 7a7d001ed..eac85e2d7 100644 --- a/app/views/boards/_course_show.html.erb +++ b/app/views/boards/_course_show.html.erb @@ -1,10 +1,7 @@