mirror of
https://github.com/meineerde/redmine.git
synced 2025-12-19 15:01:14 +00: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:
parent
ad110b965f
commit
fb04274fc0
@ -180,7 +180,6 @@ Layout/EmptyLinesAroundArguments:
|
|||||||
# SupportedStyles: empty_lines, no_empty_lines
|
# SupportedStyles: empty_lines, no_empty_lines
|
||||||
Layout/EmptyLinesAroundBlockBody:
|
Layout/EmptyLinesAroundBlockBody:
|
||||||
Exclude:
|
Exclude:
|
||||||
- 'app/helpers/application_helper.rb'
|
|
||||||
- 'app/models/attachment.rb'
|
- 'app/models/attachment.rb'
|
||||||
- 'app/models/setting.rb'
|
- 'app/models/setting.rb'
|
||||||
- 'db/schema.rb'
|
- 'db/schema.rb'
|
||||||
|
|||||||
@ -476,26 +476,21 @@ module ApplicationHelper
|
|||||||
bookmarked = jump_box.bookmarked_projects(params[:q])
|
bookmarked = jump_box.bookmarked_projects(params[:q])
|
||||||
recents = jump_box.recently_used_projects(params[:q])
|
recents = jump_box.recently_used_projects(params[:q])
|
||||||
projects = projects - (recents + bookmarked)
|
projects = projects - (recents + bookmarked)
|
||||||
|
|
||||||
projects_label = (bookmarked.any? || recents.any?) ? :label_optgroup_others : :label_project_plural
|
projects_label = (bookmarked.any? || recents.any?) ? :label_optgroup_others : :label_project_plural
|
||||||
|
|
||||||
jump = params[:jump].presence || current_menu_item
|
jump = params[:jump].presence || current_menu_item
|
||||||
s = (+'').html_safe
|
s = (+'').html_safe
|
||||||
|
|
||||||
build_project_link = ->(project, level = 0){
|
build_project_link = ->(project, level = 0){
|
||||||
padding = level * 16
|
padding = level * 16
|
||||||
text = content_tag('span', project.name, :style => "padding-left:#{padding}px;")
|
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],
|
[bookmarked, :label_optgroup_bookmarks, true],
|
||||||
[recents, :label_optgroup_recents, false],
|
[recents, :label_optgroup_recents, false],
|
||||||
[projects, projects_label, true]
|
[projects, projects_label, true]
|
||||||
].each do |projects, label, is_tree|
|
].each do |projects, label, is_tree|
|
||||||
|
|
||||||
next if projects.blank?
|
next if projects.blank?
|
||||||
|
|
||||||
s << content_tag(:strong, l(label))
|
s << content_tag(:strong, l(label))
|
||||||
if is_tree
|
if is_tree
|
||||||
project_tree(projects, &build_project_link)
|
project_tree(projects, &build_project_link)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user