diff --git a/app/controllers/trackers_controller.rb b/app/controllers/trackers_controller.rb
index 8c02f947..51e70ddf 100644
--- a/app/controllers/trackers_controller.rb
+++ b/app/controllers/trackers_controller.rb
@@ -40,8 +40,10 @@ class TrackersController < ApplicationController
end
flash[:notice] = l(:notice_successful_create)
redirect_to :action => 'list'
+ return
end
@trackers = Tracker.find :all, :order => 'position'
+ @projects = Project.find(:all)
end
def edit
@@ -49,7 +51,9 @@ class TrackersController < ApplicationController
if request.post? and @tracker.update_attributes(params[:tracker])
flash[:notice] = l(:notice_successful_update)
redirect_to :action => 'list'
+ return
end
+ @projects = Project.find(:all)
end
def move
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 3f92d8d4..3bdb6e2e 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -195,6 +195,30 @@ module ApplicationHelper
ancestors << project
end
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"
+ else
+ ancestors.pop
+ s << ""
+ while (ancestors.any? && !project.is_descendant_of?(ancestors.last))
+ ancestors.pop
+ s << "
\n"
+ end
+ end
+ s << "
"
+ s << yield(project).to_s
+ ancestors << project
+ end
+ s << ("
\n" * ancestors.size)
+ end
+ s
+ end
# Truncates and returns the string as a single line
def truncate_single_line(string, *args)
diff --git a/app/views/trackers/_form.rhtml b/app/views/trackers/_form.rhtml
index 856b70bb..d8d35ba3 100644
--- a/app/views/trackers/_form.rhtml
+++ b/app/views/trackers/_form.rhtml
@@ -1,5 +1,7 @@
<%= error_messages_for 'tracker' %>
-