diff options
author | Johan Sørensen <johan@johansorensen.com> | 2010-01-11 12:22:55 +0100 |
---|---|---|
committer | Johan Sørensen <johan@johansorensen.com> | 2010-01-11 12:22:55 +0100 |
commit | 51f4b51350306f8aeef811180f8a445a91353029 (patch) | |
tree | c561ca6cbb9e96ceb0036a6241773f7f611c9490 | |
parent | 34de8fb98fc8c5cd7dc3ccbc54e001a8f19672d3 (diff) | |
download | gitorious-mainline-outdated-51f4b51350306f8aeef811180f8a445a91353029.zip gitorious-mainline-outdated-51f4b51350306f8aeef811180f8a445a91353029.tar.gz gitorious-mainline-outdated-51f4b51350306f8aeef811180f8a445a91353029.tar.bz2 |
Add breadcrumbs to /favorites and a link from the favorite-list box on ~user
-rw-r--r-- | app/controllers/favorites_controller.rb | 1 | ||||
-rw-r--r-- | app/views/favorites/index.html.erb | 2 | ||||
-rw-r--r-- | app/views/users/show.html.erb | 8 | ||||
-rw-r--r-- | lib/breadcrumb.rb | 18 | ||||
-rw-r--r-- | public/stylesheets/base.css | 4 |
5 files changed, 31 insertions, 2 deletions
diff --git a/app/controllers/favorites_controller.rb b/app/controllers/favorites_controller.rb index 5a91781..0a27c9b 100644 --- a/app/controllers/favorites_controller.rb +++ b/app/controllers/favorites_controller.rb @@ -22,6 +22,7 @@ class FavoritesController < ApplicationController def index @favorites = current_user.favorites.all(:include => :watchable) + @root = Breadcrumb::Favorites.new(current_user) end def update diff --git a/app/views/favorites/index.html.erb b/app/views/favorites/index.html.erb index d713c9f..791db02 100644 --- a/app/views/favorites/index.html.erb +++ b/app/views/favorites/index.html.erb @@ -18,7 +18,7 @@ %> <% @page_title = "Your favorites" -%> -<%= breadcrumbs_from(current_user) -%> +<%= breadcrumbs_from(@root) -%> <h1>Your favorites</h1> diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 55b334a..9584609 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -196,7 +196,13 @@ <%= link_to_watchable(favorite.watchable) -%> </li> <% end %> - <p class="hint"><%= no_watchings_notice_for(@user) if @favorites.blank? %></p> + <% if @favorites.blank? -%> + <p class="hint"><%= no_watchings_notice_for(@user) -%></p> + <% else -%> + <p class="action small"> + <%= link_to "Manage favorite email subscriptions", favorites_path -%> + </p> + <% end -%> </ul> </div> <% end %> diff --git a/lib/breadcrumb.rb b/lib/breadcrumb.rb index d2a6668..f7e1c60 100644 --- a/lib/breadcrumb.rb +++ b/lib/breadcrumb.rb @@ -472,4 +472,22 @@ module Breadcrumb end end + class Favorites + def initialize(user) + @user = user + end + + def breadcrumb_parent + @user + end + + def title + "Favorites" + end + + def breadcrumb_css_class + "favorite" + end + end + end diff --git a/public/stylesheets/base.css b/public/stylesheets/base.css index 4ff818f..4261855 100644 --- a/public/stylesheets/base.css +++ b/public/stylesheets/base.css @@ -589,6 +589,7 @@ li.new_email > a, .white-button.new_email a { li.sent_emails > a { background-image: url("../images/silk/email_go.png") !important; } li.received_emails > a { background-image: url("../images/silk/email_open.png") !important; } li.all_emails > a { background-image: url("../images/silk/folder.png") !important; } +li.favorite > a { background-image: url("../images/silk/star.png") !important; } /* Icons used both for events and actions/breadcrums */ li.event_instance.create_repository, li.create_repository > a { background-image: url("../images/silk/database_add.png") !important; } @@ -3438,6 +3439,9 @@ body#users h2.activities small { text-decoration: none; color: #390; } +#watchable-list .action { + text-align: right; +} #favorite-listing { width: 500px; } |