Combine version partials into one file

This commit is contained in:
BrokenEagle
2020-01-03 20:30:06 +00:00
parent 89df0a6ace
commit be92282990
15 changed files with 52 additions and 143 deletions

View File

@@ -1,5 +1,5 @@
<div id="p-<%= post_version_listing %>-listing">
<% if post_version_listing == :revert %>
<div id="p-<%= post_versions_listing_type %>-listing">
<% if post_versions_listing_type == :revert %>
<%= PostPresenter.preview(@post_versions.first.post, show_deleted: true) %>
<% end %>
@@ -9,7 +9,7 @@
<input type="checkbox" class="post-version-select-checkbox" <%= "disabled" unless post_version.can_undo?(CurrentUser.user) %>>
<% end %>
<% end %>
<% if post_version_listing == :standard %>
<% if post_versions_listing_type == :standard %>
<% t.column "Post" do |post_version| %>
<%= PostPresenter.preview(post_version.post, show_deleted: true) %>
<% end %>
@@ -34,7 +34,7 @@
<% 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) %>
<% if post_versions_listing_type == :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 %>
<% end %>