2022-10-17 11:01:55 +02:00
|
|
|
- if groupes_instructeurs.many?
|
|
|
|
.card
|
|
|
|
= form_for procedure,
|
|
|
|
url: { action: :update_routing_criteria_name },
|
|
|
|
html: { class: 'form' } do |f|
|
2021-09-14 19:54:35 +02:00
|
|
|
|
2022-10-17 11:01:55 +02:00
|
|
|
= f.label :routing_criteria_name do
|
|
|
|
= t('.routing.title')
|
|
|
|
%p.notice
|
|
|
|
= f.text_field :routing_criteria_name, required: true
|
|
|
|
= f.submit t('.button.rename'), class: 'button primary send'
|
2021-09-14 19:54:35 +02:00
|
|
|
|
|
|
|
.card
|
2022-04-21 10:20:14 +02:00
|
|
|
.card-title
|
|
|
|
= t('.group_management.title')
|
2021-09-14 19:54:35 +02:00
|
|
|
|
|
|
|
= form_for :groupe_instructeur, html: { class: 'form' } do |f|
|
|
|
|
= f.label :label do
|
2022-04-21 10:20:14 +02:00
|
|
|
= t('.add_a_group.title')
|
2022-10-17 11:01:55 +02:00
|
|
|
- if groupes_instructeurs.many?
|
|
|
|
%p.notice
|
|
|
|
= t('.add_a_group.notice', routing_criteria_name: procedure.routing_criteria_name)
|
|
|
|
= f.text_field :label, required: true
|
2022-04-21 10:20:14 +02:00
|
|
|
= f.submit t('.button.add_group'), class: "button primary send"
|
2021-09-14 19:54:35 +02:00
|
|
|
|
2021-11-25 16:26:55 +01:00
|
|
|
- csv_max_size = Administrateurs::GroupeInstructeursController::CSV_MAX_SIZE
|
2023-02-09 09:44:06 +01:00
|
|
|
- if procedure.publiee_or_close?
|
2022-12-05 17:14:27 +01:00
|
|
|
= form_tag import_admin_procedure_groupe_instructeurs_path(procedure), method: :post, multipart: true, class: "mt-4 form" do
|
2022-04-21 10:20:14 +02:00
|
|
|
= label_tag t('.csv_import.title')
|
|
|
|
%p.notice
|
2023-01-10 14:36:56 +01:00
|
|
|
= procedure.routing_enabled? ? t('.csv_import.routing_enabled.notice_1') : t('.csv_import.routing_disabled.notice_1')
|
2022-04-21 10:20:14 +02:00
|
|
|
%p.notice
|
|
|
|
= t('.csv_import.notice_2', csv_max_size: number_to_human_size(csv_max_size))
|
2023-01-10 14:36:56 +01:00
|
|
|
- sample_file_path = procedure.routing_enabled? ? "/csv/#{I18n.locale}/import-groupe-test.csv" : "/csv/import-instructeurs-test.csv"
|
|
|
|
%p.mt-2.mb-2= link_to t('.csv_import.download_exemple'), sample_file_path
|
|
|
|
- csv_params = procedure.routing_enabled? ? :group_csv_file : :instructeurs_csv_file
|
|
|
|
= file_field_tag csv_params, required: true, accept: 'text/csv', size: "1"
|
2022-04-21 10:20:14 +02:00
|
|
|
= submit_tag t('.csv_import.import_file'), class: 'button primary send', data: { disable_with: "Envoi..." }
|
2022-01-17 12:22:21 +01:00
|
|
|
- else
|
2022-06-16 15:51:45 +02:00
|
|
|
%p.mt-4.form.font-weight-bold.mb-2.text-lg
|
2022-04-21 10:20:14 +02:00
|
|
|
= t('.csv_import.title')
|
|
|
|
%p.notice
|
|
|
|
= t('.csv_import.import_file_procedure_not_published')
|
2022-11-29 17:26:51 +01:00
|
|
|
- if procedure.groupe_instructeurs.many?
|
2022-10-20 18:24:27 +02:00
|
|
|
%table.table.mt-2
|
|
|
|
%thead
|
2021-09-14 19:54:35 +02:00
|
|
|
%tr
|
2022-10-20 18:24:27 +02:00
|
|
|
// i18n-tasks-use t('.existing_groupe')
|
|
|
|
%th{ colspan: 2 }= t(".existing_groupe", count: groupes_instructeurs.total_count)
|
|
|
|
%th
|
|
|
|
= link_to "Exporter au format CSV", export_groupe_instructeurs_admin_procedure_groupe_instructeurs_path(procedure, format: :csv)
|
|
|
|
%tbody
|
|
|
|
- groupes_instructeurs.each do |group|
|
|
|
|
%tr
|
|
|
|
%td= group.label
|
|
|
|
%td.actions= link_to t('.set_up'), admin_procedure_groupe_instructeur_path(procedure, group)
|
|
|
|
- if group.can_delete?
|
2021-09-14 19:54:35 +02:00
|
|
|
%td.actions
|
2022-04-21 10:20:14 +02:00
|
|
|
= link_to admin_procedure_groupe_instructeur_path(procedure, group), { method: :delete, class: 'button', data: { confirm: t('.group_management.delete_confirmation', group_name: group.label) }} do
|
2021-09-14 19:54:35 +02:00
|
|
|
%span.icon.delete
|
2022-04-21 10:20:14 +02:00
|
|
|
= t('.group_management.delete')
|
2021-09-14 19:54:35 +02:00
|
|
|
- else
|
|
|
|
%td.actions
|
2023-01-11 18:49:39 +01:00
|
|
|
= link_to reaffecter_dossiers_admin_procedure_groupe_instructeur_path(procedure, group), class: 'button', title: t('.group_management.move_files_confirmation') do
|
2021-09-14 19:54:35 +02:00
|
|
|
%span.icon.follow
|
2023-01-11 18:49:39 +01:00
|
|
|
= t('.group_management.move_files', count: group.dossiers.visible_by_administration.size)
|
2021-10-06 16:41:08 +02:00
|
|
|
|
2021-09-14 19:54:35 +02:00
|
|
|
|
|
|
|
= paginate groupes_instructeurs
|