From b08011cff70cf785878960a310b0b1aa36658218 Mon Sep 17 00:00:00 2001 From: Kara Diaby Date: Tue, 22 Mar 2022 15:00:26 +0100 Subject: [PATCH] layout --- app/assets/stylesheets/card.scss | 6 +++++ app/views/shared/dossiers/_header.html.haml | 7 +++--- .../_procedure_removed_banner.html.haml | 22 +++++++++++++++++++ .../users/dossiers/show/_header.html.haml | 12 ++++------ .../dossiers/show/_print_dossier.html.haml | 6 +++++ 5 files changed, 42 insertions(+), 11 deletions(-) create mode 100644 app/views/users/dossiers/_procedure_removed_banner.html.haml create mode 100644 app/views/users/dossiers/show/_print_dossier.html.haml diff --git a/app/assets/stylesheets/card.scss b/app/assets/stylesheets/card.scss index ff90ff483..0a772dc09 100644 --- a/app/assets/stylesheets/card.scss +++ b/app/assets/stylesheets/card.scss @@ -53,6 +53,12 @@ } } + &.no-list { + ul { + list-style: none !important; + } + } + ul { list-style-type: disc; list-style-position: inside; diff --git a/app/views/shared/dossiers/_header.html.haml b/app/views/shared/dossiers/_header.html.haml index dbffd3434..ce1a700dc 100644 --- a/app/views/shared/dossiers/_header.html.haml +++ b/app/views/shared/dossiers/_header.html.haml @@ -8,7 +8,8 @@ = render(partial: 'users/dossiers/expiration_banner', locals: {dossier: dossier}) - .header-actions - - if current_user.owns?(dossier) + - if current_user.owns?(dossier) && !dossier.procedure.discarded? && !dossier.procedure.close? + .header-actions = render partial: 'invites/dropdown', locals: { dossier: dossier } - + - else + = render(partial: 'users/dossiers/procedure_removed_banner', locals: { dossier: dossier }) diff --git a/app/views/users/dossiers/_procedure_removed_banner.html.haml b/app/views/users/dossiers/_procedure_removed_banner.html.haml new file mode 100644 index 000000000..db410b2b7 --- /dev/null +++ b/app/views/users/dossiers/_procedure_removed_banner.html.haml @@ -0,0 +1,22 @@ +.card.warning.mb-3.no-list + - if dossier.procedure.discarded? + .flex.justify-between + .card-title= t('users.dossiers.header.banner.procedure_deleted_title') + = render(partial: 'users/dossiers/show/print_dossier', locals: { dossier: dossier}) if !dossier.brouillon? + - if dossier.termine? + %p + = t('users.dossiers.header.banner.procedure_deleted_dossier_termine_content') + - elsif dossier.brouillon? + %p + = t('users.dossiers.header.banner.procedure_close_content') + - else + %p + = t('users.dossiers.header.banner.procedure_deleted_dossier_en_cours_content') + + - else + .flex.justify-between + .card-title= t('users.dossiers.header.banner.procedure_close_title') + = render(partial: 'users/dossiers/show/print_dossier', locals: { dossier: dossier }) if !dossier.brouillon? + %p + = t('users.dossiers.header.banner.procedure_close_content') + diff --git a/app/views/users/dossiers/show/_header.html.haml b/app/views/users/dossiers/show/_header.html.haml index 4670a9811..19b2b0e39 100644 --- a/app/views/users/dossiers/show/_header.html.haml +++ b/app/views/users/dossiers/show/_header.html.haml @@ -12,19 +12,15 @@ = render(partial: 'users/dossiers/expiration_banner', locals: {dossier: dossier}) - - - if current_user.owns?(dossier) + - if (current_user.owns?(dossier) && !dossier.procedure.discarded?) || (!dossier.procedure.discarded? && !dossier.procedure.close? && !dossier.en_construction?) .header-actions = render partial: 'invites/dropdown', locals: { dossier: dossier } - if dossier.can_be_updated_by_user? && !current_page?(modifier_dossier_path(dossier)) = link_to t('views.users.dossiers.show.header.edit_dossier'), modifier_dossier_path(dossier), class: 'button accepted edit-form', 'title'=> "Vous pouvez modifier votre dossier tant qu'il n'est passé en instruction" - %span.dropdown.print-menu-opener - %button.button.dropdown-button.icon-only{ title: t('views.users.dossiers.show.header.print'), 'aria-label': 'imprimer', 'aria-expanded' => 'false', 'aria-controls' => 'print-menu' } - %span.icon.printer - %ul#print-menu.print-menu.dropdown-content - %li - = link_to t('views.users.dossiers.show.header.print_dossier'), dossier_path(dossier, format: :pdf), target: "_blank", rel: "noopener", class: "menu-item menu-link" + = render(partial: 'users/dossiers/show/print_dossier', locals: { dossier: dossier }) + - else + = render(partial: 'users/dossiers/procedure_removed_banner', locals: { dossier: dossier }) %nav.tabs %ul diff --git a/app/views/users/dossiers/show/_print_dossier.html.haml b/app/views/users/dossiers/show/_print_dossier.html.haml new file mode 100644 index 000000000..8f1aa0904 --- /dev/null +++ b/app/views/users/dossiers/show/_print_dossier.html.haml @@ -0,0 +1,6 @@ +%span.dropdown.print-menu-opener + %button.button.dropdown-button.icon-only{ title: t('views.users.dossiers.show.header.print'), 'aria-label': 'imprimer', 'aria-expanded' => 'false', 'aria-controls' => 'print-menu' } + %span.icon.printer + %ul#print-menu.print-menu.dropdown-content + %li + = link_to t('views.users.dossiers.show.header.print_dossier'), dossier_path(dossier, format: :pdf), target: "_blank", rel: "noopener", class: "menu-item menu-link"