Defect #30491 ยป short_description_fix.diff
app/models/project.rb (working copy) | ||
---|---|---|
620 | 620 |
name |
621 | 621 |
end |
622 | 622 | |
623 |
# Returns a short description of the projects (first lines) |
|
623 |
# Returns a short description of the projects (first 3 lines)
|
|
624 | 624 |
def short_description(length = 255) |
625 |
description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description |
|
625 |
if description |
|
626 |
description =~ /\A(?>[^\r\n]*(?:\r\n?|\n)?){0,3}/ |
|
627 |
s = $&.strip[0...length] |
|
628 |
s << '...' if s != description |
|
629 |
end |
|
626 | 630 |
end |
627 | 631 | |
628 | 632 |
def css_classes |