]> source.dussan.org Git - redmine.git/commitdiff
Removed duplicated helper (#11539).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Fri, 10 Aug 2012 18:41:24 +0000 (18:41 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Fri, 10 Aug 2012 18:41:24 +0000 (18:41 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10191 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/application_helper.rb
app/views/trackers/_form.html.erb
public/stylesheets/application.css

index c25bff04960036b50b6c590240c76007f4b89388..c756168d1153e059157fb2179c331e275be2eab1 100644 (file)
@@ -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 << "<ul>\n"
-        else
-          ancestors.pop
-          s << "</li>"
-          while (ancestors.any? && !project.is_descendant_of?(ancestors.last))
-            ancestors.pop
-            s << "</ul></li>\n"
-          end
-        end
-        s << "<li>"
-        s << yield(project).to_s
-        ancestors << project
-      end
-      s << ("</li></ul>\n" * ancestors.size)
-    end
-    s.html_safe
-  end
-
   def principals_check_box_tags(name, principals)
     s = ''
     principals.sort.each do |principal|
index e8819f41d8dc0a2f0d66af6ab538af6e87c7c71d..9039bba683d86a3919a7643e6bd96dd20a7aa384 100644 (file)
@@ -42,7 +42,7 @@
 <div class="splitcontentright">
 <% if @projects.any? %>
 <fieldset class="box" id="tracker_project_ids"><legend><%= l(:label_project_plural) %></legend>
-<%= 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) %>
index df3cd544454960e0b37c55b384ef7287febf13b5..737f029b64dee5a877c963248cc9025eb1359dab 100644 (file)
@@ -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;}