demarches-normaliennes/app/views/administrateurs/attestation_template_v2s/edit.html.haml

17 lines
1,017 B
Text
Raw Normal View History

#attestation-edit.fr-container.mt-2{ data: { controller: 'tiptap' } }
= form_for @attestation_template, url: admin_procedure_attestation_template_v2_path(@procedure), data: { turbo: 'true', controller: 'autosubmit' } do |form|
.flex.flex-gap-2
- @buttons.each do |buttons|
.flex.flex-gap-1
- buttons.each do |(label, action, icon)|
%button.fr-btn.fr-btn--secondary.fr-btn--sm{ type: 'button', title: label, class: "fr-icon-#{icon}", data: { action: 'click->tiptap#menuButton', tiptap_target: 'button', tiptap_action: action } }
= label
2023-11-15 09:53:07 +01:00
.editor.mt-2{ data: { tiptap_target: 'editor' } }
= form.hidden_field :tiptap_body, data: { tiptap_target: 'input' }
2023-11-15 09:53:07 +01:00
%ul.mt-2.flex.wrap.flex-gap-1
- @attestation_template.tags.each do |tag|
%li.fr-badge.fr-badge--sm{ role: 'button', title: tag[:description], data: { action: 'click->tiptap#insertTag', tiptap_target: 'tag', tag_id: tag[:id], tag_label: tag[:libelle] } }
= tag[:libelle]