-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11285 from demarches-simplifiees/routing-UI-confi…
…guration-group ETQ admin j'ai une nouvelle interface de configuration d'un groupe instructeur
- Loading branch information
Showing
12 changed files
with
139 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ponents/procedure/instructeurs_options_component/instructeurs_options_component.html.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 43 additions & 36 deletions
79
...nents/procedure/one_groupe_management_component/one_groupe_management_component.html.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,51 @@ | ||
%div{ id: dom_id(@groupe_instructeur, :routing) } | ||
%h1 Paramètres du groupe | ||
%h1.fr-h2 Configuration du groupe « #{@groupe_instructeur.label} » | ||
%h2.fr-h3 Paramètres du groupe | ||
|
||
= render Procedure::ImportComponent.new(procedure: @procedure) | ||
.card | ||
= form_for @groupe_instructeur, | ||
url: admin_procedure_groupe_instructeur_path(@procedure, @groupe_instructeur), | ||
method: :patch do |f| | ||
= f.label :label, 'Nom du groupe', class: 'fr-label fr-mb-1w' | ||
.flex | ||
= f.text_field :label, required: true, class: 'fr-input flex auto fr-mr-2w' | ||
= f.button 'Renommer', class: 'fr-btn fr-btn--tertiary' | ||
|
||
= form_for @groupe_instructeur, | ||
url: admin_procedure_groupe_instructeur_path(@procedure, @groupe_instructeur), | ||
method: :patch do |f| | ||
= f.label :label, 'Nom du groupe', class: 'fr-label fr-mb-1w' | ||
.flex | ||
= f.text_field :label, required: true, class: 'fr-input flex auto fr-mr-2w' | ||
= f.button 'Renommer', class: 'fr-btn fr-btn--secondary' | ||
|
||
= form_for @groupe_instructeur, | ||
url: admin_procedure_groupe_instructeur_update_state_path(@procedure, @groupe_instructeur), | ||
method: :patch, | ||
data: { turbo: true, controller: 'autosubmit' } do |f| | ||
.fr-checkbox-group.fr-my-3w | ||
= f.check_box :closed, { id: 'closed', "aria-describedby" => "closed-messages", :name => "closed" } | ||
%label.fr-label{ :for => "closed" } | ||
Groupe inactif | ||
%span.fr-hint-text Si cette option est activée, les usagers ne pourront plus sélectionner ce groupe d’instructeurs | ||
|
||
= render Conditions::RoutingRulesComponent.new(groupe_instructeur: @groupe_instructeur) | ||
|
||
.fr-hint-text.mt-2.mb-2 | ||
%span Si vous ne trouvez pas l'option correspondant à votre groupe, veuillez l'ajouter dans le | ||
%span | ||
= link_to 'champ concerné', champs_admin_procedure_path(@procedure) | ||
|
||
.flex.fr-btns-group--sm.fr-btns-group--inline.fr-btns-group--icon-right.mb-2 | ||
= form_for @groupe_instructeur, | ||
url: admin_procedure_groupe_instructeur_update_state_path(@procedure, @groupe_instructeur), | ||
method: :patch, | ||
data: { turbo: true, controller: 'autosubmit' } do |f| | ||
.fr-checkbox-group.fr-my-3w | ||
= f.check_box :closed, { id: 'closed', "aria-describedby" => "closed-messages", :name => "closed" } | ||
%label.fr-label{ :for => "closed" } | ||
Groupe inactif | ||
%span.fr-hint-text Si cette option est activée, les dossiers ne seront pas routés dans ce groupe si les usagers sélectionnent ce choix. | ||
- if @groupe_instructeur.can_delete? | ||
%p= t('.delete') | ||
= button_to admin_procedure_groupe_instructeur_path(@procedure, @groupe_instructeur), | ||
class: 'fr-btn fr-btn--tertiary fr-btn--icon-left fr-icon-delete-line', | ||
class: 'fr-btn fr-btn--secondary fr-btn--icon-left fr-icon-delete-line', | ||
method: :delete, | ||
data: { confirm: t('.delete_confirmation', group_name: @groupe_instructeur.label) } do | ||
Supprimer | ||
Supprimer ce groupe | ||
- else | ||
= button_to reaffecter_dossiers_admin_procedure_groupe_instructeur_path(@procedure, @groupe_instructeur), | ||
class: 'fr-btn fr-btn--tertiary fr-icon-folder-2-line', | ||
title: t('.move_files_confirmation'), | ||
method: :get do | ||
= t('.move_files', count: @groupe_instructeur.dossiers.visible_by_administration.size) | ||
%em Vous ne pouvez pas supprimer ce groupe car des dossiers lui sont affectés. | ||
|
||
%h2.fr-h3 Dossiers affectés | ||
.card | ||
.flex.justify-between.align-center.fr-btns-group--sm.fr-btns-group--icon-right | ||
%span.fr-icon.fr-icon-folder-2-line.fr-mr-2w | ||
= t('.number_of_files', count: @groupe_instructeur.dossiers.visible_by_administration.size) | ||
- if !@groupe_instructeur.can_delete? | ||
= button_to reaffecter_dossiers_admin_procedure_groupe_instructeur_path(@procedure, @groupe_instructeur), | ||
class: 'fr-btn fr-btn--tertiary fr-icon-folder-2-line', | ||
title: t('.move_files_confirmation'), | ||
method: :get do | ||
= t('.move_files', count: @groupe_instructeur.dossiers.visible_by_administration.size) | ||
|
||
%h2.fr-h3 Règle(s) de routage | ||
.card | ||
= render Conditions::RoutingRulesComponent.new(groupe_instructeur: @groupe_instructeur) | ||
%p.fr-alert.fr-alert--info.fr-mt-3w{ aria: { hidden: true } } | ||
Si vous ne trouvez pas l’option correspondant à votre groupe, veuillez l’ajouter dans le champ concerné dans la page d’édition des | ||
= link_to('champs du formulaire', | ||
champs_admin_procedure_path(@procedure), | ||
**helpers.external_link_attributes) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 14 additions & 13 deletions
27
app/views/administrateurs/groupe_instructeurs/_contact_information.html.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,24 @@ | ||
%h2.fr-h3 Informations de contact | ||
.card.mt-2 | ||
.card-title Informations de contact | ||
- service = groupe_instructeur.contact_information | ||
- if service.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 | ||
- if groupe_instructeur.instructeurs.include?(current_administrateur.user.instructeur) | ||
= link_to "+ Ajouter des informations de contact", new_instructeur_groupe_contact_information_path(procedure_id: procedure.id, groupe_id: groupe_instructeur.id, from_admin: true), class: "fr-btn" | ||
- else | ||
Si vous souhaitez créer un service pour ce groupe, vous devez faire partie du groupe instructeur | ||
%span Le groupe | ||
%strong= groupe_instructeur.label | ||
%span n’a pas d’informations de contact spécifiques. | ||
%p Les informations de contact affichées à l’usager seront celles du service porteur de la démarche. | ||
- if groupe_instructeur.instructeurs.include?(current_administrateur.user.instructeur) | ||
= link_to "Personnaliser les informations de contact", new_instructeur_groupe_contact_information_path(procedure_id: procedure.id, groupe_id: groupe_instructeur.id, from_admin: true), class: "fr-btn" | ||
- else | ||
%p Si vous souhaitez créer un service pour ce groupe, vous devez faire partie du groupe instructeur | ||
- else | ||
%p.mt-3 | ||
- if groupe_instructeur.instructeurs.include?(current_administrateur.user.instructeur) | ||
= link_to "Modifier les informations de contact", edit_instructeur_groupe_contact_information_path(procedure_id: procedure.id, groupe_id: groupe_instructeur.id, from_admin: true), class: "fr-btn" | ||
- else | ||
Si vous souhaitez modifier ce service, vous devez faire partie du groupe instructeur | ||
%p.mt-3= service.nom | ||
%p= service.nom | ||
= render SimpleFormatComponent.new(service.adresse, class_names_map: {paragraph: 'fr-footer__content-desc'}) | ||
= service.email | ||
- if service.telephone.present? | ||
%p= service.telephone | ||
- if service.horaires.present? | ||
%p= service.horaires | ||
- if groupe_instructeur.instructeurs.include?(current_administrateur.user.instructeur) | ||
= link_to "Modifier les informations de contact", edit_instructeur_groupe_contact_information_path(procedure_id: procedure.id, groupe_id: groupe_instructeur.id, from_admin: true), class: "fr-btn" | ||
- else | ||
%p Si vous souhaitez modifier ce service, vous devez faire partie du groupe instructeur |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,20 @@ | ||
|
||
%h2.fr-h3= t('.instructeur_assignation') | ||
|
||
.card | ||
.card-title= t('.title') | ||
- if procedure.routing_enabled? | ||
.fr-icon-mail-line.fr-alert.fr-mb-3w | ||
- if @procedure.publiee? | ||
= t(".notification_alert_publiee_html") | ||
- else | ||
= t(".notification_alert_html") | ||
|
||
= render Procedure::InvitationWithTypoComponent.new(maybe_typos: @maybe_typos, url: add_instructeur_admin_procedure_groupe_instructeur_path(@procedure, groupe_instructeur.id), title: "Avant d'ajouter l'email, veuillez confirmer" ) | ||
.card-title= t('.instructeur_assignation') | ||
= form_for :instructeur, url: { action: :add_instructeur, id: groupe_instructeur.id }, html: { class: 'form' } do |f| | ||
.instructeur-wrapper | ||
- if !procedure.routing_enabled? | ||
%p= t('.instructeur_emails') | ||
%p.fr-hint-text= t('.copy_paste_hint') | ||
%p= t('.instructeur_emails') | ||
%p.fr-hint-text= t('.copy_paste_hint') | ||
|
||
- if disabled_as_super_admin | ||
= f.select :emails, available_instructeur_emails, {}, disabled: disabled_as_super_admin, id: 'instructeur_emails' | ||
|
@@ -20,32 +28,33 @@ | |
|
||
.flex.justify-between.align-baseline | ||
.card-title= t('.assigned_instructeur', count: instructeurs.total_count) | ||
= button_to export_groupe_instructeurs_admin_procedure_groupe_instructeurs_path(procedure, format: :csv), method: :get, class: 'fr-btn fr-btn--tertiary fr-btn--icon-left fr-icon-download-line' do | ||
Exporter la liste (.csv) | ||
- if [email protected]_enabled? | ||
= button_to export_groupe_instructeurs_admin_procedure_groupe_instructeurs_path(procedure, format: :csv), method: :get, class: 'fr-btn fr-btn--tertiary fr-btn--icon-left fr-icon-download-line' do | ||
Exporter la liste (.csv) | ||
|
||
.fr-table | ||
.fr-table.fr-table--bordered.fr-table--no-caption | ||
.fr-table__wrapper | ||
.fr-table__container | ||
.fr-table__content | ||
%table | ||
%thead | ||
%tr | ||
%th{ scope: 'col' }= t('.title') | ||
%th{ scope: 'col' }= t('.actions') | ||
%th.fr-col-11{ scope: 'col' }= t('.table_title') | ||
%th.fr-col-1.fr-cell--center{ scope: 'col' }= t('.actions') | ||
%tbody | ||
- instructeurs.each do |instructeur| | ||
%tr | ||
%td | ||
%td.fr-col-11{ scope: 'col' } | ||
= dsfr_icon('fr-icon-user-line') | ||
#{instructeur.email} | ||
|
||
- confirmation_message = procedure.routing_enabled? ? "Êtes-vous sûr de vouloir retirer l’instructeur « #{instructeur.email} » du groupe « #{groupe_instructeur.label} » ?" : "Êtes-vous sûr de vouloir retirer l’instructeur « #{instructeur.email} » de la démarche ?" | ||
%td.actions= button_to t('.remove'), | ||
%td.fr-col-1.fr-cell--center.actions{ scope: 'col' }= button_to t('.remove'), | ||
{ action: :remove_instructeur, id: groupe_instructeur.id }, | ||
{ method: :delete, | ||
data: { confirm: confirmation_message }, | ||
params: { instructeur: { id: instructeur.id }}, | ||
class: 'fr-btn fr-btn--sm fr-btn--secondary fr-btn--icon-left fr-icon-subtract-line' } | ||
class: 'fr-btn fr-btn--sm fr-btn--secondary fr-btn--icon-left fr-icon-subtract-line fr-cell---right' } | ||
|
||
.fr-table__footer | ||
.fr-table__footer--start | ||
|
12 changes: 7 additions & 5 deletions
12
app/views/shared/groupe_instructeurs/_signature_form.html.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,16 +27,19 @@ fr: | |
one: "%{count} groupe existe" | ||
other: "%{count} groupes existent" | ||
instructeurs: | ||
title: Instructeurs | ||
title: Affecter un nouvel instructeur | ||
table_title: Instructeurs | ||
assigned_instructeur: | ||
one: "%{count} instructeur affecté" | ||
other: "%{count} instructeurs affectés" | ||
instructeur_assignation: Affectation des instructeurs | ||
assign: Affecter | ||
remove: Retirer | ||
instructeur_emails: Adresse électronique des instructeurs que vous souhaitez affecter à cette démarche | ||
instructeur_emails: Adresse(s) électronique(s) | ||
copy_paste_hint: "Vous pouvez saisir les adresses individuellement, ou bien copier-coller dans le champ ci-dessous une liste d’adresses séparées par des points-virgules (exemple : [email protected]; [email protected]; [email protected])." | ||
actions: Retirer | ||
actions: Action | ||
notification_alert_html: Même si votre démarche est encore en test / non publiée, tous les instructeurs que vous ajouterez à la démarche <strong>seront notifiés par email</strong>. | ||
notification_alert_publiee_html: Tous les instructeurs que vous ajouterez à la démarche <strong>seront notifiés par email</strong>. | ||
import: | ||
groupe: | ||
one: "%{count} groupe" | ||
|