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
This commit is contained in:
parent
fec6eb782c
commit
1b05ca5a6e
|
@ -187,15 +187,15 @@ module ApplicationHelper
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def render_page_hierarchy(pages, node=nil)
|
def render_page_hierarchy(pages, node=nil, options={})
|
||||||
content = ''
|
content = ''
|
||||||
if pages[node]
|
if pages[node]
|
||||||
content << "<ul class=\"pages-hierarchy\">\n"
|
content << "<ul class=\"pages-hierarchy\">\n"
|
||||||
pages[node].each do |page|
|
pages[node].each do |page|
|
||||||
content << "<li>"
|
content << "<li>"
|
||||||
content << link_to(h(page.pretty_title), {:controller => 'wiki', :action => 'show', :project_id => page.project, :id => page.title},
|
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))
|
: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) if pages[page.id]
|
content << "\n" + render_page_hierarchy(pages, page.id, options) if pages[page.id]
|
||||||
content << "</li>\n"
|
content << "</li>\n"
|
||||||
end
|
end
|
||||||
content << "</ul>\n"
|
content << "</ul>\n"
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
<p class="nodata"><%= l(:label_no_data) %></p>
|
<p class="nodata"><%= l(:label_no_data) %></p>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%= render_page_hierarchy(@pages_by_parent_id) %>
|
<%= render_page_hierarchy(@pages_by_parent_id, nil, :timestamp => true) %>
|
||||||
|
|
||||||
<% content_for :sidebar do %>
|
<% content_for :sidebar do %>
|
||||||
<%= render :partial => 'sidebar' %>
|
<%= render :partial => 'sidebar' %>
|
||||||
|
|
Loading…
Reference in New Issue