Rework artist versions index view

- Added a changes column explicitly listing all of the changes
-- This makes it more in line with the other version views now
- Does a symmetric difference on the array fields to detect changes
This commit is contained in:
BrokenEagle
2020-02-08 08:25:36 +00:00
parent de1324098d
commit 7b1efd1204
3 changed files with 46 additions and 15 deletions

View File

@@ -1,24 +1,22 @@
<div id="p-<%= artist_versions_listing_type %>-listing">
<div id="p-<%= listing_type(:artist_id) %>-listing">
<%= table_for @artist_versions, {class: "striped autofit", width: "100%"} do |t| %>
<% t.column "Name" do |artist_version| %>
<%= link_to artist_version.name, artist_path(artist_version.artist_id) %>
<%= link_to "»", artist_versions_path(search: {artist_id: artist_version.artist_id}) %>
<% if !artist_version.is_active? %>
(deleted)
<% end %>
<% if artist_version.group_name.present? %>
<p>(group: <%= artist_version.group_name %>)</p>
<% end %>
<%= link_to "»", artist_versions_path(search: {artist_id: artist_version.artist_id}, anchor: "artist-version-#{artist_version.id}") %>
<% end %>
<% t.column "Other Names" do |artist_version| %>
<% if artist_version.group_name.present? %>
<p><b>Group:</b><br>&ensp;<%= artist_version.group_name %></p>
<% end %>
<%= artist_version_other_names_diff(artist_version) %>
<% end %>
<% t.column "URLs", td: {class: "col-expand"} do |artist_version| %>
<%= artist_version_urls_diff(artist_version) %>
<% end %>
<% t.column "Changes" do |artist_version| %>
<%= status_diff_html(artist_version) %>
<% end %>
<% t.column "Updated" do |artist_version| %>
<%= link_to_user artist_version.updater %>
<%= link_to "»", artist_versions_path(search: { updater_name: artist_version.updater.name }) %>
@@ -26,7 +24,7 @@
<%= compact_time(artist_version.updated_at) %>
</p>
<% end %>
<% if artist_versions_listing_type == :revert %>
<% if listing_type(:artist_id) == :revert %>
<% t.column column: "control" do |artist_version| %>
<%= link_to "Revert to", revert_artist_path(artist_version.artist_id, version_id: artist_version.id), method: :put, "data-confirm": "Are you sure you want to revert to this version?" %>
<% end %>