Fix #4511: Remove delete/undelete controls from the artist index.
* Only show the delete artist button on the artist edit page. * Only show the delete pool button on the pool edit page. * Only show the delete wiki button on the wiki edit page.
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
<%= subnav_link_to "Edit", edit_artist_path(@artist), :"data-shortcut" => "e" %>
|
||||
<% end %>
|
||||
<%= subnav_link_to "History", artist_versions_path(:search => {:artist_id => @artist.id}) %>
|
||||
<% if policy(@artist).update? %>
|
||||
<% if current_page?(action: "edit") && policy(@artist).update? %>
|
||||
<% if @artist.is_deleted? %>
|
||||
<%= subnav_link_to "Undelete", artist_path(@artist, format: "js"), method: :put, data: {confirm: "Are you sure you want to undelete this artist?", params: "artist[is_deleted]=false"}, remote: true %>
|
||||
<% else %>
|
||||
|
||||
@@ -32,12 +32,6 @@
|
||||
<% t.column column: "control" do |artist| %>
|
||||
<% if policy(artist).update? %>
|
||||
<%= link_to "Edit", edit_artist_path(artist) %>
|
||||
|
||||
<% if artist.is_deleted? %>
|
||||
| <%= link_to "Undelete", artist_path(artist, artist: { is_deleted: false }), method: :put, remote: true %>
|
||||
<% else %>
|
||||
| <%= link_to "Delete", artist_path(artist, artist: { is_deleted: true }), method: :put, remote: true %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user