Permalink
Browse files

quick and scrappy fix for admins to fix position issues in the backlo…

…g view; click it to fix it.
  • Loading branch information...
1 parent cf20d09 commit adce04484b5068ce65eb78be67b4f01ce4130365 @darcy committed Nov 8, 2011
Showing with 17 additions and 1 deletion.
  1. +14 −0 app/controllers/rb_master_backlogs_controller.rb
  2. +1 −0 app/views/rb_master_backlogs/show.html.erb
  3. +1 −0 config/routes.rb
  4. +1 −1 init.rb
@@ -3,6 +3,20 @@
class RbMasterBacklogsController < RbApplicationController
unloadable
+ def set_positions
+ sprints = RbSprint.open_sprints(@project)
+ sprints.each do |s|
+ s.stories.each_with_index do |st,i|
+ RbStory.update_all(["position=?",i], :id => st.id) #update all to bypass any filters
+ end
+ end
+ product_backlog_stories = RbStory.product_backlog(@project)
+ product_backlog_stories.each_with_index do |st,i|
+ RbStory.update_all(["position=?",i], :id => st.id) #update all to bypass any filters
+ end
+ redirect_to "/rb/master_backlog/#{@project.identifier}"
+ end
+
def show
product_backlog_stories = RbStory.product_backlog(@project)
sprints = RbSprint.open_sprints(@project)
@@ -25,6 +25,7 @@
<%- content_for :view_specific_links do %>
<input class="filter" name="livefilter" type="text" value="" id="livefilter_controll" />
<a id="project_info">Info</a>
+ <%= link_to "Set Positions", "/rb/master_backlog/#{@project.identifier}/set_positions" if @project and User.current.admin %>
<a id="disable_autorefresh">Disable Auto-refresh</a>
<a id="refresh">Refresh</a>
<%- end %>
View
@@ -20,6 +20,7 @@
rb.connect 'server_variables/:project_id/:section.:format', :controller => :rb_server_variables, :action => 'show'
rb.connect 'server_variables/:project_id/:sprint_id/:section.:format', :controller => :rb_server_variables, :action => 'show'
+ rb.connect 'master_backlog/:project_id/set_positions', :controller => :rb_master_backlogs, :action => 'set_positions'
rb.connect 'master_backlog/:project_id', :controller => :rb_master_backlogs, :action => 'show'
rb.connect 'master_backlog/:project_id/menu.:format', :controller => :rb_master_backlogs, :action => 'menu'
View
@@ -51,7 +51,7 @@
:rb_sprints => :reset
}
permission :view_master_backlog, {
- :rb_master_backlogs => [:show, :menu],
+ :rb_master_backlogs => [:show, :menu, :set_positions],
:rb_sprints => [:index, :show, :download],
:rb_wikis => :show,
:rb_stories => [:index, :show],

0 comments on commit adce044

Please sign in to comment.