History Pages
From Jason Blevins: Create a "History" page for each wiki page. Link to it, and to the "Diff" page from "Recently Revised". Also, correct a bug in listing/deleting links to uploaded video and audio files.
This commit is contained in:
parent
7c0874bf4c
commit
d5a65e6ac8
6 changed files with 74 additions and 2 deletions
23
app/views/wiki/history.html.erb
Normal file
23
app/views/wiki/history.html.erb
Normal file
|
@ -0,0 +1,23 @@
|
|||
<%- @title = @page.plain_name + " (history)" -%>
|
||||
<%- @show_footer = true -%>
|
||||
|
||||
<%- @revisions_by_day.keys.sort.reverse.each do |day| -%>
|
||||
<h3><%= format_date(day, include_time = false) %></h3>
|
||||
<ul>
|
||||
<%- for rev in @revisions_by_day[day] -%>
|
||||
<li>
|
||||
<%= link_to_revision(rev.page, @revision_numbers[rev.id],
|
||||
text="Revision #{@revision_numbers[rev.id]}") %>
|
||||
<%- if @revision_numbers[rev.id] > 1 -%>
|
||||
(<%= link_to_revision(rev.page, @revision_numbers[rev.id],
|
||||
text="diff", mode='diff') %>)
|
||||
<%- end -%>
|
||||
<div class="byline" style="margin-bottom: 0px">
|
||||
by <%= link_to_page(rev.author) %>
|
||||
at <%= format_date(rev.revised_at) %>
|
||||
<%= "from #{rev.author.ip}" if rev.author.respond_to?(:ip) %>
|
||||
</div>
|
||||
</li>
|
||||
<%- end -%>
|
||||
</ul>
|
||||
<%- end -%>
|
|
@ -8,6 +8,11 @@
|
|||
<%- for page in @pages_by_day[day] -%>
|
||||
<li>
|
||||
<%= link_to_existing_page page %>
|
||||
<%- if page.revisions.length > 1 %>
|
||||
(<%= link_to_revision(page, page.revisions.length, text='diff',
|
||||
mode='diff') %>)
|
||||
(<%= link_to_history(page, text='history') %>)
|
||||
<%- end -%>
|
||||
<div class="byline" style="margin-bottom: 0px">
|
||||
by <%= link_to_page(page.author) %>
|
||||
at <%= format_date(page.revised_at) %>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue