demarches-normaliennes/app/views/instructeurs/dossiers/_header_top.html.haml

48 lines
2.4 KiB
Text
Raw Normal View History

#header-top.fr-container
.flex.fr-mb-3w
%div
%h1.fr-h3.fr-mb-1w
= "Dossier nº #{dossier.id}"
= link_to dossier.procedure.libelle.truncate_words(10), instructeur_procedure_path(dossier.procedure), title: dossier.procedure.libelle, class: "fr-link"
.fr-mt-2w.badge-group
= procedure_badge(dossier.procedure)
= status_badge(dossier.state)
- if dossier.pending_correction?
= pending_correction_badge(:for_instructeur)
- elsif dossier.en_construction? && dossier.last_correction_resolved?
= correction_resolved_badge
= render Instructeurs::SVASVRDecisionBadgeComponent.new(projection_or_dossier: dossier, procedure: dossier.procedure, with_label: true)
.header-actions.fr-ml-auto
= render partial: 'instructeurs/dossiers/header_actions', locals: { dossier: }
= render partial: 'instructeurs/dossiers/print_and_export_actions', locals: { dossier: }
= render partial: 'instructeurs/dossiers/expiration_banner', locals: { dossier: }
- if dossier.user_deleted?
%p.fr-mb-1w
%small Lusager a supprimé son compte. Vous pouvez archiver puis supprimer le dossier.
.fr-mb-3w
- if dossier.procedure_labels.present?
- dossier.procedure_labels.each do |label|
.fr-badge.fr-badge--sm{ class: "fr-badge--#{label.color}" }
= label.name
= render Dropdown::MenuComponent.new(wrapper: :span, button_options: { class: ['fr-btn--sm fr-btn--tertiary-no-outline fr-pl-1v']}, menu_options: { class: ['dropdown-label left-aligned'] }) do |menu|
- if dossier.procedure_labels.empty?
- menu.with_button_inner_html do
Ajouter un label
- menu.with_form do
= form_with(url: dossier_labels_instructeur_dossier_path(dossier_id: dossier.id, procedure_id: dossier.procedure.id), method: :post, class: 'fr-p-3w', data: { controller: 'autosubmit', turbo: 'true' }) do |f|
%fieldset.fr-fieldset.fr-mt-2w.fr-mb-0
= f.collection_check_boxes :procedure_label_id, dossier.procedure.procedure_labels, :id, :name, include_hidden: false do |b|
.fr-fieldset__element
.fr-checkbox-group.fr-checkbox-group--sm.fr-checkbox-custom-with-labels.fr-mb-1w
= b.check_box(checked: DossierLabel.find_by(dossier_id: dossier.id, procedure_label_id: b.value).present? )
= b.label(class: "fr-label fr-badge fr-badge--sm fr-badge--#{b.object.color}") { b.text }