2023-03-31 16:10:47 +02:00
|
|
|
= render NestedForms::FormOwnerComponent.new
|
2023-12-10 18:25:58 +01:00
|
|
|
= form_for(commentaire, url: form_url, html: { multipart: local_assigns.has_key?(:dossier), data: { controller: 'persisted-form', persisted_form_key_value: dom_id(local_assigns.fetch(:dossier, local_assigns.fetch(:last_commentaire, current_user))) } }) do |f|
|
2021-04-17 18:49:00 +02:00
|
|
|
- placeholder = t('views.shared.dossiers.messages.form.write_message_to_administration_placeholder')
|
2023-12-10 18:25:58 +01:00
|
|
|
- if local_assigns.has_key?(:last_commentaire)
|
|
|
|
= f.hidden_field :last_commentaire, value: last_commentaire.id, name: :id
|
|
|
|
- elsif local_assigns.has_key?(:dossier) && instructeur_signed_in? || administrateur_signed_in? || expert_signed_in?
|
2021-04-17 18:49:00 +02:00
|
|
|
- placeholder = t('views.shared.dossiers.messages.form.write_message_placeholder')
|
2023-01-24 16:31:46 +01:00
|
|
|
%p.mandatory-explanation= t('asterisk_html', scope: [:utils])
|
2017-11-28 11:37:42 +01:00
|
|
|
|
2023-07-17 09:32:14 +02:00
|
|
|
= render Dsfr::InputComponent.new(form: f, attribute: :body, input_type: :text_area, opts: { rows: 5, placeholder: placeholder, title: placeholder, class: 'fr-input message-textarea'})
|
2023-12-10 18:25:58 +01:00
|
|
|
- if local_assigns.has_key?(:dossier)
|
2024-02-13 08:04:27 +01:00
|
|
|
.fr-mt-3w{ data: { controller: "file-input-reset", delete_label: t('views.shared.messages.remove_file') } }
|
|
|
|
= render Attachment::MultipleComponent.new(attached_file: commentaire.piece_jointe)
|
|
|
|
%ul{ data: { 'file-input-reset-target': 'fileList' } }
|
2023-03-13 11:42:11 +01:00
|
|
|
|
2024-04-15 12:38:50 +02:00
|
|
|
.fr-mt-3w
|
|
|
|
= f.submit t('views.shared.dossiers.messages.form.send_message'), class: 'fr-btn', data: { disable: true }
|