demarches-normaliennes/app/views/administrateurs/experts_procedures/index.html.haml

110 lines
5.1 KiB
Text
Raw Normal View History

= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [['Démarches', admin_procedures_path],
[@procedure.libelle.truncate_words(10), admin_procedure_path(@procedure)],
['Liste des experts']] }
2021-02-11 20:23:11 +01:00
.container
2023-03-23 17:14:25 +01:00
%h1.page-title.mt-2= t('.titles.main', libelle: @procedure.libelle)
2021-03-30 17:55:07 +02:00
.container.groupe-instructeur
.card
2023-03-23 17:14:25 +01:00
.card-title= t('.titles.allow_invite_experts')
%p= t('.descriptions.allow_invite_experts')
2021-04-16 11:13:47 +02:00
= form_for @procedure,
method: :put,
url: allow_expert_review_admin_procedure_path(@procedure),
html: { class: 'form procedure-form__column--form no-background' } do |f|
%label.toggle-switch{ data: { controller: 'autosubmit' } }
= f.check_box :allow_expert_review, class: 'toggle-switch-checkbox'
2021-04-16 11:13:47 +02:00
%span.toggle-switch-control.round
%span.toggle-switch-label.on
%span.toggle-switch-label.off
2021-03-30 17:55:07 +02:00
2021-04-16 11:13:47 +02:00
- if @procedure.allow_expert_review?
.card
2023-03-23 17:14:25 +01:00
.card-title= t('.titles.manage_procedure_experts')
%p= t('.descriptions.manage_procedure_experts')
2021-04-16 11:13:47 +02:00
= form_for @procedure,
method: :put,
url: experts_require_administrateur_invitation_admin_procedure_path(@procedure),
html: { class: 'form procedure-form__column--form no-background' } do |f|
%label.toggle-switch{ data: { controller: 'autosubmit' } }
= f.check_box :experts_require_administrateur_invitation, class: 'toggle-switch-checkbox'
2021-04-16 11:13:47 +02:00
%span.toggle-switch-control.round
%span.toggle-switch-label.on
%span.toggle-switch-label.off
2021-03-30 17:55:07 +02:00
2023-03-23 17:14:25 +01:00
.card
.card-title= t('.titles.allow_expert_messaging')
%p= t('.descriptions.allow_expert_messaging')
2023-03-23 17:14:25 +01:00
= form_for @procedure,
method: :put,
url: allow_expert_messaging_admin_procedure_path(@procedure),
html: { class: 'form procedure-form__column--form no-background' } do |f|
%label.toggle-switch{ data: { controller: 'autosubmit' } }
= f.check_box :allow_expert_messaging, class: 'toggle-switch-checkbox'
%span.toggle-switch-control.round
%span.toggle-switch-label.on
%span.toggle-switch-label.off
2021-04-16 11:13:47 +02:00
2023-03-23 17:14:25 +01:00
- if @procedure.experts_require_administrateur_invitation?
.card
.card-title Affecter des experts à la démarche
= form_for :experts_procedure,
url: admin_procedure_experts_path(@procedure),
html: { class: 'form' } do |f|
2021-04-16 11:13:47 +02:00
2023-03-23 17:14:25 +01:00
.instructeur-wrapper
%p Pendant l'instruction dun dossier, les instructeurs peuvent demander leur avis à un ou plusieurs experts.
%p#experts-emails Entrez les adresses email des experts que vous souhaitez affecter à cette démarche
2023-03-23 17:14:25 +01:00
= 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 'Affecter à la démarche', class: 'button primary send'
- if @experts_procedure.present?
%table.table.mt-2
%thead
%tr
%th Liste des experts
%th Nombre davis
- if @procedure.experts_require_administrateur_invitation
%th Notifier des décisions sur les dossiers
%tbody
- @experts_procedure.each do |expert_procedure|
2021-04-16 11:13:47 +02:00
%tr
2023-03-23 17:14:25 +01:00
%td
%span.icon.person
= expert_procedure.expert.email
%td.text-center
= expert_procedure.avis.count
2021-04-16 11:13:47 +02:00
- if @procedure.experts_require_administrateur_invitation
%td.text-center
2023-03-23 17:14:25 +01:00
= 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 davis" },
class: 'button'
- else
.blank-tab
%h2.empty-text Aucun expert invité pour le moment.
%p.empty-text-details Les instructeurs de cette démarche nont pas encore fait appel aux experts.