修复个人主页中作业、项目介绍不正确的BUG

This commit is contained in:
sw 2014-07-10 16:57:04 +08:00
parent 47ad20421e
commit 7bcb1cbe2e
4 changed files with 6 additions and 4 deletions

View File

@ -84,7 +84,8 @@ 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
end
def applied_by?(user)

View File

@ -623,7 +623,8 @@ 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(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description
description.gsub(/<\/?.*?>/,"").html_safe if description
end
def css_classes

View File

@ -32,7 +32,7 @@
<tr>
<td colspan="2" width="580">
<p class="font_description">
<%= membership.course.description %>
<%= membership.course.short_description %>
</p></td>
</tr>
<tr>

View File

@ -30,7 +30,7 @@
<tr>
<td colspan="2" width="580" >
<p class="font_description">
<%= membership.project.description%>
<%= membership.project.short_description%>
</p></td>
</tr>
<tr>