|
|
|
@ -58,9 +58,29 @@ module ApplicationHelper |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
# Displays a link to +issue+ with its subject. |
|
|
|
|
# Examples: |
|
|
|
|
# |
|
|
|
|
# link_to_issue(issue) # => Defect #6: This is the subject |
|
|
|
|
# link_to_issue(issue, :truncate => 6) # => Defect #6: This i... |
|
|
|
|
# link_to_issue(issue, :subject => false) # => Defect #6 |
|
|
|
|
# |
|
|
|
|
def link_to_issue(issue, options={}) |
|
|
|
|
options[:class] ||= issue.css_classes |
|
|
|
|
link_to "#{issue.tracker.name} ##{issue.id}", {:controller => "issues", :action => "show", :id => issue}, options |
|
|
|
|
title = nil |
|
|
|
|
subject = nil |
|
|
|
|
if options[:subject] == false |
|
|
|
|
title = truncate(issue.subject, :length => 60) |
|
|
|
|
else |
|
|
|
|
subject = issue.subject |
|
|
|
|
if options[:truncate] |
|
|
|
|
subject = truncate(subject, :length => options[:truncate]) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
s = link_to "#{issue.tracker} ##{issue.id}", {:controller => "issues", :action => "show", :id => issue}, |
|
|
|
|
:class => issue.css_classes, |
|
|
|
|
:title => title |
|
|
|
|
s << ": #{h subject}" if subject |
|
|
|
|
s |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
# Generates a link to an attachment. |
|
|
|
|