Merge pull request #2662 from betagouv/fix-2332
[Fix #2332] Allow the notice deletion
This commit is contained in:
commit
cea67efd44
3 changed files with 13 additions and 0 deletions
|
@ -228,6 +228,15 @@ class Admin::ProceduresController < AdminController
|
|||
redirect_to edit_admin_procedure_path(procedure)
|
||||
end
|
||||
|
||||
def delete_notice
|
||||
procedure = Procedure.find(params[:id])
|
||||
|
||||
procedure.notice.purge_later
|
||||
|
||||
flash.notice = 'la notice a bien été supprimée'
|
||||
redirect_to edit_admin_procedure_path(procedure)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def cloned_from_library?
|
||||
|
|
|
@ -60,6 +60,9 @@
|
|||
- else
|
||||
%a{ href: url_for(notice), target: '_blank' }
|
||||
= notice.filename.to_s
|
||||
\-
|
||||
= link_to 'supprimer', delete_notice_admin_procedure_path(@procedure),
|
||||
method: :delete
|
||||
%br
|
||||
Modifier :
|
||||
= f.file_field :notice,
|
||||
|
|
|
@ -194,6 +194,7 @@ Rails.application.routes.draw do
|
|||
member do
|
||||
post :hide
|
||||
delete :delete_deliberation
|
||||
delete :delete_notice
|
||||
end
|
||||
|
||||
resources :types_de_champ, only: [:destroy]
|
||||
|
|
Loading…
Reference in a new issue