From b94fc7c132e7f192878567e6fb62bb12186191bd Mon Sep 17 00:00:00 2001 From: Simon Lehericey Date: Wed, 26 Jul 2017 11:22:04 +0200 Subject: [PATCH] NewDesign: list of avis --- app/assets/images/icons/bubble.svg | 1 + .../new_design/dossier_instruction.scss | 50 +++++++++++++++++++ .../dossiers/instruction.html.haml | 25 ++++++++++ 3 files changed, 76 insertions(+) create mode 100644 app/assets/images/icons/bubble.svg diff --git a/app/assets/images/icons/bubble.svg b/app/assets/images/icons/bubble.svg new file mode 100644 index 000000000..d423f2f4b --- /dev/null +++ b/app/assets/images/icons/bubble.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/assets/stylesheets/new_design/dossier_instruction.scss b/app/assets/stylesheets/new_design/dossier_instruction.scss index 68edfe61c..6a4ec475c 100644 --- a/app/assets/stylesheets/new_design/dossier_instruction.scss +++ b/app/assets/stylesheets/new_design/dossier_instruction.scss @@ -18,4 +18,54 @@ 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 62c654281..7cc345d3b 100644 --- a/app/views/new_gestionnaire/dossiers/instruction.html.haml +++ b/app/views/new_gestionnaire/dossiers/instruction.html.haml @@ -10,3 +10,28 @@ = 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' + + - if @dossier.avis.present? + %section.avis + %h1.title + Avis des invités + %span.count= @dossier.avis.count + + %ul + - @dossier.avis.each do |avis| + %li.one-avis + %h2.claimant + = (avis.claimant.email == current_gestionnaire.email) ? 'Vous' : avis.claimant.email + %span.date Demande d'avis envoyée le #{I18n.l(avis.created_at.localtime, format: '%d/%m/%y')} + %p= avis.introduction + + .answer.flex.align-start + = image_tag 'icons/bubble.svg', class: 'avis-icon' + .width-100 + %h2.gestionnaire + = avis.gestionnaire.email + - if avis.answer.present? + %span.date Réponse donnée le #{I18n.l(avis.updated_at.localtime, format: '%d/%m/%y')} + - else + %span.waiting En attente de réponse + %p= avis.answer