From 0e9a15aad599323211afcfe132a11068217c8984 Mon Sep 17 00:00:00 2001 From: nwb Date: Fri, 18 Jul 2014 16:41:55 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9F=AD=E6=8F=8F=E8=BF=B0=E4=BF=AE=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) %> + * : + + + + + + +