From 775eb16d95c3d58c98eeadbf3bade9a74f1f56e3 Mon Sep 17 00:00:00 2001 From: Damien Le Thiec Date: Thu, 29 Dec 2022 16:11:59 +0100 Subject: [PATCH] Add link to prefill description from procedure show --- app/views/administrateurs/procedures/show.html.haml | 6 +++++- config/routes.rb | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/views/administrateurs/procedures/show.html.haml b/app/views/administrateurs/procedures/show.html.haml index 0088f2cde..63741b26b 100644 --- a/app/views/administrateurs/procedures/show.html.haml +++ b/app/views/administrateurs/procedures/show.html.haml @@ -28,6 +28,11 @@ %span.icon.reply Envoyer une copie + - if @procedure.publiee? || @procedure.brouillon? + = link_to preremplir_path(@procedure.path), target: "_blank", rel: :noopener, class: 'button' do + %span.icon.edit + Préremplir via lien ou API + - if !@procedure.publiee? && !@procedure.close? && !@procedure.depubliee? = link_to 'Publier', admin_procedure_publication_path(@procedure), class: 'button primary', id: 'publish-procedure-link', data: { disable_with: "Publication..." } @@ -75,4 +80,3 @@ = render Procedure::Card::APIParticulierComponent.new(procedure: @procedure) = render Procedure::Card::MonAvisComponent.new(procedure: @procedure) = render Procedure::Card::DossierSubmittedMessageComponent.new(procedure: @procedure) - diff --git a/config/routes.rb b/config/routes.rb index 2f8be3a6c..d7a66e23f 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -191,7 +191,7 @@ Rails.application.routes.draw do post "webhooks/helpscout_support_dev", to: "webhook#helpscout_support_dev" match "webhooks/helpscout", to: lambda { |_| [204, {}, nil] }, via: :head - get '/preremplir/:path', to: 'prefill_descriptions#edit' + get '/preremplir/:path', to: 'prefill_descriptions#edit', as: :preremplir resources :procedures, only: [], param: :path do member do resource :prefill_description, only: :update