diff --git a/app/helpers/artist_versions_helper.rb b/app/helpers/artist_versions_helper.rb index 1f55b471e..87ed000c1 100644 --- a/app/helpers/artist_versions_helper.rb +++ b/app/helpers/artist_versions_helper.rb @@ -1,4 +1,8 @@ module ArtistVersionsHelper + def artist_versions_listing_type + params.dig(:search, :artist_id).present? && CurrentUser.is_member? ? :revert : :standard + end + def artist_version_other_names_diff(artist_version) new_names = artist_version.other_names old_names = artist_version.previous.try(:other_names) diff --git a/app/views/artist_versions/_revert_listing.html.erb b/app/views/artist_versions/_revert_listing.html.erb deleted file mode 100644 index b73fb7112..000000000 --- a/app/views/artist_versions/_revert_listing.html.erb +++ /dev/null @@ -1,54 +0,0 @@ -
| Name | -Other Names | -Group | -Updated | -Updated by | - <% if CurrentUser.is_moderator? %> -IP Address | - <% end %> -Active | -URLs | - <% if CurrentUser.is_member? %> -- <% end %> - | ||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| <%= link_to artist_version.name, artist_path(artist_version.artist_id) %> | -<%= artist_version_other_names_diff(artist_version) %> | -<%= artist_version.group_name %> | - <% else %> -- | - | - <% end %> - | <%= compact_time artist_version.created_at %> | -<%= link_to_user artist_version.updater %> | - <% if CurrentUser.is_moderator? %> -- <%= link_to_ip artist_version.updater_ip_addr %> - | - <% end %> -<%= artist_version.is_active? %> | - <% if artist_version.visible? %> -<%= artist_version_urls_diff(artist_version) %> | - <% else %> -- <% end %> - <% if CurrentUser.is_member? %> - | - <%= 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 %> -
| Name | -Other Names | -Group | +Name | +Other Names | +URLs | Updated | -Updated by | - <% if CurrentUser.is_moderator? %> -IP Address | + <% if artist_versions_listing_type == :revert %> +<% end %> - | Active | -URLs |
<%= 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? %>
+ (group: <%= artist_version.group_name %>) + <% end %> |
- <%= artist_version_other_names_diff(artist_version) %> | -<%= artist_version.group_name %> | +<%= artist_version_other_names_diff(artist_version) %> | <% else %>- | <% end %> - | <%= compact_time artist_version.created_at %> | -<%= link_to_user artist_version.updater %> | - <% if CurrentUser.is_moderator? %> -- <%= link_to_ip artist_version.updater_ip_addr %> - | - <% end %> -<%= artist_version.is_active? %> | - <% if artist_version.visible? %> -<%= artist_version_urls_diff(artist_version) %> | - <% else %> -+ | + <%= artist_version_urls_diff(artist_version) if artist_version.visible? %> + | +
+ <%= link_to_user artist_version.updater %>
+ <%= link_to "»", artist_versions_path(search: { updater_name: artist_version.updater_name }) %>
+ + <%= compact_time(artist_version.updated_at) %> + <% if CurrentUser.is_moderator? %> + (<%= link_to_ip artist_version.updater_ip_addr %>) + <% end %> + + |
+ <% if artist_versions_listing_type == :revert %>
+ <%= 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 %> <% end %> diff --git a/app/views/artist_versions/index.html.erb b/app/views/artist_versions/index.html.erb index 7dbfd0d1d..824d16685 100644 --- a/app/views/artist_versions/index.html.erb +++ b/app/views/artist_versions/index.html.erb @@ -2,12 +2,7 @@
|---|