[Fix #3008] Soft delete demarche button in manager
This commit is contained in:
parent
53699e71d9
commit
3ce9dd39af
3 changed files with 10 additions and 0 deletions
|
@ -17,5 +17,12 @@ module Manager
|
|||
end
|
||||
redirect_to manager_procedure_path(procedure)
|
||||
end
|
||||
|
||||
def hide
|
||||
procedure = Procedure.find(params[:id])
|
||||
procedure.hide!
|
||||
flash[:notice] = "La démarche a bien été supprimée, en cas d'erreur contactez un développeur."
|
||||
redirect_to manager_procedure_path(procedure)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -40,6 +40,8 @@ as well as a link to its edit page.
|
|||
<% if procedure.publiee? && procedure.dossiers.empty? %>
|
||||
<%= link_to 'passer en brouillon', draft_manager_procedure_path(procedure), method: :post, class: 'button' %>
|
||||
<% end %>
|
||||
|
||||
<%= link_to 'supprimer la démarche', hide_manager_procedure_path(procedure), method: :post, class: 'button', data: { confirm: "Confirmez-vous la suppression de la démarche ?" } %>
|
||||
<div>
|
||||
|
||||
</header>
|
||||
|
|
|
@ -9,6 +9,7 @@ Rails.application.routes.draw do
|
|||
resources :procedures, only: [:index, :show] do
|
||||
post 'whitelist', on: :member
|
||||
post 'draft', on: :member
|
||||
post 'hide', on: :member
|
||||
end
|
||||
|
||||
resources :dossiers, only: [:index, :show] do
|
||||
|
|
Loading…
Reference in a new issue