Files
danbooru/app/views/post_versions/_listing.html.erb
evazion 085e903e02 /post_versions: reorganize layout, add thumbnails.
* Add thumbnails to /post_versions (when viewing history of a single
  post, thumbnail is above table rather than in every table row).
* Combine user, date, and ip address columns into one column.
* Remove rating and parent columns (rating and parent changes are
  already listed in the tags column).
2019-09-28 17:48:35 -05:00

57 lines
2.4 KiB
Plaintext

<div id="p-<%= post_version_listing %>-listing">
<table class="striped autofit">
<thead>
<tr>
<% if CurrentUser.user.is_builder? %>
<th class="post-version-select-column">
<label><input type="checkbox" id="post-version-select-all-checkbox" class="post-version-select-checkbox"></label>
</th>
<% end %>
<% if post_version_listing == :standard %>
<th>Post</th>
<% end %>
<th>Version</th>
<th>Tags</th>
<th>Updated</th>
<th></th>
</tr>
</thead>
<tbody>
<% @post_versions.each do |post_version| %>
<tr id="post-version-<%= post_version.id %>" data-post-version-id="<%= post_version.id %>">
<% if CurrentUser.user.is_builder? %>
<td class="post-version-select-column">
<input type="checkbox" class="post-version-select-checkbox" <%= "disabled" unless post_version.can_undo?(CurrentUser.user) %>>
</td>
<% end %>
<% if post_version_listing == :standard %>
<td><%= PostPresenter.preview(post_version.post, show_deleted: true) %></td>
<% end %>
<td>
<%= link_to "#{post_version.post_id}.#{post_version.version}", post_versions_path(search: { post_id: post_version.post_id }, anchor: "post-version-#{post_version.id}") %>
</td>
<td class="col-expand"><%= post_version_diff(post_version) %></td>
<td>
<%= link_to_user post_version.updater %>
<%= link_to "»", post_versions_path(search: { updater_name: post_version.updater&.name }) %>
<div>
<%= compact_time(post_version.updated_at) %>
<% if CurrentUser.is_moderator? %>
(<%= link_to_ip post_version.updater_ip_addr %>)
<% end %>
</div>
</td>
<td>
<% if post_version.can_undo?(CurrentUser.user) %>
<%= link_to "Undo", undo_post_version_path(post_version), method: :put, remote: true, class: "post-version-undo-link" %>
<% end %>
<% if post_version_listing == :revert && post_version.can_revert_to?(CurrentUser.user) %>
| <%= link_to "Revert to", revert_post_path(post_version.post_id, version_id: post_version.id), method: :put, remote: true %>
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>