2021-11-25 16:26:55 +01:00
= render partial: 'administrateurs/breadcrumbs',
2022-08-17 13:53:07 +02:00
locals: { steps: [['Démarches', admin_procedures_path],
2022-09-09 13:08:24 +02:00
[@procedure.libelle.truncate_words(10), admin_procedure_path(@procedure)],
2024-05-23 17:06:20 +02:00
['Avis externes']] }
2021-02-11 20:23:11 +01:00
2024-05-23 17:06:20 +02:00
.fr-container
%h1.fr-h2
Avis externes
2021-03-30 17:55:07 +02:00
2024-05-28 16:40:15 +02:00
= render Dsfr::CalloutComponent.new(title: nil) do |c|
- c.with_body do
Pendant l'instruction d'un dossier, les instructeurs peuvent demander leur avis à un ou plusieurs experts.
%p
= link_to('Comment gérer les avis externes', t('.experts_doc.url'),
title: t('.experts_doc.title'),
**external_link_attributes)
%ul.fr-toggle__list
%li
2021-04-16 11:13:47 +02:00
= form_for @procedure,
method: :put,
url: allow_expert_review_admin_procedure_path(@procedure),
2024-05-28 16:40:15 +02:00
data: { controller: 'autosubmit', turbo: 'true' } do |f|
= render Dsfr::ToggleComponent.new(form: f,
target: :allow_expert_review,
title: t('.titles.allow_invite_experts'),
hint: t('.descriptions.allow_invite_experts'),
disabled: false,
extra_class_names: 'fr-toggle--border-bottom')
2021-03-30 17:55:07 +02:00
2021-04-16 11:13:47 +02:00
- if @procedure.allow_expert_review?
2024-05-28 16:40:15 +02:00
%li
= form_for @procedure,
method: :put,
url: allow_expert_messaging_admin_procedure_path(@procedure),
data: { controller: 'autosubmit', turbo: 'true' } do |f|
= render Dsfr::ToggleComponent.new(form: f,
target: :allow_expert_messaging,
title: t('.titles.allow_expert_messaging'),
hint: t('.descriptions.allow_expert_messaging'),
disabled: false,
extra_class_names: 'fr-toggle--border-bottom')
%li
2021-04-16 11:13:47 +02:00
= form_for @procedure,
method: :put,
url: experts_require_administrateur_invitation_admin_procedure_path(@procedure),
2024-05-28 16:40:15 +02:00
data: { controller: 'autosubmit', turbo: 'true' } do |f|
= render Dsfr::ToggleComponent.new(form: f,
target: :experts_require_administrateur_invitation,
title: t('.titles.manage_procedure_experts'),
hint: t('.descriptions.manage_procedure_experts'),
disabled: false)
2021-03-30 17:55:07 +02:00
2021-04-16 11:13:47 +02:00
2024-05-28 16:40:15 +02:00
- if @procedure.experts_require_administrateur_invitation?
.card
2024-07-01 10:41:16 +02:00
= render Procedure::InvitationWithTypoComponent.new(maybe_typos: @maybe_typos, url: admin_procedure_experts_path(@procedure), title: "Avant d'ajouter l'email à la liste d'expert prédéfinie, veuillez confirmer" )
2024-05-28 16:40:15 +02:00
= form_for :experts_procedure,
url: admin_procedure_experts_path(@procedure),
html: { class: 'form' } do |f|
2021-04-16 11:13:47 +02:00
2024-05-28 16:40:15 +02:00
.instructeur-wrapper
%p#experts-emails Entrez les adresses emails des experts que vous souhaitez ajouter à la liste prédéfinie
= hidden_field_tag :emails, nil
= react_component("ComboMultiple",
options: [],
selected: [], disabled: [],
group: '.instructeur-wrapper',
name: 'emails',
label: 'Emails',
describedby: 'experts-emails',
acceptNewValues: true)
= f.submit 'Ajouter à la liste', class: 'fr-btn'
2023-03-23 17:14:25 +01:00
- if @experts_procedure.present?
2024-05-28 16:40:15 +02:00
.fr-table.fr-table--no-caption.fr-table--layout-fixed.fr-mt-3w
%table
%thead
2021-04-16 11:13:47 +02:00
%tr
2024-05-28 16:40:15 +02:00
%th Liste des experts
%th Nombre d’ avis
2021-04-16 11:13:47 +02:00
- if @procedure.experts_require_administrateur_invitation
2024-05-28 16:40:15 +02:00
%th Notifier des décisions sur les dossiers
2023-03-23 17:14:25 +01:00
- if @procedure.experts_require_administrateur_invitation
2024-05-28 16:40:15 +02:00
%th Action
%tbody
- @experts_procedure.each do |expert_procedure|
%tr
%td
= dsfr_icon('fr-icon-user-fill')
= expert_procedure.expert.email
%td.text-center
= expert_procedure.avis.count
- if @procedure.experts_require_administrateur_invitation
%td.text-center
= form_for expert_procedure,
url: admin_procedure_expert_path(id: expert_procedure),
method: :put,
data: { turbo: true },
html: { class: 'form procedure-form__column--form no-background' } do |f|
%label.toggle-switch{ data: { controller: 'autosubmit' } }
= f.check_box :allow_decision_access, class: 'toggle-switch-checkbox'
%span.toggle-switch-control.round
%span.toggle-switch-label.on
%span.toggle-switch-label.off
- if @procedure.experts_require_administrateur_invitation
%td.actions= button_to 'retirer',
admin_procedure_expert_path(id: expert_procedure, procedure: @procedure),
method: :delete,
data: { confirm: "Êtes-vous sûr de vouloir révoquer l'expert « #{expert_procedure.expert.email} » de la démarche #{expert_procedure.procedure.libelle} ? Les instructeurs ne pourront plus lui demander d’ avis" },
class: 'fr-btn fr-btn--secondary'
2023-03-23 17:14:25 +01:00
- else
.blank-tab
%h2.empty-text Aucun expert invité pour le moment.
%p.empty-text-details Les instructeurs de cette démarche n’ ont pas encore fait appel aux experts.
2024-05-23 17:06:20 +02:00
2024-05-27 17:56:05 +02:00
= render Procedure::FixedFooterComponent.new(procedure: @procedure)