From 3b9245d143e507edb070d8064dcda533f4652724 Mon Sep 17 00:00:00 2001 From: nwb Date: Fri, 18 Jul 2014 15:33:47 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E9=9A=90=E8=97=8F=E6=96=B0=E5=BB=BA?= =?UTF-8?q?=E7=AB=9E=E8=B5=9B=E4=BD=9C=E5=93=81=E6=97=B6=E7=9A=84=E4=BD=9C?= =?UTF-8?q?=E5=93=81=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/contests/show_attendingcontest.html.erb | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/app/views/contests/show_attendingcontest.html.erb b/app/views/contests/show_attendingcontest.html.erb index 7818f5fb3..752f54163 100644 --- a/app/views/contests/show_attendingcontest.html.erb +++ b/app/views/contests/show_attendingcontest.html.erb @@ -105,18 +105,7 @@
-
-
- - <%= l(:label_work_type) %> - - * : - <%= f.text_field :app_type_name, :required => true, :size => 60, :style => "width:400px;" %> - - -
-

From 3f6a298eb4d34b8c11178c4cc7c9fe467abc8337 Mon Sep 17 00:00:00 2001 From: yanxd Date: Fri, 18 Jul 2014 15:57:18 +0800 Subject: [PATCH 2/4] test.course.model --- test/unit/course_test.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/unit/course_test.rb b/test/unit/course_test.rb index a29501066..86963eb4b 100644 --- a/test/unit/course_test.rb +++ b/test/unit/course_test.rb @@ -7,8 +7,8 @@ class CourseTest < ActiveSupport::TestCase end test 'name valid with CJK coding' do - course = Course.find_by_id(74) name_quirk = '电路与电子学基础(软件工程专业)' + course = Course.find_by_id(74) course.name = "test_course" assert course.valid? course.name = name_quirk @@ -17,9 +17,9 @@ class CourseTest < ActiveSupport::TestCase test 'description too long must be valid.' do course = Course.find_by_id(8) - course.description = course.description * 100 + course.description = 'a' * 2048 # description length validate. course.valid? - assert_equal course.errors.full_messages.count, 0 + assert course.errors[:name].empty? assert course.valid? end From 0e9a15aad599323211afcfe132a11068217c8984 Mon Sep 17 00:00:00 2001 From: nwb Date: Fri, 18 Jul 2014 16:41:55 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E7=9F=AD=E6=8F=8F=E8=BF=B0=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/issue.rb | 4 +--- app/models/news.rb | 5 ++--- app/models/open_source_project.rb | 4 ++-- app/models/project.rb | 4 +--- .../contests/show_attendingcontest.html.erb | 18 ++++++++++++------ 5 files changed, 18 insertions(+), 17 deletions(-) diff --git a/app/models/issue.rb b/app/models/issue.rb index 4c5e77cb5..f47e1c6f9 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -564,10 +564,8 @@ class Issue < ActiveRecord::Base end # 缺陷的短描述信息 def short_description(length = 255) - # 不再使用短描述 - #description.gsub(/<\/?.*?>/,"").html_safe if description + description.gsub(/<\/?.*?>/,"").html_safe if description #description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description - description end private :workflow_rule_by_attribute diff --git a/app/models/news.rb b/app/models/news.rb index 860dd0baa..4f8601796 100644 --- a/app/models/news.rb +++ b/app/models/news.rb @@ -76,10 +76,9 @@ class News < ActiveRecord::Base # 新闻的短描述信息 def short_description(length = 255) - #description.gsub(/<\/?.*?>/,"").html_safe if description + description.gsub(/<\/?.*?>/,"").html_safe if description #description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description - # 不再使用短描述 - description + #description end private diff --git a/app/models/open_source_project.rb b/app/models/open_source_project.rb index 4a657edb4..0adc0957f 100644 --- a/app/models/open_source_project.rb +++ b/app/models/open_source_project.rb @@ -84,10 +84,10 @@ class OpenSourceProject < ActiveRecord::Base # end def short_description(length = 255) - #description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description + description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description #description.gsub(/<\/?.*?>/,"").html_safe if description # 不再使用短描述 - description + # description end def applied_by?(user) diff --git a/app/models/project.rb b/app/models/project.rb index 6c453baa9..5bcd2e8c5 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -630,9 +630,7 @@ class Project < ActiveRecord::Base # Returns a short description of the projects (first lines) def short_description(length = 255) #description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description - # 不再使用短描述 - # description.gsub(/<\/?.*?>/,"").html_safe if description - description + description.gsub(/<\/?.*?>/,"").html_safe if description end def css_classes diff --git a/app/views/contests/show_attendingcontest.html.erb b/app/views/contests/show_attendingcontest.html.erb index 752f54163..ba27f09b5 100644 --- a/app/views/contests/show_attendingcontest.html.erb +++ b/app/views/contests/show_attendingcontest.html.erb @@ -108,12 +108,18 @@
- - <%= l(:label_work_description) %> - * : - <%= f.text_field :description, :required => true, :size => 60, :style => "width:400px;" %> - (<%= l(:label_workdescription_lengthlimit) %>) - + + <%= l(:label_work_description) %> + * : + + + + + + +


From 0e0da391135af3fbaeb4b6d1a58fa7a2b96c5c71 Mon Sep 17 00:00:00 2001 From: nwb Date: Fri, 18 Jul 2014 16:44:40 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../contests/show_attendingcontest.html.erb | 124 +++++++++--------- 1 file changed, 59 insertions(+), 65 deletions(-) diff --git a/app/views/contests/show_attendingcontest.html.erb b/app/views/contests/show_attendingcontest.html.erb index ba27f09b5..ab619e8ae 100644 --- a/app/views/contests/show_attendingcontest.html.erb +++ b/app/views/contests/show_attendingcontest.html.erb @@ -87,78 +87,72 @@
@@ -293,9 +287,9 @@ <%= l(:label_attendingcontest_spoksman) %> <% unless c_softapplication.nil? || c_softapplication.softapplication.nil? || c_softapplication.softapplication.user.nil? %> - :<%= link_to c_softapplication.softapplication.user.name,user_path(c_softapplication.softapplication.user) %> + :<%= link_to c_softapplication.softapplication.user.name,user_path(c_softapplication.softapplication.user) %> <% end %> -
+