2022-10-25 17:06:27 +02:00
= render 'main_menu'
2022-10-24 16:43:18 +02:00
.fr-container
%h1.fr-my-4w Toutes les démarches
.fr-container--fluid
.fr-grid-row.fr-grid-row--gutters
.fr-col-8
.fr-highlight.fr-mb-4w
%p Ce tableau de bord permet de consulter les informations sur les démarches simplifiées pour toutes les zones. Filtrez par zone et statut. Consultez la liste des démarches et cliquez sur une démarche pour voir la zone et quels sont les administrateurs.
2022-10-31 11:36:24 +01:00
.fr-container--fluid{ 'data-turbo': 'true', 'data-controller': 'autosubmit' }
2022-10-24 16:43:18 +02:00
.fr-grid-row.fr-grid-row--gutters
.fr-col-3
2022-10-27 17:07:18 +02:00
= form_with(url: all_admin_procedures_path, method: :get, html: {'data-autosubmit-target': 'form'}) do |f|
2022-10-24 16:43:18 +02:00
%fieldset.sidebar-filter
2022-10-28 17:28:43 +02:00
%legend
.title.font-weight-bold.fr-pl-2w
2022-10-31 11:36:24 +01:00
%span.fr-icon-filter-fill.fr-icon--sm.fr-mr-1w{ 'aria-hidden': 'true' }
2022-10-28 17:28:43 +02:00
Filtrer
.reinit
= link_to all_admin_procedures_path(zone_ids: current_administrateur.zones) do
%span.fr-icon-arrow-go-back-line Réinitialiser
2022-10-24 16:43:18 +02:00
%ul
2022-10-31 11:36:24 +01:00
%li.fr-py-2w.fr-pl-2w{ 'data-controller': "expand" }
2022-11-03 16:42:34 +01:00
.fr-mb-1w
%button{ 'data-action': 'expand#toggle' }
2022-10-31 11:36:24 +01:00
%span.fr-icon-add-line.fr-icon--sm.fr-mr-1w.fr-text-action-high--blue-france{ 'aria-hidden': 'true', 'data-expand-target': 'icon' }
2022-10-24 16:43:18 +02:00
Mes zones
2022-10-31 11:36:24 +01:00
.fr-ml-1w{ 'data-expand-target': 'content' }
2022-11-04 09:24:41 +01:00
= f.collection_check_boxes :zone_ids, @filter.admin_zones, :id, :current_label, include_hidden: false do |b|
2022-11-09 13:32:55 +01:00
.fr-checkbox-group.fr-ml-2w.fr-py-1w
2022-11-04 09:24:41 +01:00
= b.check_box(checked: @filter.zone_filtered?(b.value), 'data-action': 'autosubmit#submit')
2022-10-24 16:43:18 +02:00
= b.label(class: 'fr-label') { b.text }
2022-10-31 11:36:24 +01:00
%li.fr-py-2w.fr-pl-2w{ 'data-controller': "expand" }
2022-11-03 16:42:34 +01:00
.fr-mb-1w
%button{ 'data-action': 'expand#toggle' }
2022-10-31 11:36:24 +01:00
%span.fr-icon-add-line.fr-icon--sm.fr-mr-1w.fr-text-action-high--blue-france{ 'aria-hidden': 'true', 'data-expand-target': 'icon' }
2022-10-24 16:43:18 +02:00
Autres zones
2022-10-31 11:36:24 +01:00
.fr-ml-1w.hidden{ 'data-expand-target': 'content' }
2022-11-04 09:24:41 +01:00
= f.collection_check_boxes :zone_ids, @filter.other_zones, :id, :current_label, include_hidden: false do |b|
2022-11-09 13:32:55 +01:00
.fr-checkbox-group.fr-ml-2w.fr-py-1w
2022-11-04 09:24:41 +01:00
= b.check_box(checked: @filter.zone_filtered?(b.value), 'data-action': 'autosubmit#submit')
2022-10-24 16:43:18 +02:00
= b.label(class: 'fr-label') { b.text }
2022-11-04 12:18:02 +01:00
%li.fr-py-2w{ 'data-controller': "expand" }
.fr-mb-1w.fr-pl-2w
%button{ 'data-action': 'click->expand#toggle' }
%span.fr-icon-add-line.fr-icon--sm.fr-mr-1w.fr-text-action-high--blue-france{ 'aria-hidden': 'true', 'data-expand-target': 'icon' }
Date de publication
.fr-input-group.hidden{ 'data-expand-target': 'content' }
= f.label 'from_publication_date', 'Depuis', class: 'fr-label'
.fr-input-wrap.fr-fi-calendar-line
2022-11-04 12:22:39 +01:00
= f.date_field 'from_publication_date', value: @filter.from_publication_date, class: 'fr-input', 'data-action': 'blur->autosubmit#submit change->autosubmit#debouncedSubmit'
2022-11-04 12:18:02 +01:00
2022-10-31 11:36:24 +01:00
%li.fr-py-2w.fr-pl-2w{ 'data-controller': "expand" }
2022-11-04 09:24:41 +01:00
.fr-mb-1w
2022-11-03 16:42:34 +01:00
%button{ 'data-action': 'expand#toggle' }
2022-10-31 11:36:24 +01:00
%span.fr-icon-add-line.fr-icon--sm.fr-mr-1w.fr-text-action-high--blue-france{ 'aria-hidden': 'true', 'data-expand-target': 'icon' }
2022-10-25 11:25:25 +02:00
Statut
2022-10-31 11:36:24 +01:00
.fr-ml-1w.hidden{ 'data-expand-target': 'content' }
2022-10-25 11:25:25 +02:00
= f.collection_check_boxes :statuses, ['publiee', 'close'], :to_s, :to_s, include_hidden: false do |b|
2022-11-09 13:32:55 +01:00
.fr-checkbox-group.fr-ml-2w.fr-py-1w
2022-11-04 09:24:41 +01:00
= b.check_box(checked: @filter.status_filtered?(b.value), 'data-action': 'autosubmit#submit')
2022-10-28 16:15:55 +02:00
= b.label(class: 'fr-label') { t b.text, scope: 'activerecord.attributes.procedure.aasm_state' }
2022-10-24 16:43:18 +02:00
.fr-col-9
2022-11-08 09:58:26 +01:00
.main-filter-header.fr-my-3w
.search
= link_to 'Voir la liste des administeurs', '#', class: 'fr-btn fr-btn--secondary btn-admins'
2022-10-24 16:43:18 +02:00
.fr-table.fr-table--bordered
%table#all-demarches
2022-10-27 17:07:18 +02:00
%caption
2022-11-04 09:24:41 +01:00
= "#{@filter.procedures_result.total_count} démarches"
2022-10-31 11:36:24 +01:00
%span.hidden.fr-icon-ball-pen-fill{ 'aria-hidden': 'true', 'data-autosubmit-target': 'spinner' }
2022-11-04 09:24:41 +01:00
- if @filter.selected_zones.present?
2022-10-24 16:43:18 +02:00
.selected-zones.fr-mb-2w
2022-11-04 09:24:41 +01:00
- @filter.selected_zones.each do |zone|
= link_to zone.current_label, all_admin_procedures_path(@filter.without(:zone_ids, zone.id)), class: 'fr-tag fr-tag--dismiss fr-mb-1w'
- if @filter.statuses.present?
2022-10-25 11:25:25 +02:00
.selected-statuses.fr-mb-2w
2022-11-04 09:24:41 +01:00
- @filter.statuses.each do |status|
2022-11-04 14:37:28 +01:00
= link_to status, all_admin_procedures_path(@filter.without(:statuses, status)), class: 'fr-tag fr-tag--dismiss fr-mb-1w'
2022-11-04 12:18:02 +01:00
- if @filter.from_publication_date.present?
.selected-from-publication-date.fr-mb-2w
2022-11-09 10:58:02 +01:00
= link_to "Depuis le #{l(@filter.from_publication_date)}", all_admin_procedures_path(@filter.without(:from_publication_date)), class: 'fr-tag fr-tag--dismiss fr-mb-1w'
2022-11-04 09:24:41 +01:00
= paginate @filter.procedures_result, views_prefix: 'administrateurs'
2022-10-24 16:43:18 +02:00
%thead
%tr
2022-10-31 11:36:24 +01:00
%th{ scope: 'col' }
%th{ scope: 'col' } Démarche
%th{ scope: 'col' } N°
%th{ scope: 'col' } Administrateurs
%th{ scope: 'col' } Statut
%th{ scope: 'col' } Date
2022-11-04 09:24:41 +01:00
- @filter.procedures_result.each do |procedure|
2022-10-31 11:36:24 +01:00
%tbody{ 'data-controller': 'expand' }
%tr.procedure{ 'data-action': 'click->expand#toggle' }
2022-10-24 16:43:18 +02:00
%td
2022-10-31 11:36:24 +01:00
%button.fr-icon-add-line.fr-icon--sm.fr-mr-1w.fr-mb-1w.fr-text-action-high--blue-france{ 'aria-hidden': 'true', 'data-expand-target': 'icon' }
2022-10-24 16:43:18 +02:00
%td= procedure.libelle
%td= procedure.id
%td= procedure.administrateurs.count
2022-10-28 16:15:55 +02:00
%td= t procedure.aasm_state, scope: 'activerecord.attributes.procedure.aasm_state'
2022-10-28 15:45:04 +02:00
%td= l(procedure.published_at, format: :message_date_without_time)
2022-10-31 11:36:24 +01:00
%tr.hidden{ 'data-expand-target': 'content' }
%td.fr-highlight--beige-gris-galet{ colspan: '6' }
2022-10-24 16:43:18 +02:00
.fr-container
.fr-grid-row
.fr-col-6
- procedure.zones.uniq.each do |zone|
= zone.label_at(procedure.published_or_created_at)
.fr-col-6
- procedure.administrateurs.uniq.each do |admin|
= admin.email
2022-11-04 09:24:41 +01:00
.fr-mt-2w= paginate @filter.procedures_result, views_prefix: 'administrateurs'