cut of the description with "…" in issue textile quickinfo links

pull/41/head
Romano Licker 13 years ago
parent e3ab381eb4
commit 2be910f6d1
  1. 12
      app/helpers/issues_helper.rb

@ -237,9 +237,17 @@ module IssuesHelper
end
def issue_quick_info_with_description(issue, lines = 3)
limited_description = issue.description.to_s.lines.to_a[0,lines + 1].to_s
description_lines = issue.description.to_s.lines.to_a[0,lines]
if description_lines[lines-1] && issue.description.to_s.lines.size > lines
description_lines[lines-1].strip!
while !description_lines[lines-1].end_with?("...") do
description_lines[lines-1] = description_lines[lines-1] + "."
end
end
issue_quick_info(issue) +
content_tag(:div, textilizable("\n" + limited_description), :class => "indent")
content_tag(:div, textilizable("\n" + description_lines.to_s), :class => "indent")
end
end

Loading…
Cancel
Save