From d55582dccf911e31eefa964182073f45b745274f Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Sun, 11 Oct 2020 12:57:31 +0000 Subject: use "do end" instead of {} at ApplicationHelper git-svn-id: http://svn.redmine.org/redmine/trunk@20141 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/application_helper.rb | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 4161600c7..9f6317f42 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -511,13 +511,13 @@ module ApplicationHelper end jump = params[:jump].presence || current_menu_item s = (+'').html_safe - build_project_link = ->(project, level = 0){ + build_project_link = ->(project, level = 0) do padding = level * 16 text = content_tag('span', project.name, :style => "padding-left:#{padding}px;") s << link_to(text, project_path(project, :jump => jump), :title => project.name, :class => (project == selected ? 'selected' : nil)) - } + end [ [bookmarked, :label_optgroup_bookmarks, true], [recents, :label_optgroup_recents, false], @@ -706,7 +706,10 @@ module ApplicationHelper b << "\xe2\x80\xa6" ancestors = ancestors[-2, 2] end - b += ancestors.collect {|p| link_to_project(p, {:jump => current_menu_item}, :class => 'ancestor') } + b += + ancestors.collect do |p| + link_to_project(p, {:jump => current_menu_item}, :class => 'ancestor') + end end b << content_tag(:span, h(@project), class: 'current-project') if b.size > 1 @@ -1723,9 +1726,9 @@ module ApplicationHelper messages[message] << item end end - messages.map { |message, items| + messages.map do |message, items| "#{message}: " + items.map {|i| "##{i.id}"}.join(', ') - } + end end def render_if_exist(options = {}, locals = {}, &block) -- cgit v1.2.3