summaryrefslogtreecommitdiff
path: root/app/views/revisions/show.html.erb
blob: ebda18d30183932944889e09467b867c5f15afc2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<% content_for :subnavigation do %>
  <%= link_to 'Edit',     edit_node_path(@node) %>
<% end %>

<h2>Revisions for Node: <%= @node.unique_name %></h2>

<% form_tag diff_revision_path do %>
<table id="revisions">
  <tr class="header">
    <th>First</th>
    <th>Last</th>
    <th>Rev.</th>
    <th>Title</th>
    <th>User</th>
    <th>Date</th>
    <th></th>
  </tr>
<% @node.pages.reverse.each do |page| %>
  <tr>
    <td><%= radio_button_tag :start_revision, page.revision %></td>
    <td><%= radio_button_tag :end_revision, page.revision %></td>
    <td class="revision"><%= page.revision %></td>
    <td class="title"><%= page.title %></td>
    <td class="user"><%= page.user.try(:login)  %></td>
    <td class="date"><%= page.updated_at %></td>
    <td>
      <%= link_to 'show', node_path(page.node) %>
    </td>
    <td>
      <%= link_to(
            'restore', 
            restore_revision_path(page), 
            :method => :put, 
            :confirm => "Restore this revision?"
          ) %>
    </td>
  </tr>
<% end %>
  <tr class="no_hover">
    <td colspan="8" class="right"><%= submit_tag 'Diff revisions' %></td>
  </tr>
</table>

<% end %>