Files
danbooru/app/views/post_versions/_listing.html.erb
2013-02-19 14:36:31 -05:00

45 lines
1.4 KiB
Plaintext

<div class="listing">
<table class="striped">
<thead>
<tr>
<th width="5%">Post</th>
<th width="15%">Date</th>
<th width="10%">User</th>
<th width="5%">Rating</th>
<th width="5%">Parent</th>
<% if CurrentUser.is_admin? %>
<th width="10%">IP Address</th>
<% end %>
<th width="45%">Tags</th>
<th width="5%"></th>
</tr>
</thead>
<tbody>
<% post_versions.each do |post_version| %>
<tr id="post-version-<%= post_version.id %>">
<td><%= link_to(post_version.post_id, post_path(post_version.post_id)) %></td>
<td><%= compact_time(post_version.updated_at) %></td>
<td>
<% if post_version.updater %>
<%= link_to(post_version.updater.name, user_path(post_version.updater_id)) %>
<% end %>
</td>
<td><%= post_version.rating %></td>
<td><%= post_version.parent_id %></td>
<% if CurrentUser.is_admin? %>
<td>
<%= post_version.updater_ip_addr %>
</td>
<% end %>
<td><%= post_version_diff(post_version) %></td>
<td>
<%= link_to "Revert", revert_post_path(post_version.post_id, :version_id => post_version.id), :method => :put, :remote => true %>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
<%= numbered_paginator(post_versions) %>