demarches-normaliennes/app/views/admin/attestation_templates/edit.html.haml

90 lines
3.7 KiB
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

= render partial: 'admin/closed_mail_template_attestation_inconsistency_alert'
#attestation-template-edit.row.white-back
= form_for @attestation_template, url: admin_procedure_attestation_template_path do |f|
.row
.col-md-10
%h1
Attestation
- if @attestation_template.activated?
%small.text-success Activée
- else
%small Désactivée
%p.notice
Lattestation, si elle est activée, est émise au moment où un dossier est accepté.
%br
Lemail daccusé dacceptation envoyé à lusager comporte alors un lien vers lattestation ;
celle-ci est également disponible au téléchargement depuis lespace personnel de lusager.
.image-upload
- if @attestation_template.logo.attached?
= image_tag @attestation_template.logo_url, class: 'thumbnail'
.form-group
= f.label :logo, "Logo de l'attestation"
- if @attestation_template.logo.attached?
= link_to 'Supprimer le logo', admin_procedure_attestation_template_logo_path(@procedure), method: :delete
= f.file_field :logo, accept: 'image/png,image/jpg,image/jpeg'
%p.help-block
Fichier accepté : JPG / JPEG / PNG
%br
Dimensions conseillées : au minimum 500 px de largeur ou de hauteur, poids maximum : 0,5 Mo.
.form-group
= f.label :title, 'Titre'
= f.text_field :title, class: 'form-control'
.form-group
= f.label :body, 'Corps du document'
~ f.text_area :body, class: 'form-control', rows: 10
.row
.col-md-12.balises
%table.table.table-striped
%tr
%th.col-md-3
Balise
%th
Description
- @attestation_template.tags.each do |tag|
%tr
%td
%code{ style: "white-space: pre-wrap;" }
= "--#{tag[:libelle]}--"
%td
= tag[:description]
.image-upload
- if @attestation_template.signature.attached?
= image_tag @attestation_template.signature_url, class: 'thumbnail'
.form-group
= f.label :signature, "Tampon de l'attestation"
- if @attestation_template.signature.attached?
= link_to 'Supprimer le tampon', admin_procedure_attestation_template_signature_path(@procedure), method: :delete
= f.file_field :signature, accept: 'image/png, image/jpg, image/jpeg'
%p.help-block
Fichier accepté : JPG / JPEG / PNG
%br
Dimensions conseillées : au minimum 500 px de largeur ou de hauteur, poids maximum : 0,5 Mo.
.form-group
= f.label :footer, 'Pied de page'
= f.text_field :footer, class: 'form-control', maxlength: 190
- if @attestation_template.activated && @procedure.locked?
.row
.col-md-12
.pull-right
%p.help-block Lattestation ne peut plus être désactivée car la démarche a déjà été publiée.
%button.btn.btn-primary{ formaction: admin_procedure_attestation_template_preview_path, formtarget: '_blank' } Prévisualiser
.pull-right
- if @attestation_template.activated && !@procedure.locked?
%button.btn.btn-warning{ formaction: admin_procedure_attestation_template_disactivate_path } désactiver l'attestation
- if @attestation_template.new_record? || !@attestation_template.activated
%button.btn.btn-success Activer l'attestation
- else
- save_data = @procedure.locked? ? { toggle: :tooltip, confirm: "Attention: les modifications n'affecteront pas les attestations déjà délivrées." } : nil
%button.btn.btn-success{ data: save_data } Enregistrer