wiki pages: add undelete link in navbar.
Also redirect back to the wiki page after deleting or undeleting it, rather than redirecting to the index.
This commit is contained in:
@@ -16,8 +16,10 @@
|
||||
<% if CurrentUser.is_member? %>
|
||||
<%= subnav_link_to "Edit", edit_wiki_page_path(@wiki_page.id), "data-shortcut": "e" %>
|
||||
<% end %>
|
||||
<% if CurrentUser.is_builder? && !@wiki_page.is_deleted? %>
|
||||
<%= subnav_link_to "Delete", wiki_page_path(@wiki_page), :remote => true, :method => :delete, :"data-shortcut" => "shift+d", :"data-confirm" => "Are you sure you want to delete this wiki page?" %>
|
||||
<% if CurrentUser.is_builder? && @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" %>
|
||||
<% elsif CurrentUser.is_builder? && !@wiki_page.is_deleted? %>
|
||||
<%= 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" %>
|
||||
<% end %>
|
||||
<% elsif @wiki_page_version %>
|
||||
<li>|</li>
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
window.location.href = "/wiki_pages";
|
||||
1
app/views/wiki_pages/update.js.erb
Normal file
1
app/views/wiki_pages/update.js.erb
Normal file
@@ -0,0 +1 @@
|
||||
location.reload();
|
||||
Reference in New Issue
Block a user