demarches-normaliennes/app/views/administrateurs/procedures/index.html.haml
2024-05-07 16:28:19 +02:00

30 lines
2 KiB
Text

.sub-header
.flex.fr-container
%h1.fr-h3 Mes démarches
.procedure-admin-listing-container.fr-mt-1v
= link_to "Nouvelle Démarche", new_from_existing_admin_procedures_path, id: 'new-procedure', class: 'fr-btn'
.fr-container
%nav.fr-tabs{ role: 'navigation', 'aria-label': t('views.users.dossiers.secondary_menu') }
%ul.fr-tabs__list{ role: 'tablist' }
= tab_item(t('pluralize.published', count: @procedures_publiees_count), admin_procedures_path(statut: 'publiees'), active: @statut == 'publiees', badge: number_with_html_delimiter(@procedures_publiees_count))
= tab_item('en test', admin_procedures_path(statut: 'brouillons'), active: @statut == 'brouillons', badge: number_with_html_delimiter(@procedures_draft_count))
= tab_item(t('pluralize.closed', count: @procedures_closed_count), admin_procedures_path(statut: 'archivees'), active: @statut == 'archivees', badge: number_with_html_delimiter(@procedures_closed_count))
= tab_item(t('pluralize.deleted', count: @procedures_deleted_count), admin_procedures_path(statut: 'supprimees'), active: @statut === 'supprimees', badge: number_with_html_delimiter(@procedures_deleted_count))
.fr-container#procedures{ data: { item_count: @statut === "publiees" ? @procedures_publiees_count : @statut === "brouillons" ? @procedures_draft_count : @procedures_closed_count } }
- if @statut === "publiees"
= render partial: "procedures_list", locals: { procedures: @procedures_publiees }
= paginate @procedures_publiees, views_prefix: 'shared'
- if @statut === "brouillons"
= render partial: "procedures_list", locals: { procedures: @procedures_draft }
= paginate @procedures_draft, views_prefix: 'shared'
- if @statut === "archivees"
= render partial: "procedures_list", locals: { procedures: @procedures_closed }
= paginate @procedures_closed, views_prefix: 'shared'
- if @statut === "supprimees"
= render partial: "procedures_list", locals: { procedures: @procedures_deleted }
= paginate @procedures_deleted, views_prefix: 'shared'