Added correct breadcrumb trail to both the list and individual task
pages. Now if viewing for a backlog item, the trail leads back to the
project. If viewing for a user, then the patch goes back to the user.
Signed-off-by: Darryl L. Pierce <mcpierce(a)gmail.com>
---
app/controllers/tasks_controller.rb | 21 ++++++++++++++++++---
doc/ChangeLog | 1 +
2 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/app/controllers/tasks_controller.rb b/app/controllers/tasks_controller.rb
index 622f8d3..869689e 100644
--- a/app/controllers/tasks_controller.rb
+++ b/app/controllers/tasks_controller.rb
@@ -176,17 +176,32 @@ class TasksController < ApplicationController
end
def path_to_list
+ if @backlog_item
+ @sprint = Sprint.find_by_id(params[:sprint]) unless @sprint
+ @product = @sprint.product
+ @project = @product.project
+
+ add_breadcrumb "Projects", projects_path
+ add_breadcrumb "#{(a)project.id}", project_path(@project)
+ add_breadcrumb "Products", products_path(:project => @project.id)
+ add_breadcrumb "#{(a)product.id}", product_path(@product)
+ add_breadcrumb "Sprints", sprints_path(:product => @product)
+ add_breadcrumb "#{(a)sprint.id}", sprint_path(@sprint)
+ add_breadcrumb "Items", items_path(:sprint => @sprint)
+ add_breadcrumb "#{(a)backlog_item.id}", item_path(@backlog_item)
+ end
+
if @this_user
add_breadcrumb "Users", users_path
add_breadcrumb "#{(a)this_user.id}", user_path(@this_user)
- add_breadcrumb "Tasks", tasks_path(:user => @this_user)
- else
- add_breadcrumb "Tasks", tasks_path
end
+
+ add_breadcrumb "Tasks", tasks_path(:item => @backlog_item)
end
def path_to_one
path_to_list
+
add_breadcrumb "#{(a)task.id}", task_path(@task)
end
end
diff --git a/doc/ChangeLog b/doc/ChangeLog
index 5b69c79..471a238 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -57,6 +57,7 @@ Change Log (0.3.0):
* #228 - Fixed the URL in the product creation RSS entry. (BUG)
* #229 - Fixed when nil.name showed up when viewing sprints. (BUG)
* #230 - Sprint not started but no error message is shown. (BUG)
+ * #231 - Fix the breadcrumb trail for the task page. (BUG)
Change Log (0.2.0):
* #97 - Users can request new projects.
--
1.6.2.5
Show replies by date