summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2011-03-12 18:27:02 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2011-03-12 18:27:02 +0000
commit14238907354a6d4c0960556f2f48811119dc11c9 (patch)
tree8d71582c7fd717a7abc1b61e78a07620649498f6 /app
parentb8b35ab05f70e6edd524397d2fb0dca3630fa840 (diff)
downloadredmine-14238907354a6d4c0960556f2f48811119dc11c9.tar.gz
redmine-14238907354a6d4c0960556f2f48811119dc11c9.zip
Adds an option to #render_page_hierarchy to add timestamp titles.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5099 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/helpers/application_helper.rb6
-rw-r--r--app/views/wiki/index.html.erb2
2 files changed, 4 insertions, 4 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 03f40e2bf..44cb25ab8 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -187,15 +187,15 @@ module ApplicationHelper
end
end
- def render_page_hierarchy(pages, node=nil)
+ def render_page_hierarchy(pages, node=nil, options={})
content = ''
if pages[node]
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},
- :title => (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) if pages[page.id]
+ :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"
end
content << "</ul>\n"
diff --git a/app/views/wiki/index.html.erb b/app/views/wiki/index.html.erb
index 7e7155fda..5f962468a 100644
--- a/app/views/wiki/index.html.erb
+++ b/app/views/wiki/index.html.erb
@@ -8,7 +8,7 @@
<p class="nodata"><%= l(:label_no_data) %></p>
<% end %>
-<%= render_page_hierarchy(@pages_by_parent_id) %>
+<%= render_page_hierarchy(@pages_by_parent_id, nil, :timestamp => true) %>
<% content_for :sidebar do %>
<%= render :partial => 'sidebar' %>