demarches-normaliennes/app/views/administrateurs/groupe_instructeurs/_edit.html.haml
2023-04-21 17:19:17 +02:00

67 lines
3.2 KiB
Text

- if groupes_instructeurs.many? && !procedure.feature_enabled?(:routing_rules)
.card
= form_for procedure,
url: { action: :update_routing_criteria_name },
html: { class: 'form' } do |f|
= 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'
.card
%h2.card-title= t('.group_management.title')
= form_for :groupe_instructeur, html: { class: 'form' } do |f|
= f.label :label do
= t('.add_a_group.title')
- if groupes_instructeurs.many?
%p.notice
= t('.add_a_group.notice', routing_criteria_name: procedure.routing_criteria_name)
= f.text_field :label, required: true
= f.submit t('.button.add_group'), class: "button primary send"
- csv_max_size = Administrateurs::GroupeInstructeursController::CSV_MAX_SIZE
- if procedure.publiee_or_close?
= form_tag import_admin_procedure_groupe_instructeurs_path(procedure), method: :post, multipart: true, class: "mt-4 form" do
= label_tag t('.csv_import.title')
%p.notice
= t('.csv_import.notice_1_html',
instructeurs_link: link_to(t('.csv_import.link_text'), t('.csv_import.instructeurs_file_path')),
groupes_link: link_to(t('.csv_import.link_text'), t('.csv_import.groupes_file_path')))
%p.notice
= t('.csv_import.notice_2', csv_max_size: number_to_human_size(csv_max_size))
= file_field_tag :csv_file, required: true, accept: 'text/csv', size: "1"
= submit_tag t('.csv_import.import_file'), class: 'button primary send', data: { disable_with: "Envoi...", confirm: t('.csv_import.import_file_alert') }
- else
%p.mt-4.form.font-weight-bold.mb-2.text-lg
= t('.csv_import.title')
%p.notice
= t('.csv_import.import_file_procedure_not_published')
- if procedure.groupe_instructeurs.many?
%table.table.mt-2
%thead
%tr
// i18n-tasks-use t('.existing_groupe')
%th{ colspan: 2 }= t(".existing_groupe", count: groupes_instructeurs.total_count)
%th.actions
= 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.setup= link_to t('.set_up'), admin_procedure_groupe_instructeur_path(procedure, group)
- if group.can_delete?
%td.actions
= 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
= t('.group_management.delete')
- else
%td.actions
= link_to reaffecter_dossiers_admin_procedure_groupe_instructeur_path(procedure, group), class: 'button', title: t('.group_management.move_files_confirmation') do
%span.icon.follow
= t('.group_management.move_files', count: group.dossiers.visible_by_administration.size)
= paginate groupes_instructeurs, views_prefix: 'shared'