From 145e5997b2cf000d515d205717a7ee92acdc19c8 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Fri, 10 Aug 2012 18:41:24 +0000 Subject: [PATCH] Removed duplicated helper (#11539). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10191 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/application_helper.rb | 26 +------------------------- app/views/trackers/_form.html.erb | 2 +- public/stylesheets/application.css | 7 ++----- 3 files changed, 4 insertions(+), 31 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index c25bff049..c756168d1 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -203,7 +203,7 @@ module ApplicationHelper if projects.any? ancestors = [] original_project = @project - projects.each do |project| + projects.sort_by(&:lft).each do |project| # set the project environment to please macros. @project = project if (ancestors.empty? || project.is_descendant_of?(ancestors.last)) @@ -302,30 +302,6 @@ module ApplicationHelper Project.project_tree(projects, &block) end - def project_nested_ul(projects, &block) - s = '' - if projects.any? - ancestors = [] - projects.sort_by(&:lft).each do |project| - if (ancestors.empty? || project.is_descendant_of?(ancestors.last)) - s << "\n" - end - end - s << "
  • " - s << yield(project).to_s - ancestors << project - end - s << ("
  • \n" * ancestors.size) - end - s.html_safe - end - def principals_check_box_tags(name, principals) s = '' principals.sort.each do |principal| diff --git a/app/views/trackers/_form.html.erb b/app/views/trackers/_form.html.erb index e8819f41d..9039bba68 100644 --- a/app/views/trackers/_form.html.erb +++ b/app/views/trackers/_form.html.erb @@ -42,7 +42,7 @@
    <% if @projects.any? %>
    <%= l(:label_project_plural) %> -<%= project_nested_ul(@projects) do |p| +<%= render_project_nested_lists(@projects) do |p| content_tag('label', check_box_tag('tracker[project_ids][]', p.id, @tracker.projects.include?(p), :id => nil) + ' ' + h(p)) end %> <%= hidden_field_tag('tracker[project_ids][]', '', :id => nil) %> diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index df3cd5444..737f029b6 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -413,19 +413,16 @@ input#issue_subject { width: 99%; } select#issue_done_ratio { width: 95px; } ul.projects {margin:0; padding-left:1em;} +ul.projects ul {padding-left:1.6em;} ul.projects.root {margin:0; padding:0;} ul.projects li {list-style-type:none;} -#projects-index ul.projects ul.projects { border-left: 3px solid #e0e0e0; } +#projects-index ul.projects ul.projects { border-left: 3px solid #e0e0e0; padding-left:1em;} #projects-index ul.projects li.root {margin-bottom: 1em;} #projects-index ul.projects li.child {margin-top: 1em;} #projects-index ul.projects div.root a.project { font-family: "Trebuchet MS", Verdana, sans-serif; font-weight: bold; font-size: 16px; margin: 0 0 10px 0; } -#notified-projects ul.projects ul {padding-left:1.6em;} .my-project { padding-left: 18px; background: url(../images/fav.png) no-repeat 0 50%; } -#tracker_project_ids ul { margin: 0; padding-left: 1em; } -#tracker_project_ids li { list-style-type:none; } - #related-issues li img {vertical-align:middle;} ul.properties {padding:0; font-size: 0.9em; color: #777;} -- 2.39.5