From 62497913d70e79ca3f7c641c814a32631e513e34 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Fri, 5 Dec 2014 17:13:05 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E3=80=8A=E5=88=86?= =?UTF-8?q?=E7=BB=84=E5=90=8D=E5=8F=AF=E4=BB=A5=E4=B8=BA=E7=A9=BA=E6=A0=BC?= =?UTF-8?q?=E3=80=8Bbug=20Signed-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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/courses/_groups_name.html.erb b/app/views/courses/_groups_name.html.erb index 9a57d1127..7aa47b772 100644 --- a/app/views/courses/_groups_name.html.erb +++ b/app/views/courses/_groups_name.html.erb @@ -6,8 +6,8 @@ } } function validate_groupname_null(value1) { - - if(value1.length == 0) { + value1 = value1.trim(); + if(value1.length == 0 ) { alert('<%= l(:label_limit_groupname_null) %>'); } } From fbe6ce16d70857a3dbba24aaebc4a8443a49c03d Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Fri, 5 Dec 2014 23:34:16 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E3=80=8A=E5=88=86?= =?UTF-8?q?=E7=BB=84=E7=95=8C=E9=9D=A2=E3=80=8B=E6=A0=B7=E5=BC=8F=20Signed?= =?UTF-8?q?-off-by:=20alan=20<547533434@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/watchers_helper.rb | 6 +++--- app/models/principal.rb | 4 ++-- app/views/courses/_groups_name.html.erb | 26 +++++++------------------ app/views/courses/_member_list.html.erb | 13 +++++++++---- app/views/courses/member.html.erb | 12 +++--------- config/locales/zh.yml | 3 +++ public/stylesheets/course_group.css | 15 +++++++------- 7 files changed, 35 insertions(+), 44 deletions(-) diff --git a/app/helpers/watchers_helper.rb b/app/helpers/watchers_helper.rb index 8acd0b577..935fb440e 100644 --- a/app/helpers/watchers_helper.rb +++ b/app/helpers/watchers_helper.rb @@ -123,17 +123,17 @@ module WatchersHelper url_f = join_group_path(:object_id => group.id) if @isjoin == true joined = user.member_of_course_group?(group) - text = l(:label_exit_course) + text = l(:label_exit_group) if joined link_to text, {:controller => "courses", :action => "join_group", :object_id => "#{group.id}"}, :remote => true, :method => 'delete', - :id => "#{group.id}", :style => "padding: 8px 8px 4px;", + :id => "#{group.id}", :style => "padding: 8px 8px 4px; ", :confirm => l(:text_are_you_sure_out_group), :class => 'group_in' end else - text = l(:label_new_join) + text = l(:label_new_join_group) form_tag({:controller => "courses", :action => "join_group", :object_id => "#{group.id}"}, :remote => true, :method => 'post') do submit_tag text, class: "group_in", style: "width: 43px;height: 21px;" end diff --git a/app/models/principal.rb b/app/models/principal.rb index 2eaba6796..5aa21768f 100644 --- a/app/models/principal.rb +++ b/app/models/principal.rb @@ -26,11 +26,11 @@ class Principal < ActiveRecord::Base has_many :members, :foreign_key => 'user_id', :dependent => :destroy has_many :memberships, :class_name => 'Member', :foreign_key => 'user_id', :include => [ :project, :roles ], :conditions => "#{Project.table_name}.status<>#{Project::STATUS_ARCHIVED}", :order => "#{Project.table_name}.name" - has_many :coursememberships, :class_name => 'Member', :foreign_key => 'user_id', :include => [ :course, :roles ], :order => "#{Course.table_name}.name" + has_many :coursememberships, :class_name => 'Member', :foreign_key => 'user_id', :include => [ :course, :roles ], :conditions => "#{Course.table_name}.status<>#{Course::STATUS_ARCHIVED}", :order => "#{Course.table_name}.name" has_many :projects, :through => :memberships #add by nwb has_many :courses, :through => :coursememberships - has_many :course_groups, :through => :coursememberships + has_many :course_groups, :through => :members has_many :issue_categories, :foreign_key => 'assigned_to_id', :dependent => :nullify # Groups and active users diff --git a/app/views/courses/_groups_name.html.erb b/app/views/courses/_groups_name.html.erb index 7aa47b772..7bff77a79 100644 --- a/app/views/courses/_groups_name.html.erb +++ b/app/views/courses/_groups_name.html.erb @@ -26,31 +26,19 @@