diff --git a/app/views/wiki/_sidebar.html.erb b/app/views/wiki/_sidebar.html.erb index 16e8be167c..3321c0bb2e 100644 --- a/app/views/wiki/_sidebar.html.erb +++ b/app/views/wiki/_sidebar.html.erb @@ -13,4 +13,9 @@ :action => 'date_index'}) %> +<% if @page.present? && @page.children.present? %> +

<%= l(:label_child_pages) %>

+ <%= render_page_hierarchy(@page.children.group_by(&:parent_id), @page.id, :timestamp => true) %> +<% end %> + <%= call_hook(:view_wiki_show_sidebar_bottom, :wiki => @wiki, :page => @page) %> diff --git a/config/locales/en.yml b/config/locales/en.yml index f2833e6524..c65a9011f2 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -810,6 +810,7 @@ en: label_wiki_page: Wiki page label_wiki_page_plural: Wiki pages label_wiki_page_new: New wiki page + label_child_pages: Child pages label_index_by_title: Index by title label_index_by_date: Index by date label_current_version: Current version diff --git a/test/functional/wiki_controller_test.rb b/test/functional/wiki_controller_test.rb index 6ee3bff510..27defc064b 100644 --- a/test/functional/wiki_controller_test.rb +++ b/test/functional/wiki_controller_test.rb @@ -54,6 +54,10 @@ class WikiControllerTest < Redmine::ControllerTest # Included page with an inline image assert_select 'p', :text => /This is an inline image/ assert_select 'img[src=?][alt=?]', '/attachments/download/3/logo.gif', 'This is a logo' + assert_select '#sidebar ul.pages-hierarchy' do + assert_select 'a', :text => 'Child 1' + assert_select 'a', :text => 'Child 2' + end end def test_show_old_version