demarches-normaliennes/app/views/instructeurs/avis/_list.html.haml

60 lines
3.8 KiB
Text
Raw Normal View History

%section.list-avis
%h1.tab-title
Avis des invités
%span.fr-badge= avis.count
%ul
- avis.each do |avis|
%li.one-avis.flex.align-start
.width-100
%h2.claimant.fr-font--md.font-weight-normal
2020-07-21 10:46:55 +02:00
= "#{t('claimant', scope: 'activerecord.attributes.avis')} :"
%span.font-weight-bold= (avis.claimant.email == current_instructeur.email) ? 'Vous' : avis.claimant.email
- if avis.confidentiel?
%span.confidentiel
2020-07-21 10:46:55 +02:00
= t('confidentiel', scope: 'activerecord.attributes.avis')
%span.icon.lock{ title: t('confidentiel', scope: 'helpers.hint') }
%span.date.fr-text--xs.fr-text-mention--grey{ class: highlight_if_unseen_class(avis_seen_at, avis.created_at) }
2020-07-21 10:46:55 +02:00
= t('demande_envoyee_le', scope: 'views.shared.avis', date: l(avis.created_at, format: '%d/%m/%y à %H:%M'))
%p= avis.introduction
- if avis.question_label
%p= avis.question_label
.answer.flex.align-start
%span.icon.bubble.avis-icon
.width-100
%h2.instructeur.fr-font--md.font-weight-normal
2021-02-25 09:44:42 +01:00
= (avis.expert.email == current_instructeur.email) ? 'Vous' : avis.expert.email
- if avis.answer.present?
2020-07-16 11:14:37 +02:00
- if avis.revoked?
%span.fr-text--xs.fr-text-mention--grey{ class: highlight_if_unseen_class(avis_seen_at, avis.revoked_at) }
2020-07-21 10:46:55 +02:00
= t('demande_revoquee_le', scope: 'views.shared.avis', date: l(avis.revoked_at, format: '%d/%m/%y à %H:%M'))
2020-07-16 11:14:37 +02:00
- else
- if avis.revokable_by?(current_instructeur)
%span.fr-text--xs.fr-text-mention--grey= link_to(t('revoke', scope: 'helpers.label'), revoquer_instructeur_avis_path(avis.procedure, avis), data: { confirm: t('revoke', scope: 'helpers.confirmation', email: avis.expert.email) }, method: :patch)
%span.date.fr-text--xs.fr-text-mention--grey{ class: highlight_if_unseen_class(avis_seen_at, avis.updated_at) }
2020-07-21 10:46:55 +02:00
= t('reponse_donnee_le', scope: 'views.shared.avis', date: l(avis.updated_at, format: '%d/%m/%y à %H:%M'))
- else
%span.fr-text--xs.fr-text-mention--grey
2020-07-21 10:46:55 +02:00
= t('en_attente', scope: 'views.shared.avis')
2020-07-20 16:26:16 +02:00
|
%span= link_to(t('remind', scope: 'helpers.label'), remind_instructeur_avis_path(avis.procedure, avis), data: { confirm: t('remind', scope: 'helpers.confirmation', email: avis.expert.email) })
- if avis.revokable_by?(current_instructeur)
2020-07-20 16:26:16 +02:00
|
2021-02-25 09:44:42 +01:00
= link_to(t('revoke', scope: 'helpers.label'), revoquer_instructeur_avis_path(avis.procedure, avis), data: { confirm: t('revoke', scope: 'helpers.confirmation', email: avis.expert.email) }, method: :patch)
2023-01-23 22:10:54 +01:00
- 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'))
- if avis.introduction_file.attached?
= render Attachment::ShowComponent.new(attachment: avis.introduction_file.attachment)
.answer-body.mb-3
%p #{t('views.instructeurs.avis.introduction_file_explaination')} #{avis.claimant.email}
2019-05-21 14:21:13 +02:00
- if avis.piece_justificative_file.attached?
= render Attachment::ShowComponent.new(attachment: avis.piece_justificative_file.attachment)
.answer-body
- 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)