demarches-normaliennes/app/views/administrateurs/groupe_instructeurs/_edit.html.haml

69 lines
3.1 KiB
Text
Raw Normal View History

2021-10-04 16:02:58 +02:00
- groupe_instructeurs_count = procedure.groupe_instructeurs.count
.card
= form_for procedure,
url: { action: :update_routing_criteria_name },
html: { class: 'form' } do |f|
= f.label :routing_criteria_name do
2022-04-21 10:20:14 +02:00
= t('.routing.title')
%p.notice
= t('.routing.notice')
= f.text_field :routing_criteria_name, placeholder: t('.add_a_group.placeholder'), required: true
= f.submit t('.button.rename'), class: 'button primary send'
.card
2022-04-21 10:20:14 +02:00
.card-title
= t('.group_management.title')
= 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')
%p.notice
= t('.add_a_group.notice', routing_criteria_name: procedure.routing_criteria_name)
= f.text_field :label, placeholder: t('.add_a_group.placeholder'), required: true
= f.submit t('.button.add_group'), class: "button primary send"
- csv_max_size = Administrateurs::GroupeInstructeursController::CSV_MAX_SIZE
- if procedure.publiee?
= 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
= t('.csv_import.notice_1')
%p.notice
= t('.csv_import.notice_2', csv_max_size: number_to_human_size(csv_max_size))
%p.mt-2.mb-2= link_to t('.csv_import.download_exemple'), "/csv/#{I18n.locale}/import-groupe-test.csv"
= file_field_tag :group_csv_file, 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..." }
- else
%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')
%table.table.mt-2
%thead
%tr
2022-04-21 10:20:14 +02:00
// i18n-tasks-use t('.existing_groupe')
%th{ colspan: 2 }= t(".existing_groupe", count: groupes_instructeurs.total_count)
2021-10-06 16:41:08 +02:00
%th
- if groupe_instructeurs_count > 1
= 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
2022-04-21 10:20:14 +02:00
%td.actions= link_to t('.view'), admin_procedure_groupe_instructeur_path(procedure, group)
- if groupes_instructeurs.many?
- if group.dossiers.empty?
%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
%span.icon.delete
2022-04-21 10:20:14 +02:00
= t('.group_management.delete')
- else
%td.actions
2022-04-21 10:20:14 +02:00
= link_to reaffecter_dossiers_admin_procedure_groupe_instructeur_path(procedure, group), class: 'button', title: t('.group_management.move_folders_confirmation') do
%span.icon.follow
2022-04-21 10:20:14 +02:00
= t('.group_management.move_folders')
2021-10-06 16:41:08 +02:00
= paginate groupes_instructeurs