From 7867b4dcd5d6621cf079fc819d49b797a8be3e08 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Sat, 9 Nov 2019 16:04:54 +0000 Subject: [PATCH] cleanup: rubocop: fix Layout/AlignArguments in IssuesHelper#render_issue_relations git-svn-id: http://svn.redmine.org/redmine/trunk@19027 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/issues_helper.rb | 51 ++++++++++++++++++++++++------------ 1 file changed, 34 insertions(+), 17 deletions(-) diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index be20c59d4..2ea81d566 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -146,39 +146,56 @@ module IssuesHelper # Renders the list of related issues on the issue details view def render_issue_relations(issue, relations) manage_relations = User.current.allowed_to?(:manage_issue_relations, issue.project) - s = ''.html_safe relations.each do |relation| other_issue = relation.other_issue(issue) css = "issue hascontextmenu #{other_issue.css_classes}" buttons = if manage_relations - link_to(l(:label_relation_delete), - relation_path(relation), - :remote => true, - :method => :delete, - :data => {:confirm => l(:text_are_you_sure)}, - :title => l(:label_relation_delete), - :class => 'icon-only icon-link-break' - ) + link_to( + l(:label_relation_delete), + relation_path(relation), + :remote => true, + :method => :delete, + :data => {:confirm => l(:text_are_you_sure)}, + :title => l(:label_relation_delete), + :class => 'icon-only icon-link-break' + ) else "".html_safe end buttons << link_to_context_menu - - s << content_tag('tr', - content_tag('td', check_box_tag("ids[]", other_issue.id, false, :id => nil), :class => 'checkbox') + - content_tag('td', relation.to_s(@issue) {|other| link_to_issue(other, :project => Setting.cross_project_issue_relations?)}.html_safe, :class => 'subject', :style => 'width: 50%') + + s << + content_tag( + 'tr', + content_tag('td', + check_box_tag( + "ids[]", other_issue.id, + false, :id => nil), + :class => 'checkbox') + + content_tag('td', + relation.to_s(@issue) {|other| + link_to_issue( + other, + :project => Setting.cross_project_issue_relations?) + }.html_safe, + :class => 'subject', + :style => 'width: 50%') + content_tag('td', other_issue.status, :class => 'status') + content_tag('td', format_date(other_issue.start_date), :class => 'start_date') + content_tag('td', format_date(other_issue.due_date), :class => 'due_date') + content_tag('td', link_to_user(other_issue.assigned_to), :class => 'assigned_to') + - content_tag('td', other_issue.disabled_core_fields.include?('done_ratio') ? '' : progress_bar(other_issue.done_ratio), :class=> 'done_ratio') + + content_tag('td', + (if other_issue.disabled_core_fields.include?('done_ratio') + '' + else + progress_bar(other_issue.done_ratio) + end), + :class=> 'done_ratio') + content_tag('td', buttons, :class => 'buttons'), - :id => "relation-#{relation.id}", - :class => css) + :id => "relation-#{relation.id}", + :class => css) end - content_tag('table', s, :class => 'list issues odd-even') end -- 2.39.5