summaryrefslogtreecommitdiffstats
path: root/app/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/application_helper.rb3
-rw-r--r--app/helpers/wiki_helper.rb16
2 files changed, 18 insertions, 1 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 7bcec461e..f5ce7ecda 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -177,7 +177,8 @@ module ApplicationHelper
end
def breadcrumb(*args)
- content_tag('p', args.join(' » ') + ' » ', :class => 'breadcrumb')
+ elements = args.flatten
+ elements.any? ? content_tag('p', args.join(' » ') + ' » ', :class => 'breadcrumb') : nil
end
def html_title(*args)
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