summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2014-11-05 16:14:20 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2014-11-05 16:14:20 +0000
commit5326eb233e3966bb933c7884823e8aac1f94a4c0 (patch)
treed5db54d0cabb642b23e0030246478633eb10c80a /app
parentb2ba7db4e1489fca318999214764bac82602fa26 (diff)
downloadredmine-5326eb233e3966bb933c7884823e8aac1f94a4c0.tar.gz
redmine-5326eb233e3966bb933c7884823e8aac1f94a4c0.zip
Overrides IssueRelation#to_s.
git-svn-id: http://svn.redmine.org/redmine/trunk@13563 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/models/issue_relation.rb10
-rw-r--r--app/views/issues/_relations.html.erb5
2 files changed, 11 insertions, 4 deletions
diff --git a/app/models/issue_relation.rb b/app/models/issue_relation.rb
index 7248a8868..9eebe1bb0 100644
--- a/app/models/issue_relation.rb
+++ b/app/models/issue_relation.rb
@@ -134,6 +134,16 @@ class IssueRelation < ActiveRecord::Base
:unknow
end
+ def to_s(issue=nil)
+ issue ||= issue_from
+ issue_text = block_given? ? yield(other_issue(issue)) : "##{other_issue(issue).try(:id)}"
+ s = []
+ s << l(label_for(issue))
+ s << "(#{l('datetime.distance_in_words.x_days', :count => delay)})" if delay && delay != 0
+ s << issue_text
+ s.join(' ')
+ end
+
def css_classes_for(issue)
"rel-#{relation_type_for(issue)}"
end
diff --git a/app/views/issues/_relations.html.erb b/app/views/issues/_relations.html.erb
index 049d6f350..58b5bde3e 100644
--- a/app/views/issues/_relations.html.erb
+++ b/app/views/issues/_relations.html.erb
@@ -14,10 +14,7 @@
<tr class="issue hascontextmenu" id="relation-<%= relation.id %>">
<td class="checkbox"><%= check_box_tag("ids[]", other_issue.id, false, :id => nil) %></td>
<td class="subject">
- <%= l(relation.label_for(@issue)) %>
- <%= "(#{l('datetime.distance_in_words.x_days', :count => relation.delay)})" if relation.delay && relation.delay != 0 %>
- <%= h(other_issue.project) + ' - ' if Setting.cross_project_issue_relations? %>
- <%= link_to_issue(other_issue, :truncate => 60) %>
+ <%= relation.to_s(@issue) {|other| link_to_issue(other, :truncate => 60, :project => Setting.cross_project_issue_relations?)}.html_safe %>
</td>
<td class="status"><%=h other_issue.status.name %></td>
<td class="start_date"><%= format_date(other_issue.start_date) %></td>