Merge pull request #11 from finnlabs/feature/extend_textile_issue_quickinfo

Feature/extend textile issue quickinfo
pull/41/head
Romano Licker 13 years ago
commit dd7d61275c
  1. 14
      app/helpers/issues_helper.rb

@ -231,15 +231,23 @@ module IssuesHelper
:class => issue.css_classes,
:title => "#{ truncate(issue.subject, :length => 100) } (#{ issue.status.name })")
ret += "#{ issue.start_date.nil? ? "[?]" : issue.start_date.to_s }"
ret += " - #{ issue.due_date.nil? ? "[?]" : issue.due_date.to_s }"
ret += " #{ issue.due_date.nil? ? "[?]" : issue.due_date.to_s }"
ret += "#{ issue.assigned_to.nil? ? " " : " (#{h(issue.assigned_to.to_s)})" }"
ret
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