feat(attestation): can create an attestation v2

This commit is contained in:
Colin Darie 2024-01-12 12:49:49 +01:00
parent fd829351e8
commit fe2661d37c
No known key found for this signature in database
GPG key ID: 8C76CADD40253590
3 changed files with 6 additions and 2 deletions

View file

@ -69,6 +69,10 @@ module Administrateurs
@attestation_template.update!(attestation_params)
end
def create
@attestation_template.update!(editor_params)
end
private
def ensure_feature_active

View file

@ -43,7 +43,7 @@
%h2.fr-h6 En-tête
.fr-fieldset__element{ class: class_names("hidden" => !@attestation_template.official_layout?), data: { "attestation-target": 'logoMarianneLabelFieldset'} }
= render Dsfr::InputComponent.new(form: f, attribute: :label_logo, input_type: :text_area, required: false, opts: { rows: 3, data: { controller: :textarea, textarea_max_rows_value: 3 } }) do |c|
= render Dsfr::InputComponent.new(form: f, attribute: :label_logo, input_type: :text_area, required: @attestation_template.official_layout?, opts: { rows: 3, data: { controller: :textarea, textarea_max_rows_value: 3 } }) do |c|
- c.with_hint { "Exemple: Ministère de la Mer. 3 lignes maximum" }
.fr-fieldset__element{ data: { attestation_target: 'logoAttachmentFieldset' } }

View file

@ -647,7 +647,7 @@ Rails.application.routes.draw do
get 'add_champ_engagement_juridique'
end
resource :attestation_template_v2, only: [:show, :edit, :update]
resource :attestation_template_v2, only: [:show, :edit, :update, :create]
resource :dossier_submitted_message, only: [:edit, :update, :create]
# ADDED TO ACCESS IT FROM THE IFRAME