mirror of
https://github.com/redmine/redmine.git
synced 2025-12-16 05:20:28 +01:00
code cleanup: rubocop: fix Layout/EmptyLinesAroundBlockBody in app/helpers/application_helper.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@18557 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -476,26 +476,21 @@ module ApplicationHelper
|
||||
bookmarked = jump_box.bookmarked_projects(params[:q])
|
||||
recents = jump_box.recently_used_projects(params[:q])
|
||||
projects = projects - (recents + bookmarked)
|
||||
|
||||
projects_label = (bookmarked.any? || recents.any?) ? :label_optgroup_others : :label_project_plural
|
||||
|
||||
jump = params[:jump].presence || current_menu_item
|
||||
s = (+'').html_safe
|
||||
|
||||
build_project_link = ->(project, level = 0){
|
||||
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))
|
||||
s << link_to(text, project_path(project, :jump => jump),
|
||||
:title => project.name, :class => (project == selected ? 'selected' : nil))
|
||||
}
|
||||
|
||||
[
|
||||
[bookmarked, :label_optgroup_bookmarks, true],
|
||||
[recents, :label_optgroup_recents, false],
|
||||
[projects, projects_label, true]
|
||||
].each do |projects, label, is_tree|
|
||||
|
||||
next if projects.blank?
|
||||
|
||||
s << content_tag(:strong, l(label))
|
||||
if is_tree
|
||||
project_tree(projects, &build_project_link)
|
||||
|
||||
Reference in New Issue
Block a user