The default layout iterates over a list of Breadcrumb objects. For each
one it puts the text or, if there's a url, a hyperlink.
Added new styling for the breadcrumb trail.
Signed-off-by: Darryl L. Pierce <mcpierce(a)gmail.com>
---
app/controllers/application.rb | 10 ++++
app/controllers/epics_controller.rb | 19 ++++++++-
app/controllers/items_controller.rb | 24 +++++++++-
app/controllers/products_controller.rb | 23 +++++++++-
app/controllers/projects_controller.rb | 16 ++++++-
app/controllers/report_controller.rb | 5 ++
app/controllers/roles_controller.rb | 18 +++++++-
app/controllers/sprints_controller.rb | 29 +++++++++++-
app/controllers/stories_controller.rb | 21 ++++++++-
app/controllers/tasks_controller.rb | 17 ++++++-
app/controllers/users_controller.rb | 26 ++++++++++-
app/models/breadcrumb.rb | 13 +++++
app/views/epics/index.html.erb | 3 -
app/views/epics/show.html.erb | 6 ---
app/views/items/_list.html.erb | 76 +++++++++++++++++---------------
app/views/items/index.html.erb | 16 +++---
app/views/layouts/default.html.erb | 14 ++++++
app/views/products/index.html.erb | 5 --
app/views/products/show.html.erb | 7 +--
app/views/roles/index.html.erb | 2 +-
app/views/sprints/index.html.erb | 3 -
app/views/sprints/members.html.erb | 9 +---
app/views/sprints/show.html.erb | 3 -
app/views/stories/index.html.erb | 3 -
app/views/stories/show.html.erb | 3 -
app/views/users/backlog.html.erb | 2 +-
public/stylesheets/navbar.css | 14 ++++++
27 files changed, 288 insertions(+), 99 deletions(-)
create mode 100644 app/models/breadcrumb.rb
diff --git a/app/controllers/application.rb b/app/controllers/application.rb
index 2c796f2..c07e5f9 100644
--- a/app/controllers/application.rb
+++ b/app/controllers/application.rb
@@ -25,6 +25,12 @@ class ApplicationController < ActionController::Base
helper :all # include all helpers, all the time
+ attr_accessor :breadcrumbs
+
+ def initialize
+ @breadcrumbs = Array.new
+ end
+
# See ActionController::RequestForgeryProtection for details Uncomment the
# :secret if you're not using the cookie session store
protect_from_forgery # :secret => '9c89a76e3c2615afe424b5811fe319f7'
@@ -53,6 +59,10 @@ class ApplicationController < ActionController::Base
@user_count = User.find(:all).size
end
+ def add_breadcrumb(text, url=nil)
+ @breadcrumbs << Breadcrumb.new(text, url)
+ end
+
private
def handle_exceptions
diff --git a/app/controllers/epics_controller.rb b/app/controllers/epics_controller.rb
index fa251db..4f8f2c2 100644
--- a/app/controllers/epics_controller.rb
+++ b/app/controllers/epics_controller.rb
@@ -18,7 +18,9 @@
class EpicsController < ApplicationController
before_filter :authenticated, :except => [:index, :show]
before_filter :load_project
- before_filter :load_epic, :except => [:index, :new, :create]
+ before_filter :load_epic, :except => [:index, :new, :create]
+ before_filter :path_to_list, :only => [:index, :new, :create]
+ before_filter :path_to_one, :only => [:show, :edit, :update]
# GET /projects/1/epics
def index
@@ -39,6 +41,7 @@ class EpicsController < ApplicationController
# GET /projects/1/epics/new
def new
+ add_breadcrumb "New"
if @project.can_create_epics?(@user)
@title = "Create new epic for #{(a)project.name}"
@epic = Epic.new(:project => @project)
@@ -50,6 +53,7 @@ class EpicsController < ApplicationController
# GET /projects/1/epics/1/edit
def edit
+ add_breadcrumb "Edit"
if @project.can_create_epics?(@user)
@title = "Edit epic for #{(a)project.name}"
else
@@ -60,6 +64,7 @@ class EpicsController < ApplicationController
# POST /projects/1/epics
def create
+ add_breadcrumb "New"
respond_to do |format|
if @project.can_create_epics?(@user)
Epic.transaction do
@@ -82,6 +87,7 @@ class EpicsController < ApplicationController
# PUT /projects/1/epics/1
def update
+ add_breadcrumb "Edit"
respond_to do |format|
if @epic.can_edit?(@user)
Epic.transaction do
@@ -184,4 +190,15 @@ class EpicsController < ApplicationController
end
end
end
+
+ def path_to_list
+ add_breadcrumb "Projects", projects_path
+ add_breadcrumb "#{(a)project.id}", project_path(@project)
+ add_breadcrumb "Epics", project_epics_path(@project)
+ end
+
+ def path_to_one
+ path_to_list
+ add_breadcrumb "#{(a)epic.id}", project_epic_path(@project, @epic)
+ end
end
diff --git a/app/controllers/items_controller.rb b/app/controllers/items_controller.rb
index ea54aee..587e783 100644
--- a/app/controllers/items_controller.rb
+++ b/app/controllers/items_controller.rb
@@ -17,12 +17,14 @@
# +ItemsController+ handles CRUD operations on instances of +BacklogItem+.
class ItemsController < ApplicationController
- before_filter :unsupported, :only => [:new, :edit, :create, :update]
- before_filter :authenticated, :except => [:index, :show]
+ before_filter :unsupported, :only => [:new, :edit, :create, :update]
+ before_filter :authenticated, :except => [:index, :show]
before_filter :load_product
before_filter :load_sprint
before_filter :load_backlog_item, :except => [:index]
- before_filter :load_hours, :only => [:estimate]
+ before_filter :load_hours, :only => [:estimate]
+ before_filter :path_to_list, :only => [:index]
+ before_filter :path_to_one, :only => [:show]
# GET /products/1/sprints/1/items
def index
@@ -195,6 +197,7 @@ class ItemsController < ApplicationController
def load_product
@product = Product.find_by_id(params[:product_id])
+ @project = @product.project if @product
unless @product
flash[:error] = "Missing or invalid product."
@@ -237,4 +240,19 @@ class ItemsController < ApplicationController
end
end
end
+
+ def path_to_list
+ 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", product_sprints_path(@product)
+ add_breadcrumb "#{(a)sprint.id}", product_sprint_path(@product, @sprint)
+ add_breadcrumb "Items", product_sprint_items_path(@product, @sprint)
+ end
+
+ def path_to_one
+ path_to_list
+ add_breadcrumb "#{(a)backlog_item.id}", product_sprint_item_path(@product,
@sprint, @backlog_item)
+ end
end
diff --git a/app/controllers/products_controller.rb
b/app/controllers/products_controller.rb
index 77ebfa2..964fb95 100644
--- a/app/controllers/products_controller.rb
+++ b/app/controllers/products_controller.rb
@@ -23,6 +23,8 @@ class ProductsController < ApplicationController
before_filter :load_project, :only => [:new, :create]
before_filter :is_approved, :only => [:new, :create]
before_filter :load_product, :only => [:show, :edit, :update, :join]
+ before_filter :path_to_one, :only => [:show, :edit, :update, :join]
+ before_filter :path_to_list, :only => [:index, :new, :create]
# GET /products
def index
@@ -61,6 +63,7 @@ class ProductsController < ApplicationController
# GET /products/new
def new
+ add_breadcrumb "New"
if @project.can_create_products?(@user)
@title = "New Product"
@product = Product.new(:project_id => @project.id, :owner_id => @user.id)
@@ -73,6 +76,7 @@ class ProductsController < ApplicationController
# GET /products/1/edit
def edit
+ add_breadcrumb "Edit"
if @product.can_edit?(@user)
@title = "#{(a)product.name} (Edit)"
@users = User.find(:all, :order => 'display_name ASC')
@@ -84,6 +88,7 @@ class ProductsController < ApplicationController
# PUT /products
def create
+ add_breadcrumb "New"
respond_to do |format|
if params[:product]
Product.transaction do
@@ -114,6 +119,7 @@ class ProductsController < ApplicationController
# PUT /products/1
def update
+ add_breadcrumb "Edit"
respond_to do |format|
if params[:product]
if @product.can_edit?(@user)
@@ -173,14 +179,29 @@ class ProductsController < ApplicationController
def load_product
@product = Product.find_by_id(params[:id])
+ @project = @product.project if @product
unless @product
respond_to do |format|
flash[:message] = 'Invalid product specified.'
format.html { redirect_to error_path }
end
+ end
+ end
+
+ def path_to_list
+ @project = Project.find_by_id(params[:project]) if params[:project]
+ if @project
+ add_breadcrumb "Projects", projects_path
+ add_breadcrumb "#{(a)project.id}", project_path(@project)
+ add_breadcrumb "Products", products_path(:project => @project.id)
else
- @project = @product.project
+ add_breadcrumb "Products", products_path
end
end
+
+ def path_to_one
+ path_to_list
+ add_breadcrumb "#{(a)product.id}", product_path(@product)
+ end
end
diff --git a/app/controllers/projects_controller.rb
b/app/controllers/projects_controller.rb
index 8219fe3..49f4f5b 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -24,6 +24,8 @@ class ProjectsController < ApplicationController
before_filter :filter_approved, :only => [:approve, :reject]
before_filter :can_approve, :only => [:approve, :reject]
before_filter :setup_for_edit, :only => [:new, :create, :edit, :update]
+ before_filter :path_to_list, :only => [:index, :new, :create]
+ before_filter :path_to_one, :only => [:show, :edit, :update]
# GET /projects
def index
@@ -33,7 +35,6 @@ class ProjectsController < ApplicationController
@projects = Project.approved(@show_all_projects).paginate(:page => params[:page],
:per_page => 10,
:order => @order)
-
respond_to do |format|
format.html
end
@@ -51,6 +52,7 @@ class ProjectsController < ApplicationController
# GET /projects/new
def new
+ add_breadcrumb("New")
if @user
@title = "New Project"
@project = Project.new(:owner_id => @user.id)
@@ -64,6 +66,7 @@ class ProjectsController < ApplicationController
# GET /projects/1/edit
def edit
+ add_breadcrumb("Edit")
@title = "#{(a)project.name} (Edit)"
@source = params[:source] if params[:source]
unless @project.can_edit?(@user)
@@ -74,6 +77,7 @@ class ProjectsController < ApplicationController
# POST /projects
def create
+ add_breadcrumb("New")
respond_to do |format|
@project = Project.new(params[:project])
# if the project is being created by an admin, then mark it approved
@@ -94,6 +98,7 @@ class ProjectsController < ApplicationController
# PUT /projects/1
def update
+ add_breadcrumb("Edit")
respond_to do |format|
if @project.can_edit?(@user)
@project.update_attributes(params[:project])
@@ -190,4 +195,13 @@ class ProjectsController < ApplicationController
end
end
end
+
+ def path_to_list
+ add_breadcrumb "Projects", projects_path
+ end
+
+ def path_to_one
+ path_to_list
+ add_breadcrumb "#{(a)project.id}", project_path(@project)
+ end
end
diff --git a/app/controllers/report_controller.rb b/app/controllers/report_controller.rb
index d7c1e01..c7077cf 100644
--- a/app/controllers/report_controller.rb
+++ b/app/controllers/report_controller.rb
@@ -33,6 +33,7 @@ class ReportController < ApplicationController
}.sort_by { |k,v| v }
def index
+ breadcrumbs
@title = "Reports"
@users = User.find(:all, :order => 'display_name ASC')
end
@@ -111,4 +112,8 @@ class ReportController < ApplicationController
@size = REPORT_SIZES[0][0] unless @size
end
+
+ def breadcrumbs
+ @breadcrumbs << Breadcrumb.new("Reports")
+ end
end
diff --git a/app/controllers/roles_controller.rb b/app/controllers/roles_controller.rb
index cb3ae82..04109d8 100644
--- a/app/controllers/roles_controller.rb
+++ b/app/controllers/roles_controller.rb
@@ -19,9 +19,11 @@
# owners to approve, deny or remove roles, and for listing current product
# members.
class RolesController < ApplicationController
- before_filter :authenticated, :except => [:index, :show]
+ before_filter :authenticated, :except => [:index, :show]
before_filter :load_product
before_filter :load_product_role, :only => [:show, :update, :destroy]
+ before_filter :path_to_list, :only => [:index, :new, :create]
+ before_filter :path_to_one, :only => [:show, :edit, :update]
# GET /products/1/roles
def index
@@ -147,6 +149,7 @@ class RolesController < ApplicationController
def load_product
@product = Product.find_by_id(params[:product_id])
+ @project = @product.project if @product
unless @product
flash[:error] = "Missing or invalid product id."
@@ -166,4 +169,17 @@ class RolesController < ApplicationController
end
end
end
+
+ def path_to_list
+ add_breadcrumb "Project", projects_path
+ add_breadcrumb "#{(a)project.id}", project_path(@project)
+ add_breadcrumb "Product", products_path(:project => @project.id)
+ add_breadcrumb "#{(a)product.id}", product_path(@product)
+ add_breadcrumb "Roles", product_roles_path(@product)
+ end
+
+ def path_to_one
+ path_to_list
+ add_breadcrumb "#{(a)product_role.id}", product_role_path(@product,
@product_role)
+ end
end
diff --git a/app/controllers/sprints_controller.rb
b/app/controllers/sprints_controller.rb
index 023dd43..e12ac43 100644
--- a/app/controllers/sprints_controller.rb
+++ b/app/controllers/sprints_controller.rb
@@ -17,11 +17,13 @@
# +SprintsController+ handles performing CRUD operations on instances of
# +Sprint+.
class SprintsController < ApplicationController
- before_filter :authenticated, :except => [:index, :show, :members]
+ before_filter :authenticated, :except => [:index, :show, :members]
before_filter :load_product
- before_filter :load_sprint, :except => [:index, :new, :create]
- before_filter :get_status, :only => [:status]
+ before_filter :load_sprint, :except => [:index, :new, :create]
+ before_filter :get_status, :only => [:status]
before_filter :prepare_for_edit, :only => [:new, :edit]
+ before_filter :path_to_list, :only => [:index, :new, :create]
+ before_filter :path_to_one, :only => [:show, :edit, :update, :status, :plan,
:populate, :members]
# GET /products/1/sprints
def index
@@ -50,6 +52,7 @@ class SprintsController < ApplicationController
# GET /products/1/sprints/new
def new
+ add_breadcrumb "New"
if @product.can_create_sprints?(@user)
@title = "New Sprint For #{(a)product.name}"
@sprint = Sprint.new(:product_id => @product.id)
@@ -62,11 +65,13 @@ class SprintsController < ApplicationController
# GET /products/1/sprints/1/edit
def edit
+ add_breadcrumb "Edit"
@title = "Sprint #{(a)sprint.id} (Edit)"
end
# POST /products/1/sprints
def create
+ add_breadcrumb "New"
respond_to do |format|
if @product.can_create_sprints?(@user)
@sprint = Sprint.new(params[:sprint])
@@ -94,6 +99,7 @@ class SprintsController < ApplicationController
# PUT /products/1/sprints/1
def update
+ add_breadcrumb "Edit"
respond_to do |format|
if @sprint.can_edit?(@user)
@sprint.update_attributes(params[:sprint])
@@ -163,6 +169,7 @@ class SprintsController < ApplicationController
# GET /products/1/sprints/1/plan
def plan
+ add_breadcrumb "Plan"
respond_to do |format|
if @sprint.pending?
if @sprint.can_populate?(@user)
@@ -185,6 +192,7 @@ class SprintsController < ApplicationController
# POST /products/1/sprints/1/populate
def populate
+ add_breadcrumb "Plan"
respond_to do |format|
if @sprint.pending?
if @sprint.can_populate?(@user)
@@ -233,6 +241,7 @@ class SprintsController < ApplicationController
# GET /product/1/sprint/1/members
def members
+ add_breadcrumb "Members", members_product_sprint_path(@product, @sprint)
end
private
@@ -240,6 +249,7 @@ class SprintsController < ApplicationController
def load_product
@product = Product.find_by_id(params[:product_id])
@members = @product.users if @product
+ @project = @product.project if @product
unless @product
flash[:error] = "Missing or invalid product."
@@ -287,4 +297,17 @@ class SprintsController < ApplicationController
@sprint.sprint_members << SprintMember.new(:sprint => @sprint, :member
=> user)
end
end
+
+ def path_to_list
+ 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", product_sprints_path(@product)
+ end
+
+ def path_to_one
+ path_to_list
+ add_breadcrumb "#{(a)sprint.id}", product_sprint_path(@product, @sprint)
+ end
end
diff --git a/app/controllers/stories_controller.rb
b/app/controllers/stories_controller.rb
index ce606c3..b08aeb2 100644
--- a/app/controllers/stories_controller.rb
+++ b/app/controllers/stories_controller.rb
@@ -16,9 +16,11 @@
# +StoriesController+ performs CRUD operations for instances of +UserStory+.
class StoriesController < ApplicationController
- before_filter :authenticated, :except => [:index, :show]
+ before_filter :authenticated, :except => [:index, :show]
before_filter :load_product
before_filter :load_user_story, :except => [:index, :new, :create]
+ before_filter :path_to_list, :only => [:index, :new, :create]
+ before_filter :path_to_one, :only => [:show, :edit, :update]
def index
@title = "All User Stories for #{(a)product.name}"
@@ -43,6 +45,7 @@ class StoriesController < ApplicationController
# GET /products/1/stories/new
def new
+ add_breadcrumb "New"
if @product.can_create_user_stories?(@user)
@title = "User Story (New)"
@user_story = UserStory.new(:product_id => @product.id)
@@ -56,6 +59,7 @@ class StoriesController < ApplicationController
# GET /products/1/stories/1/edit
def edit
+ add_breadcrumb "Edit"
if @user_story.can_edit?(@user)
@title = "User Story - #{(a)user_story.title} (Edit)"
load_epics
@@ -71,6 +75,7 @@ class StoriesController < ApplicationController
# POST /products/1/stories
def create
+ add_breadcrumb "New"
respond_to do |format|
if @product.can_create_user_stories?(@user)
UserStory.transaction do
@@ -106,6 +111,7 @@ class StoriesController < ApplicationController
# PUT /products/1/stories/1
def update
+ add_breadcrumb "Edit"
respond_to do |format|
if @user_story.can_edit?(@user)
UserStory.transaction do
@@ -183,4 +189,17 @@ class StoriesController < ApplicationController
def load_epics
@epics = Epic.find_all_by_project_id((a)project.id, :order => 'priority',
:conditions => "closed = false")
end
+
+ def path_to_list
+ 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 "User Stories", product_stories_path(@product)
+ end
+
+ def path_to_one
+ path_to_list
+ add_breadcrumb "#{(a)user_story.id}", product_story_path(@product,
@user_story)
+ end
end
diff --git a/app/controllers/tasks_controller.rb b/app/controllers/tasks_controller.rb
index 0832085..fa08add 100644
--- a/app/controllers/tasks_controller.rb
+++ b/app/controllers/tasks_controller.rb
@@ -19,10 +19,12 @@
# item.
#
class TasksController < ApplicationController
- before_filter :authenticated, :except => [:index, :show]
+ before_filter :authenticated, :except => [:index, :show]
before_filter :load_this_user
- before_filter :load_task, :except => [:index, :new, :create]
+ before_filter :load_task, :except => [:index, :new, :create]
before_filter :load_backlog_item, :only => [:new, :create]
+ before_filter :path_to_list, :only => [:index, :new, :create]
+ before_filter :path_to_one, :only => [:show, :edit, :update]
# GET /tasks
def index
@@ -195,4 +197,15 @@ class TasksController < ApplicationController
@backlog_item.sprint.product_id],
:order => "display_name ASC")
end
+
+ def path_to_list
+ add_breadcrumb "Users", users_path
+ add_breadcrumb "#{(a)this_user.id}", user_path(@this_user)
+ add_breadcrumb "Tasks", user_tasks_path(@this_user)
+ end
+
+ def path_to_one
+ path_to_list
+ add_breadcrumb "#{(a)task.id}", user_task_path(@this_user, @task)
+ end
end
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 2c4febf..7f3b8f3 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -16,8 +16,10 @@
# +UsersController+ allows for CRUD operations on instances of +User+.
class UsersController < ApplicationController
- before_filter :authenticated, :only => [:edit, :update, :verify, :notifications,
:change_password]
+ before_filter :authenticated, :only => [:edit, :update, :verify, :notifications,
:change_password]
before_filter :load_this_user, :except => [:index, :new, :create]
+ before_filter :path_to_list, :only => [:index, :new, :create]
+ before_filter :path_to_one, :only => [:show, :edit, :update, :backlog, :verify,
:roles, :password, :change_password ]
# GET /users
def index
@@ -41,6 +43,7 @@ class UsersController < ApplicationController
# GET /users/new
def new
+ add_breadcrumb "Register"
if (@user == nil) || (@user.create_users?)
@this_user = User.new
@title = "User Account (New)"
@@ -52,6 +55,7 @@ class UsersController < ApplicationController
# GET /users/1/edit
def edit
+ add_breadcrumb "Edit"
@title = "#{(a)this_user.display_name} (Edit)"
unless @this_user.can_edit?(@user)
flash[:error] = "You are not authorized to edit that account."
@@ -61,6 +65,7 @@ class UsersController < ApplicationController
# POST /users
def create
+ add_breadcrumb "Register"
respond_to do |format|
if (@user == nil) || (@user.create_users?)
@this_user = User.new(params[:user])
@@ -89,6 +94,7 @@ class UsersController < ApplicationController
# PUT /users/1
def update
+ add_breadcrumb "Edit"
respond_to do |format|
if @this_user.can_edit?(@user)
old_email = @this_user.email
@@ -113,6 +119,7 @@ class UsersController < ApplicationController
# GET /users/1/backlog
def backlog
+ add_breadcrumb "Backlog", backlog_user_path(@this_user)
@title = "Backlog For #{(a)this_user.display_name}"
@backlog_items = BacklogItem.paginate(
:conditions => ['owner_id = ?', @this_user.id],
@@ -123,6 +130,7 @@ class UsersController < ApplicationController
# GET /verify/1/token
def verify
+ add_breadcrumb "Verify"
respond_to do |format|
if @this_user.id == @user.id
if !(a)user.verified?
@@ -159,6 +167,7 @@ class UsersController < ApplicationController
# GET /users/1/roles
def roles
+ add_breadcrumb "Roles", roles_user_path(@this_user)
@product_roles = ProductRole.paginate(
:conditions => ['user_id = ?', @this_user.id],
:page => params[:page],
@@ -182,8 +191,14 @@ class UsersController < ApplicationController
end
end
+ # GET /users/1/password
+ def password
+ add_breadcrumb "Change Password"
+ end
+
# POST /users/1/change_password
def change_password
+ add_breadcrumb "Change Password"
respond_to do |format|
if @this_user.can_edit?(@user)
if User.authenticate((a)this_user.email, params[:old_password])
@@ -225,4 +240,13 @@ class UsersController < ApplicationController
end
end
end
+
+ def path_to_list
+ add_breadcrumb "Users", users_path
+ end
+
+ def path_to_one
+ path_to_list
+ add_breadcrumb "#{(a)this_user.id}", user_path(@this_user)
+ end
end
diff --git a/app/models/breadcrumb.rb b/app/models/breadcrumb.rb
new file mode 100644
index 0000000..f2b8680
--- /dev/null
+++ b/app/models/breadcrumb.rb
@@ -0,0 +1,13 @@
+class Breadcrumb
+ attr_accessor :text
+ attr_accessor :url
+
+ def initialize(text, url = nil)
+ @text = text
+ @url = url
+ end
+
+ def url?
+ @url
+ end
+end
diff --git a/app/views/epics/index.html.erb b/app/views/epics/index.html.erb
index b3a53bc..3bfe53d 100644
--- a/app/views/epics/index.html.erb
+++ b/app/views/epics/index.html.erb
@@ -33,9 +33,6 @@
</div>
<% render :layout => 'home/sidebar', :locals => {:title =>
"Commands"} do %>
- <%= link_to "View parent project",
- project_path(@project), :class => "command" %>
-
<% if @project.can_create_epics?(@user) %>
<%= link_to "Write new epic...",
new_project_epic_path(@project), :class => "command" %>
diff --git a/app/views/epics/show.html.erb b/app/views/epics/show.html.erb
index 75db19c..470813a 100644
--- a/app/views/epics/show.html.erb
+++ b/app/views/epics/show.html.erb
@@ -10,12 +10,6 @@
</div>
<% render :layout => 'home/sidebar', :locals => {:title => 'Epic
Commands'} do %>
- <%= link_to "View parent project",
- project_path(@project), :class => "command" %>
-
- <%= link_to "View all epics for this project",
- project_epics_path(@project), :class => "command" %>
-
<% if @epic.can_edit?(@user) %>
<%= link_to "Edit this epic",
diff --git a/app/views/items/_list.html.erb b/app/views/items/_list.html.erb
index 3cd37ea..d333450 100644
--- a/app/views/items/_list.html.erb
+++ b/app/views/items/_list.html.erb
@@ -1,42 +1,46 @@
-<div>
- <table class="main-list">
- <caption><%= "Backlog Item#{@sprint ? ' For @sprint.name' :
''}" %></caption>
- <thead>
- <tr>
- <th scope="col">#</th>
- <th scope="col">Rank</th>
- <th scope="col" class="name">Title</th>
+<table class="main-list">
+ <caption>
+ <% if @sprint %>
+ <%= "Backlog Items For #{(a)sprint.title}" %>
+ <% else %>
+ Backlog Itesm
+ <% end %>
+ </caption>
+ <thead>
+ <tr>
+ <th scope="col">#</th>
+ <th scope="col">Rank</th>
+ <th scope="col" class="name">Title</th>
- <% unless @this_user %>
- <th scope="col">Owner</th>
- <% end %>
-
- <th scope="col">Hours (E/A/R)</th>
- </tr>
- </thead>
+ <% unless @this_user %>
+ <th scope="col">Owner</th>
+ <% end %>
- <tbody>
- <% items.each do |item| %>
- <% sprint = item.sprint %>
- <% product = sprint.product %>
+ <th scope="col">Hours (E/A/R)</th>
+ </tr>
+ </thead>
- <tr class="state-<%= item.state %>">
- <td><%= "#{item.id}" %></td>
- <td><%= "#{item.user_story.priority}" %></td>
- <td class="name">
- <%= link_to "#{item.user_story.title} (#{item.state_text})",
- product_sprint_item_path(item.user_story.product, item.sprint, item) %>
- <%= RedCloth.new(get_first_sentence(item.user_story.description)).to_html %>
- <%= link_to "View Sprint", product_sprint_path(item.sprint.product,
item.sprint) %>
- </td>
+ <tbody>
+ <% items.each do |item| %>
+ <% sprint = item.sprint %>
+ <% product = sprint.product %>
- <% unless @this_user %>
- <td><%= link_to(item.owner.display_name, user_path(item.owner)) if item.owner
%></td>
- <% end %>
+ <tr class="state-<%= item.state %>">
+ <td><%= "#{item.id}" %></td>
+ <td><%= "#{item.user_story.priority}" %></td>
+ <td class="name">
+ <%= link_to "#{item.user_story.title} (#{item.state_text})",
+ product_sprint_item_path(item.user_story.product, item.sprint, item) %>
+ <%= RedCloth.new(get_first_sentence(item.user_story.description)).to_html %>
+ <%= link_to "View Sprint", product_sprint_path(item.sprint.product,
item.sprint) %>
+ </td>
- <td><%= show_hours_as_ear(item) %>
- </tr>
+ <% unless @this_user %>
+ <td><%= link_to(item.owner.display_name, user_path(item.owner)) if
item.owner %></td>
<% end %>
- </tbody>
- </table>
-</div>
+
+ <td><%= show_hours_as_ear(item) %>
+ </tr>
+ <% end %>
+ </tbody>
+</table>
diff --git a/app/views/items/index.html.erb b/app/views/items/index.html.erb
index 033b14c..a28f28f 100644
--- a/app/views/items/index.html.erb
+++ b/app/views/items/index.html.erb
@@ -1,15 +1,15 @@
-<div id="content">
+<% content_class = "content-no-sidebar" %>
+<% content_class = "content" if @sprint &&
@sprint.can_populate?(@user) %>
+
+<div id="<%= content_class %>">
<%= render :partial => 'list', :locals => {:items =>
@backlog_items} %>
</div>
-<% render :layout => 'home/sidebar', :locals => {:title =>
'Commands'} do %>
- <% if @sprint %>
- <%= link_to "View sprint",
- product_sprint_path(@product, @sprint), :class => "command" %>
+<% if @sprint && @sprint.can_populate?(@user) %>
- <% if @sprint.can_populate?(@user) %>
+<% render :layout => 'home/sidebar', :locals => {:title =>
'Commands'} do %>
<%= link_to "Populate this sprint...",
plan_product_sprint_path(@product, @sprint), :class => "command"
%>
- <% end %>
- <% end %>
+<% end %>
+
<% end %>
diff --git a/app/views/layouts/default.html.erb b/app/views/layouts/default.html.erb
index f947399..72b5693 100644
--- a/app/views/layouts/default.html.erb
+++ b/app/views/layouts/default.html.erb
@@ -34,6 +34,20 @@
<%= link_to "ProjXP", 'http://projxp.fedorahosted.org/' %>
</div>
+ <div id="breadcrumbs">
+ <%= link_to "Home", "/" %>
+ <% if @breadcrumbs %>
+ <% @breadcrumbs.each do |crumb| %>
+ >
+ <% if crumb.url? %>
+ <%= link_to crumb.text, crumb.url %>
+ <% else %>
+ <%= crumb.text %>
+ <% end %>
+ <% end %>
+ <% end %>
+ </div>
+
<ul id="site-nav">
<li><%= link_to "Home", :controller => :home %></li>
<li><%= link_to "Projects (#{@project_count})", projects_path
%></li>
diff --git a/app/views/products/index.html.erb b/app/views/products/index.html.erb
index ba66031..f4fbcce 100644
--- a/app/views/products/index.html.erb
+++ b/app/views/products/index.html.erb
@@ -52,11 +52,6 @@
<% if @project %>
<% render :layout => 'home/sidebar', :locals => {:title =>
"Commands"} do %>
- <% if @project %>
- <%= link_to "View parent project",
- project_path(@project), :class => "command" %>
- <% end %>
-
<% if @project && @project.can_create_products?(@user) %>
<%= link_to "Add new product...",
new_product_path(:project => @project.id), :class => "command"
%>
diff --git a/app/views/products/show.html.erb b/app/views/products/show.html.erb
index ef3274f..1bce3a3 100644
--- a/app/views/products/show.html.erb
+++ b/app/views/products/show.html.erb
@@ -22,9 +22,6 @@
</div>
<% render :layout => 'home/sidebar', :locals => {:title =>
"Product Commands"} do %>
- <%= link_to "View parent project",
- project_path((a)product.project), :class => "command" %>
-
<% if @product.can_edit?(@user) %>
<%= link_to "Edit this product",
edit_product_path(@product), :class => "command" %>
@@ -39,9 +36,9 @@
:confirm => "Join product team? Are you sure?" %>
<% end %>
- <%= link_to "User stories (#{(a)product.user_stories.size} total)",
+ <%= link_to "View user stories (#{(a)product.user_stories.size} total)",
product_stories_path(@product), :class => "command" %>
- <%= link_to "Sprints (#{(a)product.sprints.size} total)",
+ <%= link_to "View sprints (#{(a)product.sprints.size} total)",
product_sprints_path(@product), :class => "command" %>
<% end %>
diff --git a/app/views/roles/index.html.erb b/app/views/roles/index.html.erb
index 66d922a..787d9df 100644
--- a/app/views/roles/index.html.erb
+++ b/app/views/roles/index.html.erb
@@ -1,4 +1,4 @@
-<div id="content">
+<div id="content-no-sidebar">
<div>
<%= will_paginate @product_roles %>
</div>
diff --git a/app/views/sprints/index.html.erb b/app/views/sprints/index.html.erb
index 833d736..b42bd1a 100644
--- a/app/views/sprints/index.html.erb
+++ b/app/views/sprints/index.html.erb
@@ -40,9 +40,6 @@
</div>
<% render :layout => 'home/sidebar', :locals => {:title =>
'Commands'} do %>
- <%= link_to "View parent product",
- product_path(@product), :class => "command" %>
-
<% if @product.can_create_sprints?(@user) %>
<%= link_to "Create sprint...",
new_product_sprint_path(@product), :class => "command" %>
diff --git a/app/views/sprints/members.html.erb b/app/views/sprints/members.html.erb
index b1198de..a4ae6f6 100644
--- a/app/views/sprints/members.html.erb
+++ b/app/views/sprints/members.html.erb
@@ -1,4 +1,4 @@
-<div id="content">
+<div id="content-no-sidebar">
<table class="main-list">
<caption><%= "Members For \"#{(a)sprint.title}\""
%></caption>
<thead>
@@ -24,10 +24,3 @@
</tbody>
</table>
</div>
-
-<% render :layout => 'home/sidebar', :locals => {:title =>
'Member Options'} do %>
-
- <%= link_to "View sprint",
- product_sprint_path(@product, @sprint), :class => "command" %>
-
-<% end %>
diff --git a/app/views/sprints/show.html.erb b/app/views/sprints/show.html.erb
index 38988b1..2de2c3f 100644
--- a/app/views/sprints/show.html.erb
+++ b/app/views/sprints/show.html.erb
@@ -18,9 +18,6 @@
</div>
<% render :layout => 'home/sidebar', :locals => {:title =>
'Sprint Commands'} do %>
- <%= link_to "View parent product",
- product_path(@product), :class => "command" %>
-
<% if @sprint.can_edit?(@user) %>
<%= link_to "Edit this sprint...",
edit_product_sprint_path(@product, @sprint), :class => "command"
%>
diff --git a/app/views/stories/index.html.erb b/app/views/stories/index.html.erb
index 6f25649..48a7c8a 100644
--- a/app/views/stories/index.html.erb
+++ b/app/views/stories/index.html.erb
@@ -40,9 +40,6 @@
</div>
<% render :layout => 'home/sidebar', :locals => {:title =>
'Commands'} do %>
- <%= link_to "Return to product page...",
- product_path(@product), :class => "command" %>
-
<% if @product.can_create_user_stories?(@user) %>
<%= link_to "Write user stories...",
new_product_story_path(@product), :class => "command" %>
diff --git a/app/views/stories/show.html.erb b/app/views/stories/show.html.erb
index c0b8013..8642430 100644
--- a/app/views/stories/show.html.erb
+++ b/app/views/stories/show.html.erb
@@ -8,9 +8,6 @@
</div>
<% render :layout => 'home/sidebar', :locals => {:title => 'User
Story Commands'} do %>
- <%= link_to "Return to user stories list...",
- product_stories_path(@product), :class => "command" %>
-
<%if @user_story.can_edit?(@user) %>
<%= link_to "Edit user story...",
edit_product_story_path(@product, @user_story), :class => "command"
%>
diff --git a/app/views/users/backlog.html.erb b/app/views/users/backlog.html.erb
index 69b3631..9937267 100644
--- a/app/views/users/backlog.html.erb
+++ b/app/views/users/backlog.html.erb
@@ -1,4 +1,4 @@
-<div id="content">
+<div id="content-no-sidebar">
<div>
<%= will_paginate @backlog_items %>
</div>
diff --git a/public/stylesheets/navbar.css b/public/stylesheets/navbar.css
index a054b8b..436fe33 100644
--- a/public/stylesheets/navbar.css
+++ b/public/stylesheets/navbar.css
@@ -11,6 +11,20 @@
text-decoration: none;
}
+#breadcrumbs {
+ width: 100%;
+ background-color: #f00;
+ color: #ff0;
+ font-weight: bold;
+}
+
+#breadcrumbs a {
+ color: #fff;
+ text-decoration: none;
+ font-weight: bold;
+ padding: 2px 5px 3px 5px;
+}
+
#user-bar a {
color: #ffff00;
}
--
1.6.0.6