2023-03-24 11:33:08 +01:00
|
|
|
%section
|
2018-10-04 15:50:21 +02:00
|
|
|
%h1.tab-title
|
|
|
|
Avis des invités
|
2022-10-06 12:58:02 +02:00
|
|
|
%span.fr-badge= avis.count
|
2017-09-20 10:41:09 +02:00
|
|
|
|
2023-03-24 11:33:08 +01:00
|
|
|
%ul.list-style-type-none.fr-p-0
|
2018-10-04 15:50:21 +02:00
|
|
|
- avis.each do |avis|
|
2023-03-24 11:33:08 +01:00
|
|
|
%li
|
|
|
|
%h2.fr-text--sm.fr-mb-2w
|
|
|
|
%span.fr-icon-questionnaire-line.fr-mr-1v
|
|
|
|
= "#{t('claimant', scope: 'activerecord.attributes.avis')} :"
|
2023-03-24 15:09:54 +01:00
|
|
|
%span= (avis.claimant.email == expert_or_instructeur.email) ? 'Vous' : avis.claimant.email
|
2023-03-24 11:33:08 +01:00
|
|
|
- if avis.confidentiel?
|
|
|
|
%span.fr-badge.fr-badge--sm.fr-badge--warning.fr-badge--no-icon
|
|
|
|
= t('confidentiel', scope: 'activerecord.attributes.avis')
|
|
|
|
|
|
|
|
%span.fr-text--xs.fr-text-mention--grey.pull-right{ class: highlight_if_unseen_class(avis_seen_at, avis.created_at) }
|
|
|
|
= t('demande_envoyee_le', scope: 'views.shared.avis', date: l(avis.created_at, format: '%d/%m/%y à %H:%M'))
|
|
|
|
|
|
|
|
.border-left
|
2018-10-04 15:50:21 +02:00
|
|
|
%p= avis.introduction
|
2023-03-06 11:05:14 +01:00
|
|
|
- if avis.question_label
|
|
|
|
%p= avis.question_label
|
2017-09-20 10:41:09 +02:00
|
|
|
|
2023-03-24 11:33:08 +01:00
|
|
|
%h2.fr-text--sm.fr-mt-5w.fr-mb-2w
|
|
|
|
%span.fr-icon-message-2-line.fr-mr-1v
|
2023-03-24 15:09:54 +01:00
|
|
|
= (avis.expert.email == expert_or_instructeur.email) ? 'Vous' : avis.expert.email
|
2023-03-24 11:33:08 +01:00
|
|
|
- if avis.answer.present?
|
|
|
|
- if avis.revoked?
|
|
|
|
%span.fr-badge.fr-badge--sm{ class: highlight_if_unseen_class(avis_seen_at, avis.revoked_at) }
|
|
|
|
= t('demande_revoquee_le', scope: 'views.shared.avis', date: l(avis.revoked_at, format: '%d/%m/%y à %H:%M'))
|
|
|
|
|
|
|
|
%span.fr-text--xs.fr-text-mention--grey.pull-right{ class: highlight_if_unseen_class(avis_seen_at, avis.updated_at) }
|
|
|
|
= t('reponse_donnee_le', scope: 'views.shared.avis', date: l(avis.updated_at, format: '%d/%m/%y à %H:%M'))
|
|
|
|
- else
|
|
|
|
%span.fr-badge.fr-badge--sm
|
|
|
|
= t('en_attente', scope: 'views.shared.avis')
|
|
|
|
|
|
|
|
.fr-mb-2w
|
|
|
|
- if avis.reminded_at
|
|
|
|
%span.date.fr-text--xs.fr-text-mention--grey{ class: highlight_if_unseen_class(avis_seen_at, avis.reminded_at) }
|
|
|
|
= t('relance_effectuee_le', scope: 'views.shared.avis', date: l(avis.reminded_at, format: '%d/%m/%y à %H:%M'))
|
2023-03-24 15:09:54 +01:00
|
|
|
- if expert_or_instructeur.is_a?(Instructeur)
|
|
|
|
- if avis.answer.blank?
|
|
|
|
= link_to(t('remind', scope: 'helpers.label'), remind_instructeur_avis_path(avis.procedure, avis), class:'fr-btn fr-btn--sm fr-btn--tertiary-no-outline', data: { confirm: t('remind', scope: 'helpers.confirmation', email: avis.expert.email) })
|
2023-03-24 11:33:08 +01:00
|
|
|
|
2023-03-24 15:09:54 +01:00
|
|
|
- if avis.revokable_by?(expert_or_instructeur)
|
|
|
|
= link_to(t('revoke', scope: 'helpers.label'), revoquer_instructeur_avis_path(avis.procedure, avis), class:'fr-btn fr-btn--sm fr-btn--tertiary-no-outline', data: { confirm: t('revoke', scope: 'helpers.confirmation', email: avis.expert.email) }, method: :patch)
|
2023-03-24 11:33:08 +01:00
|
|
|
|
|
|
|
.border-left
|
|
|
|
- if avis.introduction_file.attached?
|
|
|
|
= render Attachment::ShowComponent.new(attachment: avis.introduction_file.attachment)
|
|
|
|
.fr-mb-2w
|
|
|
|
%p #{t('views.instructeurs.avis.introduction_file_explaination')} #{avis.claimant.email}
|
|
|
|
|
|
|
|
- if avis.piece_justificative_file.attached?
|
|
|
|
= render Attachment::ShowComponent.new(attachment: avis.piece_justificative_file.attachment)
|
|
|
|
.fr-mb-2w
|
|
|
|
- if [true, false].include? avis.question_answer
|
|
|
|
%p= t("question_answer.#{avis.question_answer}", scope: 'helpers.label')
|
|
|
|
|
|
|
|
= render SimpleFormatComponent.new(avis.answer, allow_a: false)
|
|
|
|
%hr.fr-mt-2w.fr-mb-2w
|