demarches-normaliennes/app/views/instructeurs/groupe_instructeurs/show.html.haml

57 lines
2.5 KiB
Text
Raw Normal View History

2022-11-04 10:10:57 +01:00
- if @procedure.routing_enabled?
- content_for(:title, "Instructeurs du groupe #{@groupe_instructeur.label}")
2019-10-24 22:17:55 +02:00
= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [[@procedure.libelle.truncate_words(10), instructeur_procedure_path(@procedure)],
['Groupes dinstructeurs', instructeur_groupes_path(@procedure)],
[@groupe_instructeur.label]] }
- else
- content_for(:title, "Instructeurs de la démarche #{@procedure.libelle}")
= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [[@procedure.libelle, instructeur_procedure_path(@procedure)],
['Instructeurs']] }
2019-10-24 22:17:55 +02:00
.container.groupe-instructeur
%h1
2022-11-04 10:10:57 +01:00
- if @procedure.routing_enabled?
Groupe « #{@groupe_instructeur.label} »
- else
Démarche « #{@procedure.libelle} »
2019-10-24 22:17:55 +02:00
.card.mt-2
.card-title Gestion des instructeurs
2019-10-25 09:26:31 +02:00
= form_for :instructeur,
url: { action: :add_instructeur },
html: { class: 'form' } do |f|
= f.label :email do
Affecter un nouvel instructeur
= f.email_field :email, placeholder: 'marie.dupont@exemple.fr', required: true
= f.submit 'Affecter', class: 'button primary send'
2019-10-24 22:17:55 +02:00
%table.table.mt-2
%thead
%tr
%th{ colspan: 2 } Instructeurs affectés
%tbody
- @instructeurs.each do |instructeur|
%tr
%td= instructeur.email
2022-11-04 10:10:57 +01:00
- confirmation_message = @procedure.routing_enabled? ? "Êtes-vous sûr de vouloir retirer linstructeur « #{instructeur.email} » du groupe « #{@groupe_instructeur.label} » ?" : "Êtes-vous sûr de vouloir retirer linstructeur « #{instructeur.email} » de la démarche ?"
2019-10-25 10:17:39 +02:00
%td.actions= button_to 'retirer',
{ action: :remove_instructeur },
{ method: :delete,
data: { confirm: confirmation_message },
2019-10-25 10:17:39 +02:00
params: { instructeur: { id: instructeur.id }},
class: 'button' }
= paginate @instructeurs, views_prefix: 'shared'
.card.mt-2
.card-title Informations de contact
- if @groupe_instructeur.contact_information.nil?
= "Le groupe #{@groupe_instructeur.label} n'a pas d'informations de contact. Les informations de contact affichées à l'usager seront celles du service de la procédure"
%p.mt-3
= link_to "+ Ajouter des informations de contact", new_instructeur_groupe_contact_information_path(procedure_id: @procedure.id, groupe_id: @groupe_instructeur.id), class: "fr-btn"