@@ -187,15 +187,15 module ApplicationHelper | |||||
187 | end |
|
187 | end | |
188 | end |
|
188 | end | |
189 |
|
189 | |||
190 | def render_page_hierarchy(pages, node=nil) |
|
190 | def render_page_hierarchy(pages, node=nil, options={}) | |
191 | content = '' |
|
191 | content = '' | |
192 | if pages[node] |
|
192 | if pages[node] | |
193 | content << "<ul class=\"pages-hierarchy\">\n" |
|
193 | content << "<ul class=\"pages-hierarchy\">\n" | |
194 | pages[node].each do |page| |
|
194 | pages[node].each do |page| | |
195 | content << "<li>" |
|
195 | content << "<li>" | |
196 | content << link_to(h(page.pretty_title), {:controller => 'wiki', :action => 'show', :project_id => page.project, :id => page.title}, |
|
196 | content << link_to(h(page.pretty_title), {:controller => 'wiki', :action => 'show', :project_id => page.project, :id => page.title}, | |
197 | :title => (page.updated_on ? l(:label_updated_time, distance_of_time_in_words(Time.now, page.updated_on)) : nil)) |
|
197 | :title => (options[:timestamp] && page.updated_on ? l(:label_updated_time, distance_of_time_in_words(Time.now, page.updated_on)) : nil)) | |
198 | content << "\n" + render_page_hierarchy(pages, page.id) if pages[page.id] |
|
198 | content << "\n" + render_page_hierarchy(pages, page.id, options) if pages[page.id] | |
199 | content << "</li>\n" |
|
199 | content << "</li>\n" | |
200 | end |
|
200 | end | |
201 | content << "</ul>\n" |
|
201 | content << "</ul>\n" |
@@ -8,7 +8,7 | |||||
8 | <p class="nodata"><%= l(:label_no_data) %></p> |
|
8 | <p class="nodata"><%= l(:label_no_data) %></p> | |
9 | <% end %> |
|
9 | <% end %> | |
10 |
|
10 | |||
11 | <%= render_page_hierarchy(@pages_by_parent_id) %> |
|
11 | <%= render_page_hierarchy(@pages_by_parent_id, nil, :timestamp => true) %> | |
12 |
|
12 | |||
13 | <% content_for :sidebar do %> |
|
13 | <% content_for :sidebar do %> | |
14 | <%= render :partial => 'sidebar' %> |
|
14 | <%= render :partial => 'sidebar' %> |
General Comments 0
You need to be logged in to leave comments.
Login now