Browse Source

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
tags/4.1.0
Toshi MARUYAMA 4 years ago
parent
commit
7867b4dcd5
1 changed files with 34 additions and 17 deletions
  1. 34
    17
      app/helpers/issues_helper.rb

+ 34
- 17
app/helpers/issues_helper.rb View File

@@ -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


Loading…
Cancel
Save