From b9e380c9febe08a0332e785299f6dcc495463a3e Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Thu, 27 Mar 2008 18:41:42 +0000 Subject: [PATCH] Add breadcrumb nav for the forums (#892). git-svn-id: http://redmine.rubyforge.org/svn/trunk@1299 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/application_helper.rb | 4 ++++ app/views/boards/show.rhtml | 2 ++ app/views/messages/show.rhtml | 5 ++++- public/stylesheets/application.css | 1 + 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 510ecd15e..77019eba3 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -156,6 +156,10 @@ module ApplicationHelper links.size > 1 ? l(:label_display_per_page, links.join(', ')) : nil end + def breadcrumb(*args) + content_tag('p', args.join(' » ') + ' » ', :class => 'breadcrumb') + end + def html_title(*args) if args.empty? title = [] diff --git a/app/views/boards/show.rhtml b/app/views/boards/show.rhtml index 54645622e..26d17ae56 100644 --- a/app/views/boards/show.rhtml +++ b/app/views/boards/show.rhtml @@ -1,3 +1,5 @@ +<%= breadcrumb link_to(l(:label_board_plural), {:controller => 'boards', :action => 'index', :project_id => @project}) %> +
<%= link_to_if_authorized l(:label_message_new), {:controller => 'messages', :action => 'new', :board_id => @board}, diff --git a/app/views/messages/show.rhtml b/app/views/messages/show.rhtml index 632f603ff..ef7db71ef 100644 --- a/app/views/messages/show.rhtml +++ b/app/views/messages/show.rhtml @@ -1,9 +1,12 @@ +<%= breadcrumb link_to(l(:label_board_plural), {:controller => 'boards', :action => 'index', :project_id => @project}), + link_to(h(@board.name), {:controller => 'boards', :action => 'show', :project_id => @project, :id => @board}) %> +
<%= link_to_if_authorized l(:button_edit), {:action => 'edit', :id => @topic}, :class => 'icon icon-edit' %> <%= link_to_if_authorized l(:button_delete), {:action => 'destroy', :id => @topic}, :method => :post, :confirm => l(:text_are_you_sure), :class => 'icon icon-del' %>
-

<%= link_to h(@board.name), :controller => 'boards', :action => 'show', :project_id => @project, :id => @board %> » <%=h @topic.subject %>

+

<%=h @topic.subject %>

<%= authoring @topic.created_on, @topic.author %>

diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index c30367903..01b31fa45 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -159,6 +159,7 @@ hr { width: 100%; height: 1px; background: #ccc; border: 0;} textarea.wiki-edit { width: 99%; } li p {margin-top: 0;} div.issue {background:#ffffdd; padding:6px; margin-bottom:6px;border: 1px solid #d7d7d7;} +p.breadcrumb { font-size: 0.9em; margin: 4px 0 4px 0;} fieldset#filters .buttons { text-align: right; font-size: 0.9em; margin: 0 4px 0px 0; }