diff options
author | Go MAEDA <maeda@farend.jp> | 2019-05-09 15:17:30 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2019-05-09 15:17:30 +0000 |
commit | ae24985e0303c134fb1377f1cd1427dd4da7ba9c (patch) | |
tree | 34ccd1567a5cdc8f8eb6b6444c1914ca1694511e /app/helpers | |
parent | d972d020215d66b5aae39740fc0533baca2f9c91 (diff) | |
download | redmine-ae24985e0303c134fb1377f1cd1427dd4da7ba9c.tar.gz redmine-ae24985e0303c134fb1377f1cd1427dd4da7ba9c.zip |
Hierarchy in TOC is not preserved when Wiki index is exported to HTML (#20910).
Patch by Mizuki ISHIKAWA.
git-svn-id: http://svn.redmine.org/redmine/trunk@18149 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/application_helper.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 832c22b13..09df2656b 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -371,7 +371,12 @@ module ApplicationHelper content << "<ul class=\"pages-hierarchy\">\n" pages[node].each do |page| content << "<li>" - content << link_to(h(page.pretty_title), {:controller => 'wiki', :action => 'show', :project_id => page.project, :id => page.title, :version => nil}, + if controller.controller_name == 'wiki' && controller.action_name == 'export' + href = "##{page.title}" + else + href = {:controller => 'wiki', :action => 'show', :project_id => page.project, :id => page.title, :version => nil} + end + content << link_to(h(page.pretty_title), href, :title => (options[:timestamp] && page.updated_on ? l(:label_updated_time, distance_of_time_in_words(Time.now, page.updated_on)) : nil)) content << "\n" + render_page_hierarchy(pages, page.id, options) if pages[page.id] content << "</li>\n" |