短描述修改

This commit is contained in:
nwb 2014-07-18 16:41:55 +08:00
parent 5087f90a26
commit 0e9a15aad5
5 changed files with 18 additions and 17 deletions

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -108,12 +108,18 @@
<br/>
<tr style="width:800px;">
<span><%= l(:label_work_description) %></span>
<span class="contest-star"> * </span>:
<td style="width: 100px"><%= f.text_field :description, :required => true, :size => 60, :style => "width:400px;" %></td>
<span style="font-size: 10px">(<%= l(:label_workdescription_lengthlimit) %>)</span>
</tr>
<tr style="width:800px;">
<span style="margin-top: 1px"><%= l(:label_work_description) %></span>
<span class="contest-star"> * </span>:
<span class="jstEditor">
<textarea id="contest_description" style="font-size:small;width:400px;" rows="5" cols="40">
<%= @contest.description %>
</textarea>
</span>
</tr>
<br/>
<br/>
<br/>