Browse Source

use "do end" instead of {} at ApplicationHelper

git-svn-id: http://svn.redmine.org/redmine/trunk@20141 e93f8b46-1217-0410-a6f0-8f06a7374b81
tags/4.2.0
Toshi MARUYAMA 3 years ago
parent
commit
d55582dccf
1 changed files with 8 additions and 5 deletions
  1. 8
    5
      app/helpers/application_helper.rb

+ 8
- 5
app/helpers/application_helper.rb View File

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

Loading…
Cancel
Save