demarches-normaliennes/app/views/administrateurs/procedures/_detail.html.haml
2024-11-22 10:45:11 +01:00

37 lines
1.8 KiB
Text

%tr.procedure{ id: "procedure_#{procedure.id}" }
%th.fr-cell--fixed{ scope: 'row' }
- title = show_detail ? 'Cacher les détails de la démarche' : 'Afficher les détails de la démarche'
- icon = show_detail ? 'fr-icon-subtract-line' : 'fr-icon-add-line'
- params = show_detail ? {} : { show_detail: true }
= button_to detail_admin_procedure_path(procedure["id"]), method: :post, params:, title:, class: [icon, "fr-icon--sm fr-mb-1w fr-text-action-high--blue-france fr-btn fr-btn--tertiary-no-outline" ] do
= title
%td
- if procedure.template
%p.fr-badge.fr-badge--info.fr-badge--sm= "Modèle"
%abbr{ title: APPLICATION_NAME }= acronymize(APPLICATION_NAME)
= procedure.libelle
%td= procedure.id
%td.fr-cell--right= procedure.estimated_dossiers_count
%td
- if procedure.respond_to?(:parsed_latest_zone_labels)
- procedure.parsed_latest_zone_labels.uniq.each do |zone_label|
%span.mb-2= zone_label
.mb-2
- else
- procedure.zones.uniq.each do |zone|
%span= zone.current_label
.mb-1
%td= t procedure.aasm_state, scope: 'activerecord.attributes.procedure.aasm_state'
%td= l(procedure.published_at, format: :message_date_without_time) if procedure.published_at
%td
= link_to('Consulter', apercu_admin_procedure_path(procedure.id), target: "_blank", class: 'fr-btn fr-btn--tertiary fr-btn--sm fr-mb-1w', title: new_tab_suffix('Aperçu de la démarche'))
= link_to('Cloner', admin_procedure_clone_path(procedure.id, from_new_from_existing: true), 'data-method' => :put, class: 'fr-btn fr-btn--tertiary fr-btn--sm')
- if show_detail
%tr.procedure{ id: "procedure_detail_#{procedure.id}" }
%td.fr-background-alt--green-emeraude{ colspan: '8' }
%ul
- procedure.administrateurs.uniq.each do |admin|
%li= admin.email