summaryrefslogtreecommitdiffstats
path: root/app/helpers/wiki_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/helpers/wiki_helper.rb')
-rw-r--r--app/helpers/wiki_helper.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/app/helpers/wiki_helper.rb b/app/helpers/wiki_helper.rb
index 980035bd4..d27ce3ea3 100644
--- a/app/helpers/wiki_helper.rb
+++ b/app/helpers/wiki_helper.rb
@@ -17,6 +17,22 @@
module WikiHelper
+ def render_page_hierarchy(pages, node=nil)
+ content = ''
+ if pages[node]
+ content << "<ul class=\"pages-hierarchy\">\n"
+ pages[node].each do |page|
+ content << "<li>"
+ content << link_to(h(page.pretty_title), {:action => 'index', :page => page.title},
+ :title => l(:label_updated_time, distance_of_time_in_words(Time.now, page.updated_on)))
+ content << "\n" + render_page_hierarchy(pages, page.id) if pages[page.id]
+ content << "</li>\n"
+ end
+ content << "</ul>\n"
+ end
+ content
+ end
+
def html_diff(wdiff)
words = wdiff.words.collect{|word| h(word)}
words_add = 0