From d9f44e013a31e73f6c1031700f6591d6262c79ef Mon Sep 17 00:00:00 2001 From: Simon Lehericey Date: Wed, 22 Nov 2017 17:59:47 +0100 Subject: [PATCH] [fix #878] change motivation text and display a label if not action is possible --- .../stylesheets/new_design/backoffice.scss | 6 +++++ .../stylesheets/new_design/buttons.scss | 2 +- .../dossiers/_state_button.html.haml | 24 +++++++++++-------- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/app/assets/stylesheets/new_design/backoffice.scss b/app/assets/stylesheets/new_design/backoffice.scss index 1e3cf3003..2bb195260 100644 --- a/app/assets/stylesheets/new_design/backoffice.scss +++ b/app/assets/stylesheets/new_design/backoffice.scss @@ -24,3 +24,9 @@ // are ligned with those that have text vertical-align: top; } + +.mixed-buttons-bar .label { + padding: $default-spacer $default-padding; + font-size: 14px; + line-height: 20px; +} diff --git a/app/assets/stylesheets/new_design/buttons.scss b/app/assets/stylesheets/new_design/buttons.scss index 127e389b5..a85d82708 100644 --- a/app/assets/stylesheets/new_design/buttons.scss +++ b/app/assets/stylesheets/new_design/buttons.scss @@ -127,7 +127,7 @@ } .dossier-motivation { - margin-top: 2 * $default-padding; + margin: $default-padding 0; } .attestation { diff --git a/app/views/new_gestionnaire/dossiers/_state_button.html.haml b/app/views/new_gestionnaire/dossiers/_state_button.html.haml index 3c5f7ff2b..4c4e3cf8c 100644 --- a/app/views/new_gestionnaire/dossiers/_state_button.html.haml +++ b/app/views/new_gestionnaire/dossiers/_state_button.html.haml @@ -60,14 +60,18 @@ = button_tag "Valider la décision", name: :process_action, value: "close", class: 'button primary', title: 'Accepter', data: { confirm: "Accepter ce dossier ?" } - else - %span.button.dropdown{ class: dossier.closed? ? 'success' : nil } - = dossier.statut - .dropdown-content.fade-in-down.terminated - %h4 - = "Dossier nº #{dossier.id} #{dossier.statut}" + - if dossier.motivation.present? || dossier.attestation.present? + %span.button.dropdown{ class: dossier.closed? ? 'success' : nil } + = dossier.statut + .dropdown-content.fade-in-down.terminated + - if dossier.motivation.present? + %h4 Motivation + %p.dossier-motivation= dossier.motivation - %p.dossier-motivation= dossier.motivation.present? ? dossier.motivation : "aucune motivation n'a été fournie" - - - if dossier.attestation.present? - %p.attestation L'acceptation du dossier a envoyé automatiquement une attestation au demandeur - = link_to "Voir l'attestation", attestation_dossier_path(dossier.procedure, dossier), target: '_blank', class: 'button' + - if dossier.attestation.present? + %h4 Attestation + %p.attestation L'acceptation du dossier a envoyé automatiquement une attestation au demandeur + = link_to "Voir l'attestation", attestation_dossier_path(dossier.procedure, dossier), target: '_blank', class: 'button' + - else + %span.label{ class: dossier.closed? ? 'success' : nil } + = dossier.statut