The controller loads the list of all sprints, sorted by status. On the
sprint details page the drop down list is show with the current sprint
selected. If the user selects a different sprint and clicks the switch
button then the other sprint is shown.
Added a new route, show_product_sprint_path, that takes as input a
product reference and an argument which is the sprint id.
Signed-off-by: Darryl L. Pierce <mcpierce(a)gmail.com>
---
app/controllers/sprints_controller.rb | 1 +
app/views/sprints/show.html.erb | 9 +++++++++
config/routes.rb | 4 ++++
doc/ChangeLog | 1 +
test/functional/sprints_controller_test.rb | 1 +
5 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/app/controllers/sprints_controller.rb
b/app/controllers/sprints_controller.rb
index 528c1ac..3535a5e 100644
--- a/app/controllers/sprints_controller.rb
+++ b/app/controllers/sprints_controller.rb
@@ -39,6 +39,7 @@ class SprintsController < ApplicationController
# GET /products/1/sprints/1
def show
+ @sprints = Sprint.find(:all, :order => "status ASC", :conditions
=>["product_id = ?", @product.id])
@title = "Sprint #{(a)sprint.id}"
@backlog_items = BacklogItem.paginate(
:conditions => ['sprint_id = ?', @sprint.id],
diff --git a/app/views/sprints/show.html.erb b/app/views/sprints/show.html.erb
index 547a0f7..45e2e81 100644
--- a/app/views/sprints/show.html.erb
+++ b/app/views/sprints/show.html.erb
@@ -33,6 +33,15 @@
</tr>
<tr>
+ <td class="label">Switch to:</td>
+ <td class="value">
+ <%= form_tag show_product_sprint_path(@product) %>
+ <%= select_tag("id", options_for_select((a)sprints.collect{ |sprint|
["#{sprint.title} (#{sprint.status_text})", sprint.id] }, @sprint.id)) %>
+ <%= submit_tag "Switch" %>
+ </td>
+ </tr>
+
+ <tr>
<td class="label">Team lead:</td>
<td class="value"><%= mail_to @sprint.team_lead.email,
@sprint.team_lead.display_name %></td>
</tr>
diff --git a/config/routes.rb b/config/routes.rb
index c667c1f..aa2b8fc 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -30,6 +30,10 @@ ActionController::Routing::Routes.draw do |map|
map.resources :products do |product|
product.resources :roles
product.resources :stories
+ product.resource :sprint, :member =>
+ {
+ :show => :post
+ }
product.resources(:sprints, :member =>
{
:plan => :get,
diff --git a/doc/ChangeLog b/doc/ChangeLog
index 947c98f..f72af9a 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -3,6 +3,7 @@ Change Log (0.2.0):
* #98 - Admins can approve projects. - Darryl L. Pierce <mcpierce(a)gmail.com>
* #99 - Sprints can have team leads. - Darryl L. Pierce <mcpierce(a)gmail.com>
* #100 - Team leads can reopen items. - Darryl L. Pierce <mcpierce(a)gmail.com>
+ * #105 - Users can select another sprint from the sprint details page. - Darryl L.
Pierce <mcpierce(a)gmail.com>
* #125 - Added a system title to all pages. - Darryl L. Pierce
<mcpierce(a)gmail.com>
* #131 - Admins can filter out unapproved projects. - Darryl L. Pierce
<mcpierce(a)gmail.com>
* #132 - Team leads can start sprints. - Darryl L. Pierce <mcpierce(a)gmail.com>
diff --git a/test/functional/sprints_controller_test.rb
b/test/functional/sprints_controller_test.rb
index c2a7066..7536418 100644
--- a/test/functional/sprints_controller_test.rb
+++ b/test/functional/sprints_controller_test.rb
@@ -108,6 +108,7 @@ class SprintsControllerTest < ActionController::TestCase
assert_response :success
assert assigns['sprint'], "Failed to load a sprint."
+ assert assigns['sprints'], "Failed to load all sprints."
assert_equal @active_sprint.id, assigns['sprint'].id,
"Failed to load the correct sprint."
assert assigns['backlog_items'], "Failed to set the backlog."
--
1.6.0.6
Show replies by date
On Tue, Mar 31, 2009 at 8:23 PM, Darryl L. Pierce <mcpierce(a)gmail.com> wrote:
The controller loads the list of all sprints, sorted by status. On
the
sprint details page the drop down list is show with the current sprint
selected. If the user selects a different sprint and clicks the switch
button then the other sprint is shown.
Added a new route, show_product_sprint_path, that takes as input a
product reference and an argument which is the sprint id.
Signed-off-by: Darryl L. Pierce <mcpierce(a)gmail.com>
---
Pushed.
--
Darryl L. Pierce <mcpierce(a)gmail.com>
Visit the Infobahn Offramp: <
http://mcpierce.multiply.com>
"Bury me next to my wife. Nothing too fancy..." - Ulysses S. Grant