From 25d900c78791906c1a514f61b29ebddbe4647270 2011-07-04 19:56:38 From: Jean-Philippe Lang Date: 2011-07-04 19:56:38 Subject: [PATCH] Adds breadcrumb on all wiki page views. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@6182 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/helpers/wiki_helper.rb b/app/helpers/wiki_helper.rb index 48527a9..11d8aa1 100644 --- a/app/helpers/wiki_helper.rb +++ b/app/helpers/wiki_helper.rb @@ -32,4 +32,10 @@ module WikiHelper end s end + + def wiki_page_breadcrumb(page) + breadcrumb(page.ancestors.reverse.collect {|parent| + link_to(h(parent.pretty_title), {:controller => 'wiki', :action => 'show', :id => parent.title, :project_id => parent.project}) + }) + end end diff --git a/app/views/wiki/annotate.rhtml b/app/views/wiki/annotate.rhtml index dfea195..863865a 100644 --- a/app/views/wiki/annotate.rhtml +++ b/app/views/wiki/annotate.rhtml @@ -3,7 +3,9 @@ <%= link_to(l(:label_history), {:action => 'history', :id => @page.title}, :class => 'icon icon-history') %> -

<%= @page.pretty_title %>

+<%= wiki_page_breadcrumb(@page) %> + +

<%=h @page.pretty_title %>

<%= l(:label_version) %> <%= link_to @annotate.content.version, :action => 'show', :id => @page.title, :version => @annotate.content.version %> diff --git a/app/views/wiki/destroy.rhtml b/app/views/wiki/destroy.rhtml index 400230f..ff8cf2e 100644 --- a/app/views/wiki/destroy.rhtml +++ b/app/views/wiki/destroy.rhtml @@ -1,3 +1,5 @@ +<%= wiki_page_breadcrumb(@page) %> +

<%=h @page.pretty_title %>

<% form_tag({}, :method => :delete) do %> diff --git a/app/views/wiki/diff.rhtml b/app/views/wiki/diff.rhtml index a1006dc..4eef50a 100644 --- a/app/views/wiki/diff.rhtml +++ b/app/views/wiki/diff.rhtml @@ -2,7 +2,9 @@ <%= link_to(l(:label_history), {:action => 'history', :id => @page.title}, :class => 'icon icon-history') %> -

<%= @page.pretty_title %>

+<%= wiki_page_breadcrumb(@page) %> + +

<%=h @page.pretty_title %>

<%= l(:label_version) %> <%= link_to @diff.content_from.version, :action => 'show', :id => @page.title, :project_id => @page.project, :version => @diff.content_from.version %> diff --git a/app/views/wiki/edit.rhtml b/app/views/wiki/edit.rhtml index 5f47c3f..3c51c63 100644 --- a/app/views/wiki/edit.rhtml +++ b/app/views/wiki/edit.rhtml @@ -1,3 +1,5 @@ +<%= wiki_page_breadcrumb(@page) %> +

<%=h @page.pretty_title %>

<% form_for :content, @content, :url => {:action => 'update', :id => @page.title}, :html => {:method => :put, :multipart => true, :id => 'wiki_form'} do |f| %> diff --git a/app/views/wiki/history.rhtml b/app/views/wiki/history.rhtml index 392c3b9..6027ed9 100644 --- a/app/views/wiki/history.rhtml +++ b/app/views/wiki/history.rhtml @@ -1,4 +1,6 @@ -

<%= @page.pretty_title %>

+<%= wiki_page_breadcrumb(@page) %> + +

<%=h @page.pretty_title %>

<%= l(:label_history) %>

diff --git a/app/views/wiki/rename.rhtml b/app/views/wiki/rename.rhtml index f94b8bc..7a06c03 100644 --- a/app/views/wiki/rename.rhtml +++ b/app/views/wiki/rename.rhtml @@ -1,4 +1,6 @@ -

<%= l(:button_rename) %>: <%= @original_title %>

+<%= wiki_page_breadcrumb(@page) %> + +

<%=h @original_title %>

<%= error_messages_for 'page' %> diff --git a/app/views/wiki/show.rhtml b/app/views/wiki/show.rhtml index 9b2f2de..3076339 100644 --- a/app/views/wiki/show.rhtml +++ b/app/views/wiki/show.rhtml @@ -11,7 +11,7 @@ <%= link_to_if_authorized(l(:label_history), {:action => 'history', :id => @page.title}, :class => 'icon icon-history') %> -<%= breadcrumb(@page.ancestors.reverse.collect {|parent| link_to h(parent.pretty_title), {:id => parent.title, :project_id => parent.project}}) %> +<%= wiki_page_breadcrumb(@page) %> <% if @content.version != @page.content.version %>