[PATCH] Set titles for all action icons.
by Darryl L. Pierce
Signed-off-by: Darryl L. Pierce <mcpierce(a)gmail.com>
---
app/views/items/_list.html.erb | 8 ++++----
app/views/items/show.html.erb | 12 ++++++------
app/views/products/_list.html.erb | 4 ++--
app/views/products/show.html.erb | 8 ++++----
app/views/projects/index.html.erb | 4 ++--
app/views/projects/show.html.erb | 6 +++---
app/views/sprints/_list.html.erb | 8 +++++---
app/views/sprints/show.html.erb | 8 ++++----
app/views/stories/_list.html.erb | 6 +++---
app/views/stories/show.html.erb | 4 ++--
app/views/tasks/_list.html.erb | 6 +++---
app/views/tasks/show.html.erb | 6 +++---
app/views/users/_list.html.erb | 4 ++--
app/views/users/show.html.erb | 6 +++---
public/images/icons/story_view.png | Bin 0 -> 634 bytes
15 files changed, 46 insertions(+), 44 deletions(-)
create mode 100755 public/images/icons/story_view.png
diff --git a/app/views/items/_list.html.erb b/app/views/items/_list.html.erb
index 41fd9f2..d669185 100644
--- a/app/views/items/_list.html.erb
+++ b/app/views/items/_list.html.erb
@@ -73,16 +73,16 @@
product_sprint_item_path(product, sprint, item)) %>
<%= link_to(image_tag("icons/story_view.png", :title => "View the user story..."),
product_story_path(product, item.user_story)) %>
- <%= link_to(image_tag("icons/item_accept.png"),
+ <%= link_to(image_tag("icons/item_accept.png", :title => "Accept this item..."),
accept_product_sprint_item_path(product, sprint, item,
:source => request.request_uri)) if item.can_accept?(@user) %>
- <%= link_to(image_tag("icons/item_drop.png"),
+ <%= link_to(image_tag("icons/item_drop.png", :title => "Drop this item..."),
drop_product_sprint_item_path(product, sprint,item,
:source => request.request_uri)) if item.can_drop?(@user) %>
- <%= link_to(image_tag("icons/item_complete.png"),
+ <%= link_to(image_tag("icons/item_complete.png", :title =>"Mark this item completed..."),
complete_product_sprint_item_path(product, sprint, item,
:source => request.request_uri)) if item.can_complete?(@user) %>
- <%= link_to(image_tag("icons/item_reopen.png"),
+ <%= link_to(image_tag("icons/item_reopen.png", :title => "Reopen this item..."),
reopen_product_sprint_item_path(product, sprint, item,
:source => request.request_uri)) if item.can_reopen?(@user) %>
</td>
diff --git a/app/views/items/show.html.erb b/app/views/items/show.html.erb
index 4c2b7d4..f7a05e3 100644
--- a/app/views/items/show.html.erb
+++ b/app/views/items/show.html.erb
@@ -8,20 +8,20 @@
<tbody>
<tr>
<td class="toolbar" colspan="2">
- <%= link_to(image_tag("icons/back.png", :alt => "Return to sprint..."),
+ <%= link_to(image_tag("icons/back.png", :title => "Back..."),
product_sprint_path(@product, @sprint)) %>
- <%= link_to(image_tag("icons/new.png", :alt => "Add task..."),
+ <%= link_to(image_tag("icons/new.png", :title => "Add task..."),
new_user_task_path(@user, :item => @backlog_item)) if @backlog_item.can_add_tasks?(@user) %>
- <%= link_to(image_tag("icons/item_accept.png"),
+ <%= link_to(image_tag("icons/item_accept.png", :title => "Accept this item..."),
accept_product_sprint_item_path(@product, @sprint, @backlog_item,
:url => request.request_uri)) if @backlog_item.can_accept?(@user) %>
- <%= link_to(image_tag("icons/item_drop.png"),
+ <%= link_to(image_tag("icons/item_drop.png", :title => "Drop this item..."),
drop_product_sprint_item_path(@product, @sprint,@backlog_item,
:url => request.request_uri)) if @backlog_item.can_drop?(@user) %>
- <%= link_to(image_tag("icons/item_complete.png"),
+ <%= link_to(image_tag("icons/item_complete.png", :title => "Mark this item completed..."),
complete_product_sprint_item_path(@product, @sprint, @backlog_item,
:url => request.request_uri)) if @backlog_item.can_complete?(@user) %>
- <%= link_to(image_tag("icons/item_reopen.png"),
+ <%= link_to(image_tag("icons/item_reopen.png", :title => "Reopen this item..."),
reopen_product_sprint_item_path(@product, @sprint, @backlog_item,
:url => request.request_uri)) if @backlog_item.can_reopen?(@user) %>
</td>
diff --git a/app/views/products/_list.html.erb b/app/views/products/_list.html.erb
index a71f794..4dd019a 100644
--- a/app/views/products/_list.html.erb
+++ b/app/views/products/_list.html.erb
@@ -62,9 +62,9 @@
<td><%= link_to "#{product.sprints.size}", product_sprints_path(product) %></td>
<td><%= link_to "#{product.product_roles.size}", product_roles_path(product) %>
<td>
- <%= link_to(image_tag("icons/view.png", :alt => "View product..."),
+ <%= link_to(image_tag("icons/view.png", :title => "View this product..."),
product_path(product)) %>
- <%= link_to(image_tag("icons/edit.png", :alt => "Edit product..."),
+ <%= link_to(image_tag("icons/edit.png", :title => "Edit this product..."),
edit_product_path(product)) if product.can_edit?(@user) %>
</tr>
<% end %>
diff --git a/app/views/products/show.html.erb b/app/views/products/show.html.erb
index 1bfe486..46066f4 100644
--- a/app/views/products/show.html.erb
+++ b/app/views/products/show.html.erb
@@ -14,13 +14,13 @@
<tbody>
<tr>
<td class="toolbar" colspan="2">
- <%= link_to(image_tag("icons/product_join.png", :alt => "Join this product team..."),
+ <%= link_to(image_tag("icons/product_join.png", :title => "Join this product team..."),
new_product_role_path(@product)) unless @product.is_member?(@user) %>
- <%= link_to(image_tag("icons/edit.png", :alt => "Edit this product..."),
+ <%= link_to(image_tag("icons/edit.png", :title => "Edit this product..."),
edit_product_path(@product, :url => request.request_uri)) if @product.can_edit?(@user) %>
- <%= link_to(image_tag("icons/story_add.png", :alt => "Create a new user story..."),
+ <%= link_to(image_tag("icons/story_add.png", :title => "Create a new user story..."),
new_product_story_path(@product, :source => request.request_uri)) if @product.can_create_user_stories?(@user) %>
- <%= link_to(image_tag("icons/sprint_add.png", :alt => "Create a new sprint..."),
+ <%= link_to(image_tag("icons/sprint_add.png", :title => "Create a new sprint..."),
new_product_sprint_path(@product)) if @product.can_create_sprints?(@user) %>
</td>
</tr>
diff --git a/app/views/projects/index.html.erb b/app/views/projects/index.html.erb
index 36d2405..b146314 100644
--- a/app/views/projects/index.html.erb
+++ b/app/views/projects/index.html.erb
@@ -44,10 +44,10 @@
<td><%= show_date(project.created_at) %></td>
<td>
<%= link_to(
- image_tag("icons/view.png", :alt => "View"),
+ image_tag("icons/view.png", :title => "View this project..."),
project_path(project)) %>
<%= link_to(
- image_tag("icons/edit.png", :alt => "Edit"),
+ image_tag("icons/edit.png", :title => "Edit this project..."),
edit_project_path(project, :source => request.request_uri)) if project.can_edit?(@user)%>
</td>
</tr>
diff --git a/app/views/projects/show.html.erb b/app/views/projects/show.html.erb
index 0b7fffa..d402e71 100644
--- a/app/views/projects/show.html.erb
+++ b/app/views/projects/show.html.erb
@@ -8,11 +8,11 @@
<tbody>
<tr>
<td class="toolbar" colspan="2">
- <%= link_to(image_tag("icons/back.png", :alt => "Project list..."),
+ <%= link_to(image_tag("icons/back.png", :title => "Back..."),
projects_path) %>
- <%= link_to(image_tag("icons/edit.png", :alt => "Edit"),
+ <%= link_to(image_tag("icons/edit.png", :title => "Edit this project..."),
edit_project_path(@project)) if @project.can_edit?(@user) %>
- <%= link_to(image_tag("icons/new.png", :alt => "New product..."),
+ <%= link_to(image_tag("icons/new.png", :title => "Create a new product..."),
new_product_path(:project => @project)) if @project.can_create_products?(@user) %>
</td>
</tr>
diff --git a/app/views/sprints/_list.html.erb b/app/views/sprints/_list.html.erb
index d89a613..f549b09 100644
--- a/app/views/sprints/_list.html.erb
+++ b/app/views/sprints/_list.html.erb
@@ -39,12 +39,14 @@
<td><%= "#{show_date(sprint.end_date)} (#{sprint.duration} days)" %></td>
<td><%= show_hours_as_ear(sprint) %></td>
<td>
- <%= link_to(image_tag("icons/view.png"), product_sprint_path(@product, sprint)) %>
+ <%= link_to(image_tag("icons/view.png", :title => "View this sprint..."),
+ product_sprint_path(@product, sprint)) %>
<% if sprint.can_edit?(@user) %>
<%= link_to(
- image_tag("icons/edit.png"), edit_product_sprint_path(@product, sprint)) %>
+ image_tag("icons/edit.png", :title => "Edit this sprint..."),
+ edit_product_sprint_path(@product, sprint)) %>
<% end %>
- <%= link_to(image_tag("icons/delete.png"),
+ <%= link_to(image_tag("icons/delete.png", :title => "Delete this sprint..."),
product_sprint_path(@product, sprint), :method => :delete,
:confirm => "Delete? Are you sure?") if sprint.can_delete?(@user) %>
</td>
diff --git a/app/views/sprints/show.html.erb b/app/views/sprints/show.html.erb
index 0b826c6..83ffbbc 100644
--- a/app/views/sprints/show.html.erb
+++ b/app/views/sprints/show.html.erb
@@ -9,19 +9,19 @@
<tr>
<td colspan="2" class="toolbar">
<%= link_to(
- image_tag("icons/back.png", :alt => "Return to sprint list..."),
+ image_tag("icons/back.png", :title => "Back..."),
product_sprints_path(@product)) %>
<% if @sprint.can_edit?(@user) %>
<%= link_to(
- image_tag("icons/edit.png", :alt => "Edit this sprint"),
+ image_tag("icons/edit.png", :title => "Edit this sprint"),
edit_product_sprint_path(@product, @sprint)) %>
<% end %>
<% if @sprint.can_populate?(@user) %>
<%= link_to(
- image_tag("icons/sprint_plan.png", :alt => "Plan this sprint"),
+ image_tag("icons/sprint_plan.png", :title => "Plan this sprint..."),
plan_product_sprint_path(@product, @sprint)) %>
<% end %>
- <%= link_to(image_tag("icons/delete.png", :alt => "Delete this sprint"),
+ <%= link_to(image_tag("icons/delete.png", :title => "Delete this sprint..."),
product_sprint_path(@product, @sprint), :method => :delete,
:confirm => "Delete? Are you sure?") if @sprint.can_delete?(@user) %>
</td>
diff --git a/app/views/stories/_list.html.erb b/app/views/stories/_list.html.erb
index 09edc9f..7ccd44b 100644
--- a/app/views/stories/_list.html.erb
+++ b/app/views/stories/_list.html.erb
@@ -32,12 +32,12 @@
<td><%= story.priority %></td>
<td><%= story.title %></td>
<td>
- <%= link_to(image_tag("icons/view.png", :alt => "View"),
+ <%= link_to(image_tag("icons/view.png", :title => "View this user story..."),
product_story_path(story.product,story)) %>
- <%= link_to(image_tag("icons/edit.png", :alt => "Edit"),
+ <%= link_to(image_tag("icons/edit.png", :title => "Edit this user story..."),
edit_product_story_path(story.product,story,
:source => request.request_uri)) if story.can_edit?(@user) %>
- <%= link_to(image_tag("icons/delete.png", :alt => "Delete"),
+ <%= link_to(image_tag("icons/delete.png", :title => "Delete this user story..."),
product_story_path(story.product, story,
:source => request.request_uri), :method => :delete,
:confirm => "Delete? Are you sure?") if story.can_delete?(@user) %>
diff --git a/app/views/stories/show.html.erb b/app/views/stories/show.html.erb
index e17c0c1..f0d4aea 100644
--- a/app/views/stories/show.html.erb
+++ b/app/views/stories/show.html.erb
@@ -9,9 +9,9 @@
<tr>
<td class="toolbar" colspan="2">
- <%= link_to(image_tag("icons/back.png", :alt => "Return to the list..."),
+ <%= link_to(image_tag("icons/back.png", :title => "Back..."),
product_stories_path(@product)) %>
- <%= link_to(image_tag("icons/edit.png", :alt => "Edit"),
+ <%= link_to(image_tag("icons/edit.png", :title => "Edit this user story..."),
edit_product_story_path(@product, @user_story,
:url => request.request_uri)) if @user_story.can_edit?(@user) %>
</td>
diff --git a/app/views/tasks/_list.html.erb b/app/views/tasks/_list.html.erb
index 17829cc..da361f5 100644
--- a/app/views/tasks/_list.html.erb
+++ b/app/views/tasks/_list.html.erb
@@ -35,11 +35,11 @@
<td><%= link_to(task.backup, user_path(task.backup)) if task.backup %></td>
<td><%= format "%0.2f", task.hours %>
<td>
- <%= link_to(image_tag("icons/view.png", :alt => "View task..."),
+ <%= link_to(image_tag("icons/view.png", :title => "View this task..."),
user_task_path(task.primary, task)) %>
- <%= link_to(image_tag("icons/edit.png", :atl => "Edit task..."),
+ <%= link_to(image_tag("icons/edit.png", :title => "Edit this task..."),
edit_user_task_path(task.primary, task)) if task.can_edit?(@user) %>
- <%= link_to(image_tag("icons/delete.png", :alt => "Delete task..."),
+ <%= link_to(image_tag("icons/delete.png", :title => "Delete this task..."),
user_task_path(task.primary, task), :confirm => "Are you sure?",
:method => :delete) if task.can_delete?(@user) %>
</td>
diff --git a/app/views/tasks/show.html.erb b/app/views/tasks/show.html.erb
index 89b003f..0657f7b 100644
--- a/app/views/tasks/show.html.erb
+++ b/app/views/tasks/show.html.erb
@@ -8,11 +8,11 @@
<tbody>
<tr>
<td class="toolbar" colspan="2">
- <%= link_to(image_tag("icons/back.png", :alt => "Back..."),
+ <%= link_to(image_tag("icons/back.png", :title => "Back..."),
user_tasks_path((a)task.primary)) %>
- <%= link_to(image_tag("icons/edit.png", :alt => "Edit..."),
+ <%= link_to(image_tag("icons/edit.png", :title => "Edit this task..."),
edit_user_task_path((a)task.primary, @task)) if @task.can_edit?(@user) %>
- <%= link_to(image_tag("icons/delete.png", :alt => "Delete..."),
+ <%= link_to(image_tag("icons/delete.png", :title => "Delete this task..."),
user_task_path((a)task.primary, @task, :confirm => "Delete? Are you sure?",
:html => {:method => :delete})) if @task.can_delete?(@user) %>
</td>
diff --git a/app/views/users/_list.html.erb b/app/views/users/_list.html.erb
index 8c0382c..7c21bdd 100644
--- a/app/views/users/_list.html.erb
+++ b/app/views/users/_list.html.erb
@@ -36,8 +36,8 @@
<td><%= link_to "#{user.product_roles.size} roles", roles_user_path(user) %></td>
<td><%= show_date(user.created_at) %></td>
<td>
- <%= link_to(image_tag("icons/view.png", :alt => "View user..."), user_path(user)) %>
- <%= link_to(image_tag("icons/edit.png", :alt => "Edit"),
+ <%= link_to(image_tag("icons/view.png", :title => "View this user..."), user_path(user)) %>
+ <%= link_to(image_tag("icons/edit.png", :title => "Edit this user..."),
edit_user_path(user)) if user.can_edit?(@user) %>
</td>
</tr>
diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb
index ab1cde5..a2a772f 100644
--- a/app/views/users/show.html.erb
+++ b/app/views/users/show.html.erb
@@ -8,10 +8,10 @@
<tbody>
<tr>
<td class="toolbar" colspan="2">
- <%= link_to(image_tag("icons/back.png", :alt => "Back to users list..."), users_path) %>
- <%= link_to(image_tag("icons/edit.png", :alt => "Edit"),
+ <%= link_to(image_tag("icons/back.png", :title => "Back..."), users_path) %>
+ <%= link_to(image_tag("icons/edit.png", :title => "Edit this user..."),
edit_user_path(@this_user)) if @this_user.can_edit?(@user) %>
- <%= link_to(image_tag("icons/password.png", :alt => "Change password"),
+ <%= link_to(image_tag("icons/password.png", :title => "Change the account password..."),
password_user_path(@this_user)) if @this_user.can_edit?(@user) %>
</td>
</tr>
diff --git a/public/images/icons/story_view.png b/public/images/icons/story_view.png
new file mode 100755
index 0000000000000000000000000000000000000000..5cc2b0dd36978513f3ca009c68ebc4150976fc80
GIT binary patch
literal 634
zcmV-=0)_pFP)<h;3K|Lk000e1NJLTq000mG000mO1^@s6AM^iV00004XF*Lt006JZ
zHwB960000PbVXQnQ*UN;cVTj606}DLVr3vnZDD6+Qe|Oed2z{QJOBU!3`s;mR2Uhh
z!Oe?KaTv$p&;2`xG{cCdW)fo9c+KJ|GL(o|SlCEe*x1Mh3l?I9C`oGm2eV;gp`;`f
zVPPXLC4^EGGtY~2e)s(~XJT)1T_%bDVf&7cAKkL8b?JLY{Spv?BJgk&A{5A-kdQkb
z!NBag{qp6fQ#Y>cA1hm<t!uO9^rxXY%tU{?<JW+(vQsN{zE3h!-CBt$rCgjpxRRMV
zeDOVvQVJSXb_6Jd2LvKQcm$q>XW<Ge7t4p|;o&q&BpQ|slTb2b!oo<&FiV&@R)``J
zWfqOdP9u3ZjRcq(mW(19sW2=-kziI)aQ@bAPT$;&ike1v&`1g~&5T9@k{Kx(MPU>M
zDZ#H?v3PJ5$Hq5O<sK1Eql|F=GBc)0oV>mbDN{wJ%9%wAR<de%BNM$gd&fptpsO^>
zT-Qu9!vIN`896F;t~rD&@Nfe0`Nv1rEgogE>hi36i1p_V%rE6ZqX5JdGmz-z3Rm#{
z+Z*c0<fy5==I5^oHZ0l7WZmKMy9eLOh~O^+j45XHa*ynpp@F63a9qKcA0JpacbMlN
zAM*I^3p!5A_8lJ|A6l|#f4CDKxH}QS&%q<~s){Nqdbwi7;A%FF?BeN%N8Eq)gk{|m
zx9?m&v&SUyFV>z*?bg!mefM79{Zs`zK3~u)rkEuD#mHG}dlY@$@R6?<^o~D%1C9AK
Udps;mZ~y=R07*qoM6N<$f`qvmMgRZ+
literal 0
HcmV?d00001
--
1.6.0.2
15 years, 4 months
[PATCH] Sprint status is updated separate from the details page #82
by Darryl L. Pierce
When the user selects to set the status, they're brought to a page and
asked to confirm the change.
Signed-off-by: Darryl L. Pierce <mcpierce(a)gmail.com>
---
app/controllers/sprints_controller.rb | 35 ++++++++++++++
app/models/sprint.rb | 19 +++++++-
app/models/user_story.rb | 5 ++
app/views/sprints/show.html.erb | 29 +++++++-----
app/views/sprints/status.html.erb | 37 +++++++++++++++
config/routes.rb | 9 +++-
public/images/icons/sprint_cancel.png | Bin 0 -> 700 bytes
public/images/icons/sprint_complete.png | Bin 0 -> 623 bytes
public/images/icons/sprint_start.png | Bin 0 -> 670 bytes
public/images/icons/story_view.png | Bin 0 -> 465 bytes
test/functional/sprints_controller_test.rb | 67 ++++++++++++++++++++++++++++
11 files changed, 188 insertions(+), 13 deletions(-)
create mode 100644 app/views/sprints/status.html.erb
create mode 100644 public/images/icons/sprint_cancel.png
create mode 100644 public/images/icons/sprint_complete.png
create mode 100644 public/images/icons/sprint_start.png
create mode 100644 public/images/icons/story_view.png
diff --git a/app/controllers/sprints_controller.rb b/app/controllers/sprints_controller.rb
index 09ebe5b..c836acd 100644
--- a/app/controllers/sprints_controller.rb
+++ b/app/controllers/sprints_controller.rb
@@ -20,6 +20,7 @@ class SprintsController < ApplicationController
before_filter :authenticated, :except => [:index, :show]
before_filter :load_product
before_filter :load_sprint, :except => [:index, :new, :create]
+ before_filter :get_status, :only => [:status]
# GET /products/1/sprints
def index
@@ -104,6 +105,29 @@ class SprintsController < ApplicationController
end
end
+ # PUT /products/1/sprints/1/status
+ def status
+ respond_to do |format|
+ if @sprint.can_edit?(@user)
+ if @sprint.allowed_status?(@status)
+ Sprint.transaction do
+ @sprint.status = @status
+ @sprint.save!
+
+ flash[:message] = "Sprint moved to #{(a)sprint.status_text}."
+ format.html { redirect_to product_sprint_path(@product, @sprint) }
+ end
+ else
+ flash[:error] = "You cannot move the sprint to #{(a)sprint.status_text}."
+ format.html { redirect_to product_sprint_path(@product, @sprint) }
+ end
+ else
+ flash[:error] = "You are not allowed to change this sprint's status."
+ format.html { redirect_to product_sprint_path(@product, @sprint) }
+ end
+ end
+ end
+
# DELETE /products/1/sprints/1/destroy
def destroy
respond_to do |format|
@@ -216,4 +240,15 @@ class SprintsController < ApplicationController
end
end
end
+
+ def get_status
+ @status = params[:status].to_i
+
+ unless @status && (0...Sprint::STATUS_TEXT.size).include?(@status)
+ flash[:error] = "Missing or invalid status."
+ respond_to do |format|
+ format.html { redirect_to product_sprint_path(@product, @sprint) }
+ end
+ end
+ end
end
diff --git a/app/models/sprint.rb b/app/models/sprint.rb
index 2638613..1fffb5b 100644
--- a/app/models/sprint.rb
+++ b/app/models/sprint.rb
@@ -124,7 +124,24 @@ class Sprint < ActiveRecord::Base
# Returns whether the specified user is allowed to populate this sprint.
def can_populate?(user)
- user && (user.id == product.owner.id)
+ user && (user.id == product.owner.id) && pending?
+ end
+
+ # Returns whether the sprint can be moved to the given status.
+ def allowed_status?(status)
+ case self.status
+ when STATUS_PLANNED:
+ return true if status == STATUS_ACTIVE
+ when STATUS_ACTIVE:
+ if(status == STATUS_PLANNED && actual_hours == 0) ||
+ ([STATUS_CANCELED, STATUS_CLOSED].include?(status))
+ return true
+ end
+ when STATUS_CLOSED: return true if status == STATUS_ACTIVE
+ when STATUS_CANCELED: return true if status == STATUS_ACTIVE
+ end
+
+ return false
end
# Returns whether the sprint is pending.
diff --git a/app/models/user_story.rb b/app/models/user_story.rb
index f8b3963..ba6c648 100644
--- a/app/models/user_story.rb
+++ b/app/models/user_story.rb
@@ -51,4 +51,9 @@ class UserStory < ActiveRecord::Base
def can_be_deleted?
backlog_items.empty?
end
+
+ # Returns whether the user story is closed.
+ def closed?
+ closed
+ end
end
diff --git a/app/views/sprints/show.html.erb b/app/views/sprints/show.html.erb
index 0b826c6..7f2c911 100644
--- a/app/views/sprints/show.html.erb
+++ b/app/views/sprints/show.html.erb
@@ -45,17 +45,24 @@
<tr>
<td class="label">Status:</td>
<td class="value">
- <% if @sprint.can_edit?(@user) %>
- <% form_for(:sprint, @sprint, :url => product_sprint_path(@product, @sprint),
- :html => {:method => :put}) do |form| %>
- <%= hidden_field_tag :url, product_sprint_url(@product, @sprint) %>
- <%= select :sprint, :status, Sprint::STATUS_TEXT %>
- <%= submit_tag "Apply" %>
- <% end %>
- <% else %>
- <%= Sprint::STATUS_TEXT[@sprint.status] %>
- <% end %>
- </td>
+ <%= @sprint.status_text %>
+ <% if @sprint.can_edit?(@user) %>
+ [
+ <%= link_to(image_tag("icons/sprint_plan.png", :title => "Move sprint back to planning..."),
+ status_product_sprint_path(@product, @sprint, :status => Sprint::STATUS_PLANNED),
+ :method => :put) if @sprint.allowed_status?(Sprint::STATUS_PLANNED) %>
+ <%= link_to(image_tag("icons/sprint_start.png", :title => "Start this sprint..."),
+ status_product_sprint_path(@product, @sprint, :status => Sprint::STATUS_ACTIVE),
+ :method => :put) if @sprint.allowed_status?(Sprint::STATUS_ACTIVE) %>
+ <%= link_to(image_tag("icons/sprint_complete.png", :title => "Mark this sprint as completed..."),
+ status_product_sprint_path(@product, @sprint, :status => Sprint::STATUS_CLOSED),
+ :method => :put) if @sprint.allowed_status?(Sprint::STATUS_CLOSED) %>
+ <%= link_to(image_tag("icons/sprint_cancel.png", :title => "Cancel this sprint..."),
+ status_product_sprint_path(@product, @sprint, :status => Sprint::STATUS_CANCELED),
+ :method => :put) if @sprint.allowed_status?(Sprint::STATUS_CANCELED) %>
+ ]
+ <% end %>
+ </td>
</tr>
<% if @sprint.can_view_burndown? %>
diff --git a/app/views/sprints/status.html.erb b/app/views/sprints/status.html.erb
new file mode 100644
index 0000000..4a32fd9
--- /dev/null
+++ b/app/views/sprints/status.html.erb
@@ -0,0 +1,37 @@
+<% form_for(:sprint, @sprint, :url => update_status_product_sprint_path(@product, @sprint),
+ :html => {:method => :put}) do |form| %>
+
+ <fieldset id="status">
+ <legend>Update Sprint Status</legend>
+
+ <table class="edit">
+ <colgroup>
+ <col class="label" />
+ <col class="value" />
+ </colgroup>
+
+ <tbody>
+ <tr>
+ <td class="label-required">Title</td>
+ <td class="value">
+ <%= form.text_field :title %>
+ <%= error_message_on(:sprint, :title) %>
+ </td>
+ </tr>
+
+ <tr>
+ <td class="label-required">Change status to</td>
+ <td class="value"><%= "#{@status_text}" %></td>
+ </tr>
+
+ <tr>
+ <td class="buttons" colspan="2">
+ <%= submit_tag "Save" %>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+
+ </fieldset>
+
+<% end %>
diff --git a/config/routes.rb b/config/routes.rb
index 503e7e8..f37405b 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -20,7 +20,14 @@ ActionController::Routing::Routes.draw do |map|
map.resources :products do |product|
product.resources :roles
product.resources :stories
- product.resources(:sprints, :member => {:plan => :get, :populate => :post, :roles => :get}) do |sprint|
+ product.resources(:sprints, :member =>
+ {
+ :plan => :get,
+ :populate => :post,
+ :roles => :get,
+ :status => :put
+ }
+ ) do |sprint|
sprint.resources :items, :member =>
{
:accept => :get,
diff --git a/public/images/icons/sprint_cancel.png b/public/images/icons/sprint_cancel.png
new file mode 100644
index 0000000000000000000000000000000000000000..0cfd585963d255190b8855a7689e8da1c4d7cf6b
GIT binary patch
literal 700
zcmV;t0z>_YP)<h;3K|Lk000e1NJLTq000mG000mO1^@s6AM^iV00004XF*Lt006JZ
zHwB960000PbVXQnQ*UN;cVTj606}DLVr3vnZDD6+Qe|Oed2z{QJOBU!PDw;TR5;6}
zl08pUK@^6c-MfIG7zy&ZdO=W0RM5go6AL;JW9dJzHAaJtjTV}aNP&t#jK9E25`KYJ
z7-190qI|g^MC3yjcJIA2b7#h4m*qn(j3+rcCzCnP`_AM<thM}4#10;;z8Sh6DK2^%
ziAG(kwZIsx(Ir;M1)a$}vRV(<KX@qr2v`|>*?Fk0YVb%?UEFajs1S?+YtYiPrjx0+
z+4<Bxpm%2`vh#$MS1&q>YbyJXwz!SX#yqTlhtNQ%Ku9=RNm$j)&+(}lZ!UGGp|@|O
z09YA#-dR#rIaGe;MBLe!ht*}!c?U}6YT!dfHDO%~>xtx&Klk-^WB==sC_vP4ddg4L
z#GN10u$+QGf$!(i3&8VpF6O6+ef~&gQ#>AVqCJH_utvKMAuOeG%3%mn<<%9)yb~#4
zHc70e5sYyQ03$?zFUko7D1Bg1=6jXvg#bUm1b(pVKuC*}koEKGdj<=zd<p?lVuY}}
z02!2`6>M#RWsl+kfRf;OU^G_BQh+Fc$z&F_AHuQYu(b)<Z0@4xK{j7~54O@!dlDrz
zdV71Z08s1e-K%5C<<PwV6}7OL&Ox&ILC?pe)0lb}|Ke4?jgBveYir&67HRs{%^PJ6
zZeR7KbB#q~?_p*Ntij5VPzbEsjJkY{l@Ft{naPQ}ZHX_#`v3q_9qnD^r<(?<&!3GK
z8HH8~V@z(R46J^dAd^VkZ=0Nb_S-7&M6&%#ms585NhIdDHVlQ)nus+e+V>aq=H_Fx
idDl8IBmWBc*Z2i=4uSP&;Q8VJ0000<MNUMnLSTZ|>p<iH
literal 0
HcmV?d00001
diff --git a/public/images/icons/sprint_complete.png b/public/images/icons/sprint_complete.png
new file mode 100644
index 0000000000000000000000000000000000000000..0156c266e4e1fbcd1263fab2c2dd1f3712553d14
GIT binary patch
literal 623
zcmV-#0+9WQP)<h;3K|Lk000e1NJLTq000mG000mO1^@s6AM^iV00004XF*Lt006JZ
zHwB960000PbVXQnQ*UN;cVTj606}DLVr3vnZDD6+Qe|Oed2z{QJOBU!0ZBwbR5;6}
zlif?xQ5eU)^D^-Kemg@D!Y+!S3;%@vf@v>Wtv3@TMo36t?!us(ut2(qE`#u;Y2=pT
zq@2~2T~yXyeA(Qqy5;+9o4@n>4e8r+MnSPzjxHXahjaKm&-eRqP6dF9|A~@^;+?rt
z=H0jE_T4vTwd@82LFU{PN7lpd$oktP$3Gho==lu{2>(S8IKK0m@1<YyO?kI9VLH0$
zHr14Dke%Y+Gaio2BoF0Nk03)2cS29x1A#6Au`zB!kph~=3A`n1nuh$>#{_mk%-f(Z
z+<+0WLyL4{ZOnvyEl7}LBImWjh~I^nZG{LlL-;RKT!Im`W9MTdQZ5xqr;6nfwX(<p
z$xIhy(^L_-S^zcQd1&6Vq~;oO!43iyXORN(=9b<vGZ&Cg_Cn0HK`v19og?@Rv@aG?
zWF;H7vGLx5_;UrZVWp}_!Rn~`Fzde#J=jj5gijY>&09}<xQX>?3!+0xOT@w2!VY%$
zj|Qoisx?Xewm&q%SbjiFY^0(I!gmV#q77T0t|0EJMfe#*$tA9gs83{GdZFA;x{o96
zB^%K$7%@AxKer&}ti|FWs}2pYzTg0Ry6;OQZ&K!w#ON`Q%*5Js144tWhd>1Tnd7f7
zk-!t=?~tr%T0tsJ(--<#x2)&;s)i5r7k+}jpgM|^Wqqb{;s;8N-ZpQB0Ez$r002ov
JPDHLkV1fyHAhiGh
literal 0
HcmV?d00001
diff --git a/public/images/icons/sprint_start.png b/public/images/icons/sprint_start.png
new file mode 100644
index 0000000000000000000000000000000000000000..b88c8578956ceec4ff17f81995b8652f6aa2b58d
GIT binary patch
literal 670
zcmV;P0%84$P)<h;3K|Lk000e1NJLTq000mG000mO1^@s6AM^iV00004XF*Lt006JZ
zHwB960000PbVXQnQ*UN;cVTj606}DLVr3vnZDD6+Qe|Oed2z{QJOBU!FiAu~R5;6(
zlFdt$Q543Xd*AoIGtP{SV`!p;RDLwHXb}ZrB5nE)LV~1K+h`F41>rx?szq&Dw38OK
zY!^{rCAFy_2z8TV&4=Ube7+y|oYO*02OOyb5BD7I^ZdAQt`ZS+tMaFrb6^=AxbXHx
zH;=|4CCm%L{PZwSS3v3G^sH+#W3JcR_xs(&`Tqt8^J9}d0<R|rCcamAect<LKyh(u
z-Xya*?IZvI#_Kg=`Po5URsKAa5tggMd<86Lg=N(AWK)TBKRBv@gF2Kug0^2o*!0^%
zQV`;=!u&>vU#im5^f#04JL4qMaI^<NL$QE@B5bn&i7f;fXfpzdEhq|M!vJyELfEQR
zl!&1Cerm<b^q)*-kAa)3;BX6UEhM(!9Z5_OQgBj}2pXGc*Q>seoYDXwB>7;oyw=|M
z1!ayym?6XvqV3ae_f95{py8ukt2TxB^!VIzRRh4#rNu~y^X+P>L{SXo3_|Qqm>9wY
zz(9!5s#OBElpmj4DRyjO`0`RiEIkUg%7D)8y}}Ye3}prow;JG>UQOIs{kfZSJ9bYz
zskMPbH9)1H6FDf)1=ZKVfe+;jf`a(O{!9meiN~~d0iA$0qX=t0D6Ydx4#RO76h@#R
z9_k7Z;$fv6G>QeZ{Yu0n&xL4%!?l}UPj4!j&Vs@?dl=y8#_IQ`5I-5a_T$dJtJ_~5
z4&186>klZh{hfba<gb<&Ca&+F57N^8<m`vL#@n6$02)Sf{tFKxDF6Tf07*qoM6N<$
Eg88vBhX4Qo
literal 0
HcmV?d00001
diff --git a/public/images/icons/story_view.png b/public/images/icons/story_view.png
new file mode 100644
index 0000000000000000000000000000000000000000..3bc0bd32fceb21d70368f7842a00a53d6369ba48
GIT binary patch
literal 465
zcmV;?0WSWDP)<h;3K|Lk000e1NJLTq000mG000mO1^@s6AM^iV00004XF*Lt006JZ
zHwB960000PbVXQnQ*UN;cVTj606}DLVr3vnZDD6+Qe|Oed2z{QJOBUzV@X6oR5;6}
zlif?gU=+sv7bPi)=!3$7q?JQqQvwMoh(bhK+J{k6%rsgQVNn!z(HBXQkd^mAH(hwA
z^Yotc=4S08nh!j@F!ub;!`WU30603a!#SmnFKE?TaOVx=ZRYd~NSn_P*eHX4{Rzai
z68Mrum`pr?uyhCB_zlR(s~YAA5Xn~cSpFUUYax26696aMv1k4Q2q33l!H$M!&p1HZ
zs?dXQ!8A(HJcd!rMboIk$jLW=EvyAdm3{&e#VDQ4W|M-siV5fsA9Db1`>zJNu3H-P
zO&@UpeyZQXi7jKe-Hk?r-sue;aDce_XqkvXP+W#F_*ot`jB?BS93Uw71|U^ZjLH<w
zh;-sq3Vy5@0GB_@0Tc0CO9QIe)}UUmTN-qU84mEqu5JAXPM->`yP%FO7U<6!nLCG}
z$SDlW<k^-FX;JQ=20hXqbO&;*_AZ;O0?VLP0(5*EI|Y0J3Jfj)lKW#`00000NkvXX
Hu0mjf{J_IH
literal 0
HcmV?d00001
diff --git a/test/functional/sprints_controller_test.rb b/test/functional/sprints_controller_test.rb
index 3bb0eda..836f093 100644
--- a/test/functional/sprints_controller_test.rb
+++ b/test/functional/sprints_controller_test.rb
@@ -474,4 +474,71 @@ class SprintsControllerTest < ActionController::TestCase
assert BacklogItem.find_by_sprint_id_and_user_story_id(@pending_sprint.id,(a)user_story.id),
"Backlog item should have been created"
end
+
+ # Ensures that an anonymous user can't change a sprint's status.
+ def test_status_as_anonymous
+ put :status
+
+ assert_redirected_to login_path
+ end
+
+ # Ensures that a valid product is required.
+ def test_status_with_invalid_product
+ put :status, {}, {:user_id => @owner.id}
+
+ assert_redirected_to products_url
+ end
+
+ # Ensures that a valid sprint is required.
+ def test_status_with_invalid_sprint
+ put :status, {:product_id => @product.id}, {:user_id => @owner.id}
+
+ assert_redirected_to product_sprints_path(@product)
+ end
+
+ # Ensures that non-product owners can't alter a sprint's status.
+ def test_status_as_nonowner
+ put :status,
+ {:product_id => @product.id, :id => @active_sprint.id},
+ {:user_id => @nonowner.id}
+
+ assert_redirected_to product_sprint_path(@product, @active_sprint)
+ end
+
+ # Ensures that a status must be presented.
+ def test_status_without_state
+ put :status,
+ {:product_id => @product.id, :id => @active_sprint.id},
+ {:user_id => @owner.id}
+
+ assert_redirected_to product_sprint_path(@product, @active_sprint)
+ end
+
+ # Ensures that if a status is not allowed then the sprint's not updated.
+ def test_status_with_disallowed_status
+ put :status,
+ {:product_id => @product.id, :id => @active_sprint.id, :status => Sprint::STATUS_PLANNED},
+ {:user_id => @owner.id}
+
+ assert_redirected_to product_sprint_path(@product, @active_sprint)
+ assert_equal @active_sprint.status, Sprint.find_by_id((a)active_sprint.id).status,
+ "Sprint status should not have been updated."
+ end
+
+ # Ensures that a status can be updated as allowed.
+ def test_status
+ put :status,
+ {:product_id => @product.id, :id => @active_sprint.id, :status => Sprint::STATUS_CLOSED},
+ {:user_id => @owner.id}
+
+ assert_redirected_to product_sprint_path(@product, @active_sprint)
+ result = Sprint.find_by_id((a)active_sprint.id)
+ assert result.closed?, "Sprint status was not updated."
+ # ensure all backlog items were closed
+ result.backlog_items.each do |item|
+ if item.completed?
+ assert item.user_story.closed?, "User story should have been closed."
+ end
+ end
+ end
end
--
1.6.0.4
15 years, 4 months
Fwd: git-refresh utility
by Darryl L. Pierce
This is a script I use for work and wanted to share. If you put this
script into your path, then you can use the command:
git refresh
to checkout "master", refresh it from origin, then checkout your
working branch again.
You can specify an alternate to "master" using the -r argument and
supplying a different branch name (such as "next" or "devel"). And you
can also name a set of directories to be processed, otherwise the
script processes the current directory only.
For myself, I use the command:
git refresh -r next `ls -b`
from the parent directory for oVirt to refresh everything.
If you have any mods or updates, send them over. :)
--
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
15 years, 4 months
Changing a sprint's status, affects bug #71...
by Darryl L. Pierce
I was thinking about this over the weekend and think we're going at
the sprint status the wrong way.
Rather than letting the product owner change the status by posting an
update to the sprint is kind of clumsy. We shouldn't have to mix into
an update like that business logic for deciding whether the state is
good as well. Instead we should have a separate method for changing to
each of those states instead, and in those methods confirm that the
state is allowed.
So, I'm working on a patch now for marking user stories closed when as
print is completed. After reviewing that, Ben, can you rework your
patch to work with that?
--
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
15 years, 4 months
[PATCH] If a sprint is active and has no tasks against it, then it can be moved back to the planned state. #71
by LAN-SUN-LUK Benjamin
Signed-off-by: Benjamin LAN-SUN-LUK <benjamin.lan-sun-luk(a)supinfo.com>
---
app/controllers/sprints_controller.rb | 22 ++++++++++++++--------
app/models/sprint.rb | 10 ++++++++++
app/views/sprints/show.html.erb | 2 +-
3 files changed, 25 insertions(+), 9 deletions(-)
diff --git a/app/controllers/sprints_controller.rb
b/app/controllers/sprints_controller.rb
index 09ebe5b..f8f5881 100644
--- a/app/controllers/sprints_controller.rb
+++ b/app/controllers/sprints_controller.rb
@@ -87,15 +87,21 @@ class SprintsController < ApplicationController
def update
respond_to do |format|
if @sprint.can_edit?(@user)
- @sprint.update_attributes(params[:sprint])
-
- if @sprint.save
- flash[:message] = "Sprint updated successfully."
- format.html { redirect_to params[:url] ? params[:url] :
product_sprints_path(@product) }
+ unless @sprint.allowed_status?(params[:sprint][:status] ||
@sprint.status)
+ flash[:error] = "You cannot change the status because you got
tasks against the sprint"
+ format.html { redirect_to :action => :show }
else
- @title = "Sprint #{(a)sprint.id} (Edit)"
- @sprint.valid?
- format.html { render :action => :edit }
+
+ @sprint.update_attributes(params[:sprint])
+
+ if @sprint.save
+ flash[:message] = "Sprint updated successfully."
+ format.html { redirect_to params[:url] ? params[:url] :
product_sprints_path(@product) }
+ else
+ @title = "Sprint #{(a)sprint.id} (Edit)"
+ @sprint.valid?
+ format.html { render :action => :edit }
+ end
end
else
flash[:error] = "You are now allowed to edit sprints for
#{(a)product.name}."
diff --git a/app/models/sprint.rb b/app/models/sprint.rb
index 2638613..da092ee 100644
--- a/app/models/sprint.rb
+++ b/app/models/sprint.rb
@@ -171,4 +171,14 @@ class Sprint < ActiveRecord::Base
return false
end
+
+ # Check if the sprint is active and have tasks againsts him.
+ def has_activity?
+ status == STATUS_ACTIVE && !actual_hours.zero?
+ end
+
+ # Check if the sprint can move to this new status
+ def allowed_status?(new_status)
+ !(has_activity? && new_status.to_i == STATUS_PLANNED)
+ end
end
diff --git a/app/views/sprints/show.html.erb
b/app/views/sprints/show.html.erb
index 0b826c6..56e255e 100644
--- a/app/views/sprints/show.html.erb
+++ b/app/views/sprints/show.html.erb
@@ -49,7 +49,7 @@
<% form_for(:sprint, @sprint, :url =>
product_sprint_path(@product, @sprint),
:html => {:method => :put}) do |form| %>
<%= hidden_field_tag :url, product_sprint_url(@product,
@sprint) %>
- <%= select :sprint, :status, Sprint::STATUS_TEXT %>
+ <%= select :sprint, :status, Sprint::STATUS_TEXT -
@sprint.has_activity? ? [Sprint::STATUS_TEXT[Sprint::STATUS_PLANNED]] : []
%>
<%= submit_tag "Apply" %>
<% end %>
<% else %>
--
1.6.0.2
15 years, 4 months
[PATCH] Removed the links from the id column to make viewing items more consistent.
by Darryl L. Pierce
Signed-off-by: Darryl L. Pierce <mcpierce(a)gmail.com>
---
app/models/product_role.rb | 5 +++++
app/views/items/_list.html.erb | 17 +++++++----------
app/views/products/_list.html.erb | 2 +-
app/views/projects/index.html.erb | 2 +-
app/views/roles/_list.html.erb | 11 ++++++-----
app/views/sprints/_list.html.erb | 2 +-
app/views/stories/_list.html.erb | 2 +-
app/views/tasks/_list.html.erb | 2 +-
app/views/users/_list.html.erb | 2 +-
9 files changed, 24 insertions(+), 21 deletions(-)
diff --git a/app/models/product_role.rb b/app/models/product_role.rb
index 69e1e68..77104e7 100644
--- a/app/models/product_role.rb
+++ b/app/models/product_role.rb
@@ -49,4 +49,9 @@ class ProductRole < ActiveRecord::Base
def active?
!self.pending && self.approved
end
+
+ # Returns whether the user can delete this role.
+ def can_delete?(user)
+ user && user.id == product.owner_id
+ end
end
diff --git a/app/views/items/_list.html.erb b/app/views/items/_list.html.erb
index d9ec7ea..41fd9f2 100644
--- a/app/views/items/_list.html.erb
+++ b/app/views/items/_list.html.erb
@@ -1,7 +1,6 @@
<table class="list">
<colgroup>
<col class="row_id" />
- <col class="number" />
<col class="description" />
<% unless @this_user %>
@@ -19,11 +18,10 @@
<thead>
<tr>
- <th class="title" colspan="<%= 8 - (@sprint ? 1 : 0) - (@this_user ? 1 : 0) %>">Backlog Items</th>
+ <th class="title" colspan="<%= 7 - (@sprint ? 1 : 0) - (@this_user ? 1 : 0) %>">Backlog Items</th>
</tr>
<tr>
<th>#</th>
- <th>US#</th>
<th>Title</th>
<% unless @this_user %>
@@ -43,7 +41,7 @@
<tbody>
<% if @backlog_items.empty? %>
<tr>
- <td colspan="<%= @sprint ? 7 : 8 %>">No backlog items found...</td>
+ <td colspan="<%= @sprint ? 6 : 7 %>">No backlog items found...</td>
</tr>
<% else %>
<% @backlog_items.each_with_index do |item, index| %>
@@ -52,12 +50,7 @@
<% product = sprint.product %>
<tr class="<%= row_class %>">
- <td>
- <%= link_to "#{item.id}",
- product_sprint_item_path(product, sprint, item) %>
- </td>
- <td><%= link_to "#{item.user_story.id}",
- product_story_path(item.user_story.product, item.user_story) %></td>
+ <td><%= "#{item.id}" %></td>
<td><%= "#{item.user_story.title}" %></td>
<% unless @this_user %>
@@ -76,6 +69,10 @@
<td><%= item.state_text %></td>
<td><%= show_hours_as_ear(item) %>
<td>
+ <%= link_to(image_tag("icons/view.png", :title => "View this item..."),
+ product_sprint_item_path(product, sprint, item)) %>
+ <%= link_to(image_tag("icons/story_view.png", :title => "View the user story..."),
+ product_story_path(product, item.user_story)) %>
<%= link_to(image_tag("icons/item_accept.png"),
accept_product_sprint_item_path(product, sprint, item,
:source => request.request_uri)) if item.can_accept?(@user) %>
diff --git a/app/views/products/_list.html.erb b/app/views/products/_list.html.erb
index a7e181d..a71f794 100644
--- a/app/views/products/_list.html.erb
+++ b/app/views/products/_list.html.erb
@@ -44,7 +44,7 @@
<% @products.each_with_index do |product, index| %>
<% row_class = index%2 == 0 ? 'even' : 'odd' %>
<tr class="<%= row_class %>">
- <td><%= link_to "#{product.id}", product_path(product) %></td>
+ <td><%= "#{product.id}" %></td>
<% if @project == nil %>
<td>
diff --git a/app/views/projects/index.html.erb b/app/views/projects/index.html.erb
index d091f66..36d2405 100644
--- a/app/views/projects/index.html.erb
+++ b/app/views/projects/index.html.erb
@@ -37,7 +37,7 @@
<% row_class = i%2 == 0 ? 'even' : 'odd' %>
<tr class="<%= row_class %>">
- <td class="row_id"><%= link_to "#{project.id}", project_path(project) %></td>
+ <td class="row_id"><%= "#{project.id}" %></td>
<td><%= project.name %></td>
<td><%= get_first_sentence project.description %></td>
<td><%= link_to project.owner.display_name, user_path(project.owner) %></td>
diff --git a/app/views/roles/_list.html.erb b/app/views/roles/_list.html.erb
index d94e1c3..f4295c5 100644
--- a/app/views/roles/_list.html.erb
+++ b/app/views/roles/_list.html.erb
@@ -46,7 +46,7 @@
<% @product_roles.each_with_index do |role, index| %>
<% row_class = index%2 == 0 ? 'even' : 'odd' %>
<tr class="<%= row_class %>">
- <td><%= link_to "#{role.id}", product_role_path(role.product, role) %>
+ <td><%= "#{role.id}" %>
<% unless @this_user %>
<td><%= link_to role.user.display_name,roles_user_path(role.user) %></td>
@@ -60,6 +60,8 @@
<td><%= show_date role.created_at %></td>
<% if @product && @product.can_approve_roles?(@user) %>
<td>
+ <%= link_to(image_tag("icons/view.png", :title => "View this role..."),
+ product_role_path(role.product, role)) %>
<% if role.pending %>
<% form_for(:product_role, role, :url => product_role_path(role.product,role),
:html => {:method => :put}) do |form| %>
@@ -68,10 +70,9 @@
<%= submit_tag "Update" %>
<% end %>
<% else %>
- <% form_for(:product_role, role, :url => product_role_path(role.product,role),
- :html => {:method => :delete}) do |form| %>
- <%= submit_tag "Delete", :confirm => "Are you sure?" %>
- <% end %>
+ <%= link_to(image_tag("icons/delete.png", :title => "Delete this role..."),
+ product_role_path(role.product, role), :method => :delete,
+ :confirm => "Delete? Are you sure?") if role.can_delete?(@user) %>
<% end %>
<% end %>
</td>
diff --git a/app/views/sprints/_list.html.erb b/app/views/sprints/_list.html.erb
index a66ad21..d89a613 100644
--- a/app/views/sprints/_list.html.erb
+++ b/app/views/sprints/_list.html.erb
@@ -32,7 +32,7 @@
<% @sprints.each_with_index do |sprint, index| %>
<% row_class = index%2 == 0 ? 'even' : 'odd' %>
<tr class="<%= row_class %>">
- <td><%= link_to "#{sprint.id}", product_sprint_path(@product, sprint) %></td>
+ <td><%= "#{sprint.id}" %></td>
<td><%= sprint.title %></td>
<td><%= sprint.status_text %></td>
<td><%= show_date(sprint.start) %></td>
diff --git a/app/views/stories/_list.html.erb b/app/views/stories/_list.html.erb
index 964c892..09edc9f 100644
--- a/app/views/stories/_list.html.erb
+++ b/app/views/stories/_list.html.erb
@@ -28,7 +28,7 @@
<% row_class = index%2 == 0 ? 'even' : 'odd' %>
<tr class="<%= row_class %>">
- <td><%= link_to "#{story.id}", product_story_path(story.product, story) %></td>
+ <td><%= "#{story.id}" %></td>
<td><%= story.priority %></td>
<td><%= story.title %></td>
<td>
diff --git a/app/views/tasks/_list.html.erb b/app/views/tasks/_list.html.erb
index 31f5a8c..17829cc 100644
--- a/app/views/tasks/_list.html.erb
+++ b/app/views/tasks/_list.html.erb
@@ -28,7 +28,7 @@
<% @tasks.each_with_index do |task, index| %>
<% row_class = index%2 == 0 ? 'even' : 'odd' %>
<tr class="<%= row_class %>">
- <td><%= link_to "#{task.id}", user_task_path(task.primary, task) %></td>
+ <td><%= "#{task.id}" %></td>
<td><%= show_date(task.when_entered) %></td>
<td><%= simple_format task.description %></td>
<td><%= link_to(task.primary.display_name, user_path(task.primary)) if task.primary %></td>
diff --git a/app/views/users/_list.html.erb b/app/views/users/_list.html.erb
index d4bb89f..8c0382c 100644
--- a/app/views/users/_list.html.erb
+++ b/app/views/users/_list.html.erb
@@ -28,7 +28,7 @@
<% row_class = index%2 == 0 ? 'even' : 'odd' %>
<tr class="<%= row_class %>">
- <td><%= link_to "#{user.id}", user_path(user) %></td>
+ <td><%= "#{user.id}" %></td>
<td><%= user.display_name %></td>
<td><%= simple_format user.introduction %></td>
<td><%= mail_to user.email, user.display_name %></td>
--
1.6.0.2
15 years, 4 months
[PATCH] Set titles for all action icons.
by Darryl L. Pierce
Signed-off-by: Darryl L. Pierce <mcpierce(a)gmail.com>
---
app/views/items/_list.html.erb | 8 ++++----
app/views/items/show.html.erb | 12 ++++++------
app/views/products/_list.html.erb | 4 ++--
app/views/products/show.html.erb | 8 ++++----
app/views/projects/index.html.erb | 4 ++--
app/views/projects/show.html.erb | 6 +++---
app/views/sprints/_list.html.erb | 8 +++++---
app/views/sprints/show.html.erb | 8 ++++----
app/views/stories/_list.html.erb | 6 +++---
app/views/stories/show.html.erb | 4 ++--
app/views/tasks/_list.html.erb | 6 +++---
app/views/tasks/show.html.erb | 6 +++---
app/views/users/_list.html.erb | 4 ++--
app/views/users/show.html.erb | 6 +++---
14 files changed, 46 insertions(+), 44 deletions(-)
diff --git a/app/views/items/_list.html.erb b/app/views/items/_list.html.erb
index d9ec7ea..249f666 100644
--- a/app/views/items/_list.html.erb
+++ b/app/views/items/_list.html.erb
@@ -76,16 +76,16 @@
<td><%= item.state_text %></td>
<td><%= show_hours_as_ear(item) %>
<td>
- <%= link_to(image_tag("icons/item_accept.png"),
+ <%= link_to(image_tag("icons/item_accept.png", :title => "Accept this item..."),
accept_product_sprint_item_path(product, sprint, item,
:source => request.request_uri)) if item.can_accept?(@user) %>
- <%= link_to(image_tag("icons/item_drop.png"),
+ <%= link_to(image_tag("icons/item_drop.png", :title => "Drop this item..."),
drop_product_sprint_item_path(product, sprint,item,
:source => request.request_uri)) if item.can_drop?(@user) %>
- <%= link_to(image_tag("icons/item_complete.png"),
+ <%= link_to(image_tag("icons/item_complete.png", :title =>"Mark this item completed..."),
complete_product_sprint_item_path(product, sprint, item,
:source => request.request_uri)) if item.can_complete?(@user) %>
- <%= link_to(image_tag("icons/item_reopen.png"),
+ <%= link_to(image_tag("icons/item_reopen.png", :title => "Reopen this item..."),
reopen_product_sprint_item_path(product, sprint, item,
:source => request.request_uri)) if item.can_reopen?(@user) %>
</td>
diff --git a/app/views/items/show.html.erb b/app/views/items/show.html.erb
index 4c2b7d4..f7a05e3 100644
--- a/app/views/items/show.html.erb
+++ b/app/views/items/show.html.erb
@@ -8,20 +8,20 @@
<tbody>
<tr>
<td class="toolbar" colspan="2">
- <%= link_to(image_tag("icons/back.png", :alt => "Return to sprint..."),
+ <%= link_to(image_tag("icons/back.png", :title => "Back..."),
product_sprint_path(@product, @sprint)) %>
- <%= link_to(image_tag("icons/new.png", :alt => "Add task..."),
+ <%= link_to(image_tag("icons/new.png", :title => "Add task..."),
new_user_task_path(@user, :item => @backlog_item)) if @backlog_item.can_add_tasks?(@user) %>
- <%= link_to(image_tag("icons/item_accept.png"),
+ <%= link_to(image_tag("icons/item_accept.png", :title => "Accept this item..."),
accept_product_sprint_item_path(@product, @sprint, @backlog_item,
:url => request.request_uri)) if @backlog_item.can_accept?(@user) %>
- <%= link_to(image_tag("icons/item_drop.png"),
+ <%= link_to(image_tag("icons/item_drop.png", :title => "Drop this item..."),
drop_product_sprint_item_path(@product, @sprint,@backlog_item,
:url => request.request_uri)) if @backlog_item.can_drop?(@user) %>
- <%= link_to(image_tag("icons/item_complete.png"),
+ <%= link_to(image_tag("icons/item_complete.png", :title => "Mark this item completed..."),
complete_product_sprint_item_path(@product, @sprint, @backlog_item,
:url => request.request_uri)) if @backlog_item.can_complete?(@user) %>
- <%= link_to(image_tag("icons/item_reopen.png"),
+ <%= link_to(image_tag("icons/item_reopen.png", :title => "Reopen this item..."),
reopen_product_sprint_item_path(@product, @sprint, @backlog_item,
:url => request.request_uri)) if @backlog_item.can_reopen?(@user) %>
</td>
diff --git a/app/views/products/_list.html.erb b/app/views/products/_list.html.erb
index a7e181d..b4e9053 100644
--- a/app/views/products/_list.html.erb
+++ b/app/views/products/_list.html.erb
@@ -62,9 +62,9 @@
<td><%= link_to "#{product.sprints.size}", product_sprints_path(product) %></td>
<td><%= link_to "#{product.product_roles.size}", product_roles_path(product) %>
<td>
- <%= link_to(image_tag("icons/view.png", :alt => "View product..."),
+ <%= link_to(image_tag("icons/view.png", :title => "View this product..."),
product_path(product)) %>
- <%= link_to(image_tag("icons/edit.png", :alt => "Edit product..."),
+ <%= link_to(image_tag("icons/edit.png", :title => "Edit this product..."),
edit_product_path(product)) if product.can_edit?(@user) %>
</tr>
<% end %>
diff --git a/app/views/products/show.html.erb b/app/views/products/show.html.erb
index 1bfe486..46066f4 100644
--- a/app/views/products/show.html.erb
+++ b/app/views/products/show.html.erb
@@ -14,13 +14,13 @@
<tbody>
<tr>
<td class="toolbar" colspan="2">
- <%= link_to(image_tag("icons/product_join.png", :alt => "Join this product team..."),
+ <%= link_to(image_tag("icons/product_join.png", :title => "Join this product team..."),
new_product_role_path(@product)) unless @product.is_member?(@user) %>
- <%= link_to(image_tag("icons/edit.png", :alt => "Edit this product..."),
+ <%= link_to(image_tag("icons/edit.png", :title => "Edit this product..."),
edit_product_path(@product, :url => request.request_uri)) if @product.can_edit?(@user) %>
- <%= link_to(image_tag("icons/story_add.png", :alt => "Create a new user story..."),
+ <%= link_to(image_tag("icons/story_add.png", :title => "Create a new user story..."),
new_product_story_path(@product, :source => request.request_uri)) if @product.can_create_user_stories?(@user) %>
- <%= link_to(image_tag("icons/sprint_add.png", :alt => "Create a new sprint..."),
+ <%= link_to(image_tag("icons/sprint_add.png", :title => "Create a new sprint..."),
new_product_sprint_path(@product)) if @product.can_create_sprints?(@user) %>
</td>
</tr>
diff --git a/app/views/projects/index.html.erb b/app/views/projects/index.html.erb
index d091f66..be4a910 100644
--- a/app/views/projects/index.html.erb
+++ b/app/views/projects/index.html.erb
@@ -44,10 +44,10 @@
<td><%= show_date(project.created_at) %></td>
<td>
<%= link_to(
- image_tag("icons/view.png", :alt => "View"),
+ image_tag("icons/view.png", :title => "View this project..."),
project_path(project)) %>
<%= link_to(
- image_tag("icons/edit.png", :alt => "Edit"),
+ image_tag("icons/edit.png", :title => "Edit this project..."),
edit_project_path(project, :source => request.request_uri)) if project.can_edit?(@user)%>
</td>
</tr>
diff --git a/app/views/projects/show.html.erb b/app/views/projects/show.html.erb
index 0b7fffa..d402e71 100644
--- a/app/views/projects/show.html.erb
+++ b/app/views/projects/show.html.erb
@@ -8,11 +8,11 @@
<tbody>
<tr>
<td class="toolbar" colspan="2">
- <%= link_to(image_tag("icons/back.png", :alt => "Project list..."),
+ <%= link_to(image_tag("icons/back.png", :title => "Back..."),
projects_path) %>
- <%= link_to(image_tag("icons/edit.png", :alt => "Edit"),
+ <%= link_to(image_tag("icons/edit.png", :title => "Edit this project..."),
edit_project_path(@project)) if @project.can_edit?(@user) %>
- <%= link_to(image_tag("icons/new.png", :alt => "New product..."),
+ <%= link_to(image_tag("icons/new.png", :title => "Create a new product..."),
new_product_path(:project => @project)) if @project.can_create_products?(@user) %>
</td>
</tr>
diff --git a/app/views/sprints/_list.html.erb b/app/views/sprints/_list.html.erb
index a66ad21..e65fd9f 100644
--- a/app/views/sprints/_list.html.erb
+++ b/app/views/sprints/_list.html.erb
@@ -39,12 +39,14 @@
<td><%= "#{show_date(sprint.end_date)} (#{sprint.duration} days)" %></td>
<td><%= show_hours_as_ear(sprint) %></td>
<td>
- <%= link_to(image_tag("icons/view.png"), product_sprint_path(@product, sprint)) %>
+ <%= link_to(image_tag("icons/view.png", :title => "View this sprint..."),
+ product_sprint_path(@product, sprint)) %>
<% if sprint.can_edit?(@user) %>
<%= link_to(
- image_tag("icons/edit.png"), edit_product_sprint_path(@product, sprint)) %>
+ image_tag("icons/edit.png", :title => "Edit this sprint..."),
+ edit_product_sprint_path(@product, sprint)) %>
<% end %>
- <%= link_to(image_tag("icons/delete.png"),
+ <%= link_to(image_tag("icons/delete.png", :title => "Delete this sprint..."),
product_sprint_path(@product, sprint), :method => :delete,
:confirm => "Delete? Are you sure?") if sprint.can_delete?(@user) %>
</td>
diff --git a/app/views/sprints/show.html.erb b/app/views/sprints/show.html.erb
index 0b826c6..83ffbbc 100644
--- a/app/views/sprints/show.html.erb
+++ b/app/views/sprints/show.html.erb
@@ -9,19 +9,19 @@
<tr>
<td colspan="2" class="toolbar">
<%= link_to(
- image_tag("icons/back.png", :alt => "Return to sprint list..."),
+ image_tag("icons/back.png", :title => "Back..."),
product_sprints_path(@product)) %>
<% if @sprint.can_edit?(@user) %>
<%= link_to(
- image_tag("icons/edit.png", :alt => "Edit this sprint"),
+ image_tag("icons/edit.png", :title => "Edit this sprint"),
edit_product_sprint_path(@product, @sprint)) %>
<% end %>
<% if @sprint.can_populate?(@user) %>
<%= link_to(
- image_tag("icons/sprint_plan.png", :alt => "Plan this sprint"),
+ image_tag("icons/sprint_plan.png", :title => "Plan this sprint..."),
plan_product_sprint_path(@product, @sprint)) %>
<% end %>
- <%= link_to(image_tag("icons/delete.png", :alt => "Delete this sprint"),
+ <%= link_to(image_tag("icons/delete.png", :title => "Delete this sprint..."),
product_sprint_path(@product, @sprint), :method => :delete,
:confirm => "Delete? Are you sure?") if @sprint.can_delete?(@user) %>
</td>
diff --git a/app/views/stories/_list.html.erb b/app/views/stories/_list.html.erb
index 964c892..fd2e9bb 100644
--- a/app/views/stories/_list.html.erb
+++ b/app/views/stories/_list.html.erb
@@ -32,12 +32,12 @@
<td><%= story.priority %></td>
<td><%= story.title %></td>
<td>
- <%= link_to(image_tag("icons/view.png", :alt => "View"),
+ <%= link_to(image_tag("icons/view.png", :title => "View this user story..."),
product_story_path(story.product,story)) %>
- <%= link_to(image_tag("icons/edit.png", :alt => "Edit"),
+ <%= link_to(image_tag("icons/edit.png", :title => "Edit this user story..."),
edit_product_story_path(story.product,story,
:source => request.request_uri)) if story.can_edit?(@user) %>
- <%= link_to(image_tag("icons/delete.png", :alt => "Delete"),
+ <%= link_to(image_tag("icons/delete.png", :title => "Delete this user story..."),
product_story_path(story.product, story,
:source => request.request_uri), :method => :delete,
:confirm => "Delete? Are you sure?") if story.can_delete?(@user) %>
diff --git a/app/views/stories/show.html.erb b/app/views/stories/show.html.erb
index e17c0c1..f0d4aea 100644
--- a/app/views/stories/show.html.erb
+++ b/app/views/stories/show.html.erb
@@ -9,9 +9,9 @@
<tr>
<td class="toolbar" colspan="2">
- <%= link_to(image_tag("icons/back.png", :alt => "Return to the list..."),
+ <%= link_to(image_tag("icons/back.png", :title => "Back..."),
product_stories_path(@product)) %>
- <%= link_to(image_tag("icons/edit.png", :alt => "Edit"),
+ <%= link_to(image_tag("icons/edit.png", :title => "Edit this user story..."),
edit_product_story_path(@product, @user_story,
:url => request.request_uri)) if @user_story.can_edit?(@user) %>
</td>
diff --git a/app/views/tasks/_list.html.erb b/app/views/tasks/_list.html.erb
index 31f5a8c..b725b0d 100644
--- a/app/views/tasks/_list.html.erb
+++ b/app/views/tasks/_list.html.erb
@@ -35,11 +35,11 @@
<td><%= link_to(task.backup, user_path(task.backup)) if task.backup %></td>
<td><%= format "%0.2f", task.hours %>
<td>
- <%= link_to(image_tag("icons/view.png", :alt => "View task..."),
+ <%= link_to(image_tag("icons/view.png", :title => "View this task..."),
user_task_path(task.primary, task)) %>
- <%= link_to(image_tag("icons/edit.png", :atl => "Edit task..."),
+ <%= link_to(image_tag("icons/edit.png", :title => "Edit this task..."),
edit_user_task_path(task.primary, task)) if task.can_edit?(@user) %>
- <%= link_to(image_tag("icons/delete.png", :alt => "Delete task..."),
+ <%= link_to(image_tag("icons/delete.png", :title => "Delete this task..."),
user_task_path(task.primary, task), :confirm => "Are you sure?",
:method => :delete) if task.can_delete?(@user) %>
</td>
diff --git a/app/views/tasks/show.html.erb b/app/views/tasks/show.html.erb
index 89b003f..0657f7b 100644
--- a/app/views/tasks/show.html.erb
+++ b/app/views/tasks/show.html.erb
@@ -8,11 +8,11 @@
<tbody>
<tr>
<td class="toolbar" colspan="2">
- <%= link_to(image_tag("icons/back.png", :alt => "Back..."),
+ <%= link_to(image_tag("icons/back.png", :title => "Back..."),
user_tasks_path((a)task.primary)) %>
- <%= link_to(image_tag("icons/edit.png", :alt => "Edit..."),
+ <%= link_to(image_tag("icons/edit.png", :title => "Edit this task..."),
edit_user_task_path((a)task.primary, @task)) if @task.can_edit?(@user) %>
- <%= link_to(image_tag("icons/delete.png", :alt => "Delete..."),
+ <%= link_to(image_tag("icons/delete.png", :title => "Delete this task..."),
user_task_path((a)task.primary, @task, :confirm => "Delete? Are you sure?",
:html => {:method => :delete})) if @task.can_delete?(@user) %>
</td>
diff --git a/app/views/users/_list.html.erb b/app/views/users/_list.html.erb
index d4bb89f..696fc54 100644
--- a/app/views/users/_list.html.erb
+++ b/app/views/users/_list.html.erb
@@ -36,8 +36,8 @@
<td><%= link_to "#{user.product_roles.size} roles", roles_user_path(user) %></td>
<td><%= show_date(user.created_at) %></td>
<td>
- <%= link_to(image_tag("icons/view.png", :alt => "View user..."), user_path(user)) %>
- <%= link_to(image_tag("icons/edit.png", :alt => "Edit"),
+ <%= link_to(image_tag("icons/view.png", :title => "View this user..."), user_path(user)) %>
+ <%= link_to(image_tag("icons/edit.png", :title => "Edit this user..."),
edit_user_path(user)) if user.can_edit?(@user) %>
</td>
</tr>
diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb
index ab1cde5..a2a772f 100644
--- a/app/views/users/show.html.erb
+++ b/app/views/users/show.html.erb
@@ -8,10 +8,10 @@
<tbody>
<tr>
<td class="toolbar" colspan="2">
- <%= link_to(image_tag("icons/back.png", :alt => "Back to users list..."), users_path) %>
- <%= link_to(image_tag("icons/edit.png", :alt => "Edit"),
+ <%= link_to(image_tag("icons/back.png", :title => "Back..."), users_path) %>
+ <%= link_to(image_tag("icons/edit.png", :title => "Edit this user..."),
edit_user_path(@this_user)) if @this_user.can_edit?(@user) %>
- <%= link_to(image_tag("icons/password.png", :alt => "Change password"),
+ <%= link_to(image_tag("icons/password.png", :title => "Change the account password..."),
password_user_path(@this_user)) if @this_user.can_edit?(@user) %>
</td>
</tr>
--
1.6.0.2
15 years, 4 months
[PATCH] If a sprint is active and has no tasks against it, then it can be moved back to the planned state. #71
by LAN-SUN-LUK Benjamin
Signed-off-by: Benjamin LAN-SUN-LUK <benjamin.lan-sun-luk(a)supinfo.com>
---
app/controllers/sprints_controller.rb | 22 ++++++++++++++--------
app/models/sprint.rb | 10 ++++++++++
app/views/sprints/show.html.erb | 2 +-
test/functional/sprints_controller_test.rb | 14 ++++++++++++++
4 files changed, 39 insertions(+), 9 deletions(-)
diff --git a/app/controllers/sprints_controller.rb
b/app/controllers/sprints_controller.rb
index 09ebe5b..a0b318f 100644
--- a/app/controllers/sprints_controller.rb
+++ b/app/controllers/sprints_controller.rb
@@ -87,15 +87,21 @@ class SprintsController < ApplicationController
def update
respond_to do |format|
if @sprint.can_edit?(@user)
- @sprint.update_attributes(params[:sprint])
-
- if @sprint.save
- flash[:message] = "Sprint updated successfully."
- format.html { redirect_to params[:url] ? params[:url] :
product_sprints_path(@product) }
+ unless @sprint.allowed_status?(params[:sprint][:status] ||
@sprint.status)
+ flash[:error] = "Sprints with work history cannot be moved to the
planned state."
+ format.html { redirect_to :action => :show }
else
- @title = "Sprint #{(a)sprint.id} (Edit)"
- @sprint.valid?
- format.html { render :action => :edit }
+
+ @sprint.update_attributes(params[:sprint])
+
+ if @sprint.save
+ flash[:message] = "Sprint updated successfully."
+ format.html { redirect_to params[:url] ? params[:url] :
product_sprints_path(@product) }
+ else
+ @title = "Sprint #{(a)sprint.id} (Edit)"
+ @sprint.valid?
+ format.html { render :action => :edit }
+ end
end
else
flash[:error] = "You are now allowed to edit sprints for
#{(a)product.name}."
diff --git a/app/models/sprint.rb b/app/models/sprint.rb
index 2638613..da092ee 100644
--- a/app/models/sprint.rb
+++ b/app/models/sprint.rb
@@ -171,4 +171,14 @@ class Sprint < ActiveRecord::Base
return false
end
+
+ # Check if the sprint is active and have tasks againsts him.
+ def has_activity?
+ status == STATUS_ACTIVE && !actual_hours.zero?
+ end
+
+ # Check if the sprint can move to this new status
+ def allowed_status?(new_status)
+ !(has_activity? && new_status.to_i == STATUS_PLANNED)
+ end
end
diff --git a/app/views/sprints/show.html.erb
b/app/views/sprints/show.html.erb
index 0b826c6..5b60810 100644
--- a/app/views/sprints/show.html.erb
+++ b/app/views/sprints/show.html.erb
@@ -49,7 +49,7 @@
<% form_for(:sprint, @sprint, :url =>
product_sprint_path(@product, @sprint),
:html => {:method => :put}) do |form| %>
<%= hidden_field_tag :url, product_sprint_url(@product,
@sprint) %>
- <%= select :sprint, :status, Sprint::STATUS_TEXT %>
+ <%= select :sprint, :status, Sprint::STATUS_TEXT -
(@sprint.has_activity? ? [Sprint::STATUS_TEXT[Sprint::STATUS_PLANNED]] : [])
%>
<%= submit_tag "Apply" %>
<% end %>
<% else %>
diff --git a/test/functional/sprints_controller_test.rb
b/test/functional/sprints_controller_test.rb
index 3bb0eda..bd61c0e 100644
--- a/test/functional/sprints_controller_test.rb
+++ b/test/functional/sprints_controller_test.rb
@@ -298,6 +298,20 @@ class SprintsControllerTest <
ActionController::TestCase
"Sprint should have been updated."
end
+ # Ensures that can't updating a sprint with the active status to the
planned status if sprint got work history.
+ def test_update_with_unallowed_status
+ sprint = {:title => "Do it!", :status => Sprint::STATUS_ACTIVE}
+ put :update,
+ {:product_id => @product.id, :id => @active_sprint.id,
+ :sprint => sprint},
+ {:user_id => @owner.id, :status => Sprint::STATUS_PLANNED}
+
+ assert_redirected_to product_sprints_path(@product)
+ result = Sprint.find_by_id((a)active_sprint.id)
+ assert_equal Sprint::STATUS_ACTIVE, result.status,
+ "Sprint should have not been updated."
+ end
+
# Ensures anonymous users can't delete sprins.
def test_delete_as_anonymous
delete :destroy
--
1.6.0.2
15 years, 4 months
[PATCH] User verification expiration thread is killed on startup. #66
by LAN-SUN-LUK Benjamin
Signed-off-by: Benjamin LAN-SUN-LUK <benjamin.lan-sun-luk(a)supinfo.com>
---
config/initializers/schedules.rb | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/config/initializers/schedules.rb
b/config/initializers/schedules.rb
index 83be588..1307193 100644
--- a/config/initializers/schedules.rb
+++ b/config/initializers/schedules.rb
@@ -183,8 +183,8 @@ threads["user verification expiration"] = Thread.new do
end
end
end
- scheduler.join
end
+ scheduler.join
end
# Run all threads
--
1.6.0.2
15 years, 4 months