/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).
This commit is contained in:
evazion
2019-09-28 13:59:24 -05:00
parent 609a440d1c
commit 085e903e02
2 changed files with 28 additions and 28 deletions

View File

@@ -7,18 +7,13 @@
<label><input type="checkbox" id="post-version-select-all-checkbox" class="post-version-select-checkbox"></label>
</th>
<% end %>
<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_moderator? %>
<th width="10%">IP Address</th>
<% if post_version_listing == :standard %>
<th>Post</th>
<% end %>
<th>Version</th>
<th>Tags</th>
<% if CurrentUser.is_member? %>
<th width="7%"></th>
<% end %>
<th>Updated</th>
<th></th>
</tr>
</thead>
<tbody>
@@ -29,24 +24,23 @@
<input type="checkbox" class="post-version-select-checkbox" <%= "disabled" unless post_version.can_undo?(CurrentUser.user) %>>
</td>
<% end %>
<td>
<%= link_to("#{post_version.post_id}.#{post_version.id}", post_path(post_version.post_id)) %>
<%= link_to "»", post_versions_path(search: {post_id: post_version.post_id}) %>
</td>
<td><%= compact_time(post_version.updated_at) %></td>
<td>
<% if post_version.updater %>
<%= link_to_user(post_version.updater) %>
<% end %>
</td>
<td><%= post_version.rating %></td>
<td><%= post_version.parent_id %></td>
<% if CurrentUser.is_moderator? %>
<td>
<%= link_to_ip post_version.updater_ip_addr %>
</td>
<% 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" %>

View File

@@ -1,8 +1,14 @@
<div id="c-post-versions">
<div id="a-index">
<h1>Changes</h1>
<% if post_version_listing == :revert %>
<h1>Tag History: <%= link_to "Post ##{params.dig(:search, :post_id)}", @post_versions[0].post %></h1>
<%= PostPresenter.preview(@post_versions[0].post, show_deleted: true) %>
<% else %>
<h1>Tag History</h1>
<% end %>
<p>Recent updates may not have been processed yet. The most recently processed version was <%= time_ago_in_words_tagged(PostArchive.maximum(:updated_at)) %>.</p>
<%= render "posts/partials/common/inline_blacklist" %>
<p class="fineprint">Recent updates may not have been processed yet. The most recently processed version was <%= time_ago_in_words_tagged(PostArchive.maximum(:updated_at)) %>.</p>
<% if @post_versions.length == 0 %>
<%= render "post_sets/blank" %>