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)
|
redirect_to edit_admin_procedure_path(procedure)
|
||||||
end
|
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
|
private
|
||||||
|
|
||||||
def cloned_from_library?
|
def cloned_from_library?
|
||||||
|
|
|
@ -60,6 +60,9 @@
|
||||||
- else
|
- else
|
||||||
%a{ href: url_for(notice), target: '_blank' }
|
%a{ href: url_for(notice), target: '_blank' }
|
||||||
= notice.filename.to_s
|
= notice.filename.to_s
|
||||||
|
\-
|
||||||
|
= link_to 'supprimer', delete_notice_admin_procedure_path(@procedure),
|
||||||
|
method: :delete
|
||||||
%br
|
%br
|
||||||
Modifier :
|
Modifier :
|
||||||
= f.file_field :notice,
|
= f.file_field :notice,
|
||||||
|
|
|
@ -194,6 +194,7 @@ Rails.application.routes.draw do
|
||||||
member do
|
member do
|
||||||
post :hide
|
post :hide
|
||||||
delete :delete_deliberation
|
delete :delete_deliberation
|
||||||
|
delete :delete_notice
|
||||||
end
|
end
|
||||||
|
|
||||||
resources :types_de_champ, only: [:destroy]
|
resources :types_de_champ, only: [:destroy]
|
||||||
|
|
Loading…
Reference in a new issue