修复个人主页中作业、项目介绍不正确的BUG
This commit is contained in:
parent
47ad20421e
commit
7bcb1cbe2e
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue