instructeur header dossier view restructuration

This commit is contained in:
Lisa Durand 2023-02-13 15:41:18 +01:00
parent f80fe9680f
commit 58c287dad9
5 changed files with 45 additions and 38 deletions

View file

@ -139,6 +139,10 @@
overflow: visible;
}
.super {
vertical-align: super;
}
// generate spacer utility like bootstrap my-2 -> margin-left/right: 2 * $default-spacer
// using $direction.key as css modifier, $direction.values to set css properties
// scale it using $steps

View file

@ -60,10 +60,10 @@ module DossierHelper
end
end
def status_badge(state)
def status_badge(state, alignment_class = '')
status_text = dossier_display_state(state, lower: true)
status_class = state.tr('_', '-')
tag.span(status_text, class: "label #{status_class} ", role: 'status')
tag.span(status_text, class: "label #{status_class} #{alignment_class}", role: 'status')
end
def deletion_reason_badge(reason)

View file

@ -7,16 +7,19 @@
.sub-header
.container
.flex.justify-between
%ul.breadcrumbs
%li
= link_to dossier.procedure.libelle.truncate_words(10), instructeur_procedure_path(dossier.procedure), title: dossier.procedure.libelle, class: "fr-link"
= procedure_badge(dossier.procedure)
%li
.flex.fr-mb-3w
%div
%h1.fr-h2.fr-mb-1w
= "Dossier nº #{dossier.id}"
.header-actions
= status_badge(dossier.state, 'super')
= link_to dossier.procedure.libelle.truncate_words(10), instructeur_procedure_path(dossier.procedure), title: dossier.procedure.libelle, class: "fr-link"
= procedure_badge(dossier.procedure)
.header-actions.fr-ml-auto
= render partial: 'instructeurs/dossiers/header_actions', locals: { dossier: dossier }
= render(partial: 'instructeurs/dossiers/print_and_export_actions', locals: {dossier: dossier})
= render(partial: 'instructeurs/dossiers/expiration_banner', locals: {dossier: dossier})

View file

@ -1,32 +1,4 @@
%ul.fr-btns-group.fr-btns-group--sm.fr-btns-group--inline-md.fr-btns-group--icon-right
= render Dropdown::MenuComponent.new(wrapper: :li, menu_options: { id: 'print-menu'}, button_options: { class: ['fr-btn--tertiary', 'fr-icon-printer-line']}) do |menu|
- menu.with_button_inner_html do
Imprimer
- menu.with_item do
= link_to print_instructeur_dossier_path(dossier.procedure, dossier), role: 'menuitem', target: "_blank", rel: "noopener", class: "menu-item menu-link" do
Tout le dossier
- menu.with_item do
= link_to '#', role: 'menuitem', onclick: "window.print()", class: "menu-item menu-link" do
Uniquement cet onglet
- menu.with_item do
= link_to instructeur_dossier_path(dossier.procedure, dossier, format: :pdf), target: "_blank", rel: "noopener", class: "menu-item menu-link", role: 'menuitem' do
Export PDF
- if dossier.geo_data?
- menu.with_item do
= link_to geo_data_instructeur_dossier_path(dossier.procedure, dossier), target: "_blank", rel: "noopener", class: "menu-item menu-link", role: 'menuitem' do
Export GeoJSON
= render Dropdown::MenuComponent.new(wrapper: :li, menu_options: { id: 'print-pj-menu'}, button_options: { class: ['fr-btn--tertiary', 'fr-icon-download-line']}) do |menu|
- menu.with_button_inner_html do
Télécharger
- menu.with_item do
= link_to telecharger_pjs_instructeur_dossier_path(dossier.procedure, dossier), target: "_blank", rel: "noopener", class: "menu-item menu-link", role: 'menuitem' do
Télécharger le dossier et toutes ses pièces jointes
%ul.fr-btns-group.fr-btns-group--sm.fr-btns-group--inline-md.fr-btns-group--icon-right.flex.justify-end.fr-mb-1w
%li
= render partial: "instructeurs/procedures/dossier_actions",
locals: { procedure_id: dossier.procedure.id,

View file

@ -0,0 +1,28 @@
%ul.fr-btns-group.fr-btns-group--sm.fr-btns-group--inline-md.fr-btns-group--icon-right.flex.justify-end
= render Dropdown::MenuComponent.new(wrapper: :li, menu_options: { id: 'print-menu'}, button_options: { class: ['fr-btn--tertiary-no-outline', 'fr-icon-printer-line']}) do |menu|
- menu.with_button_inner_html do
Imprimer
- menu.with_item do
= link_to print_instructeur_dossier_path(dossier.procedure, dossier), role: 'menuitem', target: "_blank", rel: "noopener", class: "menu-item menu-link" do
Tout le dossier
- menu.with_item do
= link_to '#', role: 'menuitem', onclick: "window.print()", class: "menu-item menu-link" do
Uniquement cet onglet
- menu.with_item do
= link_to instructeur_dossier_path(dossier.procedure, dossier, format: :pdf), target: "_blank", rel: "noopener", class: "menu-item menu-link", role: 'menuitem' do
Export PDF
- if dossier.geo_data?
- menu.with_item do
= link_to geo_data_instructeur_dossier_path(dossier.procedure, dossier), target: "_blank", rel: "noopener", class: "menu-item menu-link", role: 'menuitem' do
Export GeoJSON
= render Dropdown::MenuComponent.new(wrapper: :li, menu_options: { id: 'print-pj-menu'}, button_options: { class: ['fr-btn--tertiary-no-outline', 'fr-icon-download-line']}) do |menu|
- menu.with_button_inner_html do
Télécharger
- menu.with_item do
= link_to telecharger_pjs_instructeur_dossier_path(dossier.procedure, dossier), target: "_blank", rel: "noopener", class: "menu-item menu-link", role: 'menuitem' do
Télécharger le dossier et toutes ses pièces jointes