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:
evazion
2020-06-27 00:36:48 -05:00
parent f7f72e29b5
commit 3a6e4732bf
4 changed files with 13 additions and 15 deletions

View File

@@ -16,10 +16,12 @@
<% if policy(@wiki_page).edit? %>
<%= subnav_link_to "Edit", edit_wiki_page_path(@wiki_page.id), "data-shortcut": "e" %>
<% if @wiki_page.is_deleted? %>
<%= subnav_link_to "Undelete", wiki_page_path(@wiki_page.id), remote: true, method: :put, "data-params": "wiki_page[is_deleted]=false", "data-shortcut": "shift+d", "data-confirm": "Are you sure you want to undelete this wiki?" %>
<% else %>
<%= subnav_link_to "Delete", wiki_page_path(@wiki_page.id), remote: true, method: :put, "data-params": "wiki_page[is_deleted]=true", "data-shortcut": "shift+d", "data-confirm": "Are you sure you want to delete this wiki?" %>
<% if current_page?(action: :edit) %>
<% if @wiki_page.is_deleted? %>
<%= subnav_link_to "Undelete", wiki_page_path(@wiki_page.id), remote: true, method: :put, "data-params": "wiki_page[is_deleted]=false", "data-shortcut": "shift+d", "data-confirm": "Are you sure you want to undelete this wiki?" %>
<% else %>
<%= subnav_link_to "Delete", wiki_page_path(@wiki_page.id), remote: true, method: :put, "data-params": "wiki_page[is_deleted]=true", "data-shortcut": "shift+d", "data-confirm": "Are you sure you want to delete this wiki?" %>
<% end %>
<% end %>
<% end %>
<% elsif @wiki_page_version %>