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.
@cached_label_assigned_to ||= l(:field_assigned_to)
@cached_label_priority ||= l(:field_priority)
- link_to_issue(issue) + ": #{h(issue.subject)}<br /><br />" +
+ link_to_issue(issue) + "<br /><br />" +
"<strong>#{@cached_label_start_date}</strong>: #{format_date(issue.start_date)}<br />" +
"<strong>#{@cached_label_due_date}</strong>: #{format_date(issue.due_date)}<br />" +
"<strong>#{@cached_label_assigned_to}</strong>: #{issue.assigned_to}<br />" +
links = []
links << link_to(l(:label_project_all), {:project_id => nil, :issue_id => nil})
links << link_to(h(@project), {:project_id => @project, :issue_id => nil}) if @project
- links << link_to_issue(@issue) if @issue
+ links << link_to_issue(@issue, :subject => false) if @issue
breadcrumb links
end
image_tag('arrow_to.png')
end %>
<%= h("#{i.project} -") unless @project && @project == i.project %>
- <%= link_to_issue i %>: <%= h(truncate(i.subject, :length => 30)) %>
+ <%= link_to_issue i, :truncate => 30 %>
<span class="tip"><%= render_issue_tooltip i %></span>
</div>
<% else %>
<% @issue.relations.select {|r| r.other_issue(@issue).visible? }.each do |relation| %>
<tr>
<td><%= l(relation.label_for(@issue)) %> <%= "(#{l('datetime.distance_in_words.x_days', :count => relation.delay)})" if relation.delay && relation.delay != 0 %>
- <%= h(relation.other_issue(@issue).project) + ' - ' if Setting.cross_project_issue_relations? %> <%= link_to_issue relation.other_issue(@issue) %></td>
-<td><%=h relation.other_issue(@issue).subject %></td>
+ <%= h(relation.other_issue(@issue).project) + ' - ' if Setting.cross_project_issue_relations? %>
+ <%= link_to_issue relation.other_issue(@issue) %>
+</td>
<td><%= relation.other_issue(@issue).status.name %></td>
<td><%= format_date(relation.other_issue(@issue).start_date) %></td>
<td><%= format_date(relation.other_issue(@issue).due_date) %></td>
<div style="position: absolute;line-height:1.2em;height:16px;top:<%= top %>px;left:4px;overflow:hidden;"><small>
<% if i.is_a? Issue %>
<%= h("#{i.project} -") unless @project && @project == i.project %>
- <%= link_to_issue i %>: <%=h i.subject %>
+ <%= link_to_issue i %>
<% else %>
<span class="icon icon-package">
<%= h("#{i.project} -") unless @project && @project == i.project %>
<% entries_by_day[day].each do |entry| -%>
<tr class="time-entry" style="border-bottom: 1px solid #f5f5f5;">
<td class="activity"><%=h entry.activity %></td>
- <td class="subject"><%=h entry.project %> <%= ' - ' + link_to_issue(entry.issue, :title => h("#{entry.issue.subject} (#{entry.issue.status})")) if entry.issue %></td>
+ <td class="subject"><%=h entry.project %> <%= ' - ' + link_to_issue(entry.issue, :truncate => 50) if entry.issue %></td>
<td class="comments"><%=h entry.comments %></td>
<td class="hours"><%= html_hours("%.2f" % entry.hours) %></td>
<td align="center">
<% if !issues.empty? %>
<ul>
<% issues.each do |issue| %>
- <li><%= link_to_issue(issue) %>: <%=h issue.subject %></li>
+ <li><%= link_to_issue(issue) %></li>
<% end %>
</ul>
<% end %>
<fieldset class="related-issues"><legend><%= l(:label_related_issues) %></legend>
<ul>
<%- issues.each do |issue| -%>
- <li><%= link_to_issue(issue) %>: <%=h issue.subject %></li>
+ <li><%= link_to_issue(issue) %></li>
<%- end -%>
</ul>
</fieldset>
<h3><%= l(:label_related_issues) %></h3>
<ul>
<% @changeset.issues.visible.each do |issue| %>
- <li><%= link_to_issue issue %>: <%=h issue.subject %></li>
+ <li><%= link_to_issue issue %></li>
<% end %>
</ul>
<% end %>
<td class="project"><%=h entry.project %></td>
<td class="subject">
<% if entry.issue -%>
-<%= link_to_issue entry.issue %>: <%= h(truncate(entry.issue.subject, :length => 50)) -%>
+<%= link_to_issue entry.issue, :truncate => 50 -%>
<% end -%>
</td>
<td class="comments"><%=h entry.comments %></td>
<fieldset class="related-issues"><legend><%= l(:label_related_issues) %></legend>
<ul>
<% issues.each do |issue| -%>
- <li><%= link_to_issue(issue) %>: <%=h issue.subject %></li>
+ <li><%= link_to_issue(issue) %></li>
<% end -%>
</ul>
</fieldset>