From c93feb27f06e5446646b016dc5d0502971146519 Mon Sep 17 00:00:00 2001 From: Simon Lehericey Date: Wed, 6 Sep 2017 14:08:03 +0200 Subject: [PATCH 1/2] Avis style: extract class to avis.scss file for reuse in patron and avis --- app/assets/stylesheets/new_design/avis.scss | 73 +++++++++++++++++++ .../new_design/dossier_instruction.scss | 60 --------------- .../dossiers/instruction.html.haml | 4 +- app/views/root/patron.html.haml | 31 ++++++++ 4 files changed, 106 insertions(+), 62 deletions(-) create mode 100644 app/assets/stylesheets/new_design/avis.scss diff --git a/app/assets/stylesheets/new_design/avis.scss b/app/assets/stylesheets/new_design/avis.scss new file mode 100644 index 000000000..e2ebc5675 --- /dev/null +++ b/app/assets/stylesheets/new_design/avis.scss @@ -0,0 +1,73 @@ +@import "colors"; +@import "common"; +@import "constants"; + +.ask-avis { + h1 { + font-size: 18px; + font-weight: bold; + margin-bottom: $default-padding; + } + + .avis-notice { + font-size: 12px; + color: $grey; + margin-bottom: 2 * $default-padding; + } + + input[type=email] { + max-width: 500px; + } +} + +.list-avis { + .title { + font-size: 18px; + font-weight: bold; + margin-bottom: $default-padding; + + .count { + display: inline-block; + width: 20px; + height: 20px; + border-radius: 10px; + border: 1px solid $grey; + text-align: center; + font-size: 12px; + font-weight: normal; + margin-left: 8px; + } + } + + .one-avis { + border-top: 1px solid $grey; + padding: $default-padding 0; + + h2 { + font-weight: bold; + margin-bottom: $default-spacer; + + span { + font-weight: normal; + } + } + + .answer { + margin-top: $default-padding; + } + + .avis-icon { + margin-right: $default-spacer; + } + } + + .date, + .waiting { + font-size: 12px; + color: $grey; + } + + .date { + float: right; + } +} diff --git a/app/assets/stylesheets/new_design/dossier_instruction.scss b/app/assets/stylesheets/new_design/dossier_instruction.scss index 6a4ec475c..9a0747fb8 100644 --- a/app/assets/stylesheets/new_design/dossier_instruction.scss +++ b/app/assets/stylesheets/new_design/dossier_instruction.scss @@ -8,64 +8,4 @@ font-weight: bold; margin-bottom: $default-padding; } - - .avis-notice { - font-size: 12px; - color: $grey; - margin-bottom: 2 * $default-padding; - } - - input[type=email] { - max-width: 500px; - } - - .avis { - .title { - margin-bottom: $default-padding; - - .count { - display: inline-block; - width: 20px; - height: 20px; - border-radius: 10px; - border: 1px solid $grey; - text-align: center; - font-size: 12px; - font-weight: normal; - margin-left: 8px; - } - } - - .one-avis { - border-top: 1px solid $grey; - padding: $default-padding 0; - - h2 { - font-weight: bold; - margin-bottom: $default-spacer; - - span { - font-weight: normal; - } - } - - .answer { - margin-top: $default-padding; - } - - .avis-icon { - margin-right: $default-spacer; - } - } - - .date, - .waiting { - font-size: 12px; - color: $grey; - } - - .date { - float: right; - } - } } diff --git a/app/views/new_gestionnaire/dossiers/instruction.html.haml b/app/views/new_gestionnaire/dossiers/instruction.html.haml index 652eda87a..09d04380f 100644 --- a/app/views/new_gestionnaire/dossiers/instruction.html.haml +++ b/app/views/new_gestionnaire/dossiers/instruction.html.haml @@ -1,7 +1,7 @@ = render partial: "header", locals: { dossier: @dossier } #dossier-instruction.container - %section + %section.ask-avis %h1 Inviter une personne à donner son avis %p.avis-notice Elle pourra consulter, donner un avis sur le dossier et contribuer au fil de messagerie, mais elle ne pourra le modifier. @@ -12,7 +12,7 @@ = f.submit 'Demander un avis', class: 'button send' - if @dossier.avis.present? - %section.avis + %section.list-avis %h1.title Avis des invités %span.count= @dossier.avis.count diff --git a/app/views/root/patron.html.haml b/app/views/root/patron.html.haml index e13f0e31d..588a9f448 100644 --- a/app/views/root/patron.html.haml +++ b/app/views/root/patron.html.haml @@ -155,3 +155,34 @@ Insérer ici le contenu de la colonne 1 .column Insérer ici le contenu de la colonne 2 + + .container + %section.ask-avis + %h1 Inviter une personne à donner son avis + %p.avis-notice Elle pourra consulter, donner un avis sur le dossier et contribuer au fil de messagerie, mais elle ne pourra le modifier. + + = form_for Avis.new, url: '/', html: { class: 'form' } do |f| + = f.email_field :email, placeholder: 'Adresse email', required: true + = f.text_area :introduction, rows: 3, value: 'Bonjour, merci de me donner votre avis sur ce dossier.', required: true + .send-wrapper + = f.submit 'Demander un avis', class: 'button send' + + %section.list-avis + %h1.title + Avis des invités + %span.count 1 + + %ul + %li.one-avis + %h2.claimant + Vous + %span.date Demande d'avis envoyée le 12/01/2012 + %p Bonjour, merci de me donner votre avis sur ce dossier. + + .answer.flex.align-start + = image_tag 'icons/bubble.svg', class: 'avis-icon' + .width-100 + %h2.gestionnaire + gestionnnaire@tps.com + %span.date Réponse donnée le 13/01/2012 + %p Je donne un avis favorable From c9f69e9693160b99e5a50e4edbe49646b7cc3464 Mon Sep 17 00:00:00 2001 From: Simon Lehericey Date: Thu, 7 Sep 2017 10:30:40 +0200 Subject: [PATCH 2/2] Avis Style: replace bubble image tag by the i tag --- app/assets/stylesheets/new_design/icons.scss | 4 ++++ app/views/new_gestionnaire/dossiers/instruction.html.haml | 2 +- app/views/root/patron.html.haml | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/assets/stylesheets/new_design/icons.scss b/app/assets/stylesheets/new_design/icons.scss index 924ce4961..a22cd9afd 100644 --- a/app/assets/stylesheets/new_design/icons.scss +++ b/app/assets/stylesheets/new_design/icons.scss @@ -44,4 +44,8 @@ i { &.in-progress { background-image: image-url("icons/in-progress-blue.svg"); } + + &.bubble { + background-image: image-url("icons/bubble.svg"); + } } diff --git a/app/views/new_gestionnaire/dossiers/instruction.html.haml b/app/views/new_gestionnaire/dossiers/instruction.html.haml index 09d04380f..016abc911 100644 --- a/app/views/new_gestionnaire/dossiers/instruction.html.haml +++ b/app/views/new_gestionnaire/dossiers/instruction.html.haml @@ -26,7 +26,7 @@ %p= avis.introduction .answer.flex.align-start - = image_tag 'icons/bubble.svg', class: 'avis-icon' + %i.bubble.avis-icon .width-100 %h2.gestionnaire = avis.gestionnaire.email diff --git a/app/views/root/patron.html.haml b/app/views/root/patron.html.haml index 588a9f448..5d295de01 100644 --- a/app/views/root/patron.html.haml +++ b/app/views/root/patron.html.haml @@ -12,6 +12,7 @@ %i.without-continuation %i.edit %i.in-progress + %i.bubble %h1 Formulaires @@ -180,7 +181,7 @@ %p Bonjour, merci de me donner votre avis sur ce dossier. .answer.flex.align-start - = image_tag 'icons/bubble.svg', class: 'avis-icon' + %i.bubble.avis-icon .width-100 %h2.gestionnaire gestionnnaire@tps.com