From f9c2da7a5d72272b0edeb3befb5f681785d46012 Mon Sep 17 00:00:00 2001 From: Simon Lehericey Date: Thu, 23 Nov 2017 09:32:51 +0100 Subject: [PATCH 1/3] Style: change label class form closed to success --- app/assets/stylesheets/new_design/labels.scss | 2 +- app/views/new_gestionnaire/procedures/_status.html.haml | 2 +- app/views/root/patron.html.haml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/assets/stylesheets/new_design/labels.scss b/app/assets/stylesheets/new_design/labels.scss index c61fdaba0..346510fcb 100644 --- a/app/assets/stylesheets/new_design/labels.scss +++ b/app/assets/stylesheets/new_design/labels.scss @@ -23,7 +23,7 @@ border: 1px solid $black; } - &.closed { + &.success { background-color: $green; } diff --git a/app/views/new_gestionnaire/procedures/_status.html.haml b/app/views/new_gestionnaire/procedures/_status.html.haml index b6fbd6df9..cd70a0a85 100644 --- a/app/views/new_gestionnaire/procedures/_status.html.haml +++ b/app/views/new_gestionnaire/procedures/_status.html.haml @@ -3,7 +3,7 @@ - elsif dossier.en_construction? %span.label.construction en construction - elsif dossier.closed? - %span.label.closed accepté + %span.label.success accepté - elsif dossier.refused? %span.label.refused refusé - elsif dossier.without_continuation? diff --git a/app/views/root/patron.html.haml b/app/views/root/patron.html.haml index 04a0dabcc..d30844add 100644 --- a/app/views/root/patron.html.haml +++ b/app/views/root/patron.html.haml @@ -67,7 +67,7 @@ %span.label .label %span.label.instruction .label.instruction %span.label.construction .label.construction - %span.label.closed .label.closed + %span.label.success .label.success %span.label.refused .label.refused %span.label.without-continuation .label.without-continuation From e28b18d978348756a178c21f53c4c94faa75d952 Mon Sep 17 00:00:00 2001 From: Simon Lehericey Date: Wed, 22 Nov 2017 15:40:53 +0100 Subject: [PATCH 2/3] Dossier: add statut method --- app/models/dossier.rb | 10 ++++++++++ .../dossiers/_state_button.html.haml | 14 ++------------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app/models/dossier.rb b/app/models/dossier.rb index fbcdca8b8..e6ac87ad7 100644 --- a/app/models/dossier.rb +++ b/app/models/dossier.rb @@ -363,6 +363,16 @@ class Dossier < ActiveRecord::Base end end + def statut + if closed? + 'accepté' + elsif without_continuation? + 'classé sans suite' + elsif refused? + 'refusé' + end + end + private def build_attestation diff --git a/app/views/new_gestionnaire/dossiers/_state_button.html.haml b/app/views/new_gestionnaire/dossiers/_state_button.html.haml index b973d9491..3c5f7ff2b 100644 --- a/app/views/new_gestionnaire/dossiers/_state_button.html.haml +++ b/app/views/new_gestionnaire/dossiers/_state_button.html.haml @@ -61,20 +61,10 @@ - else %span.button.dropdown{ class: dossier.closed? ? 'success' : nil } - - if dossier.closed? - accepté - - elsif dossier.without_continuation? - classé sans suite - - elsif dossier.refused? - refusé + = dossier.statut .dropdown-content.fade-in-down.terminated %h4 - - if dossier.closed? - Dossier nº #{dossier.id} accepté - - elsif dossier.without_continuation? - Dossier nº #{dossier.id} classé sans suite - - elsif dossier.refused? - Dossier nº #{dossier.id} refusé + = "Dossier nº #{dossier.id} #{dossier.statut}" %p.dossier-motivation= dossier.motivation.present? ? dossier.motivation : "aucune motivation n'a été fournie" From d9f44e013a31e73f6c1031700f6591d6262c79ef Mon Sep 17 00:00:00 2001 From: Simon Lehericey Date: Wed, 22 Nov 2017 17:59:47 +0100 Subject: [PATCH 3/3] [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