Merge pull request #3010 from betagouv/fix-3008
[Fix #3008] Soft delete demarche button in manager
This commit is contained in:
commit
fc6fcb6f19
3 changed files with 10 additions and 0 deletions
|
@ -17,5 +17,12 @@ module Manager
|
||||||
end
|
end
|
||||||
redirect_to manager_procedure_path(procedure)
|
redirect_to manager_procedure_path(procedure)
|
||||||
end
|
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
|
||||||
end
|
end
|
||||||
|
|
|
@ -40,6 +40,8 @@ as well as a link to its edit page.
|
||||||
<% if procedure.publiee? && procedure.dossiers.empty? %>
|
<% if procedure.publiee? && procedure.dossiers.empty? %>
|
||||||
<%= link_to 'passer en brouillon', draft_manager_procedure_path(procedure), method: :post, class: 'button' %>
|
<%= link_to 'passer en brouillon', draft_manager_procedure_path(procedure), method: :post, class: 'button' %>
|
||||||
<% end %>
|
<% 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>
|
<div>
|
||||||
|
|
||||||
</header>
|
</header>
|
||||||
|
|
|
@ -9,6 +9,7 @@ Rails.application.routes.draw do
|
||||||
resources :procedures, only: [:index, :show] do
|
resources :procedures, only: [:index, :show] do
|
||||||
post 'whitelist', on: :member
|
post 'whitelist', on: :member
|
||||||
post 'draft', on: :member
|
post 'draft', on: :member
|
||||||
|
post 'hide', on: :member
|
||||||
end
|
end
|
||||||
|
|
||||||
resources :dossiers, only: [:index, :show] do
|
resources :dossiers, only: [:index, :show] do
|
||||||
|
|
Loading…
Reference in a new issue