diff --git a/app/assets/javascripts/new_design/avis.js b/app/assets/javascripts/new_design/avis.js new file mode 100644 index 000000000..79bc9f596 --- /dev/null +++ b/app/assets/javascripts/new_design/avis.js @@ -0,0 +1,3 @@ +TPS.toggleCondidentielExplanation = function(event) { + $(".confidentiel-explanation").toggle(); +} diff --git a/app/assets/stylesheets/new_design/avis.scss b/app/assets/stylesheets/new_design/avis.scss index 5ad45e97e..51930f4bc 100644 --- a/app/assets/stylesheets/new_design/avis.scss +++ b/app/assets/stylesheets/new_design/avis.scss @@ -59,6 +59,18 @@ display: inline-block; } } + + .lock { + margin-right: $default-spacer; + } + + .confidentiel-explanation { + display: none; + font-size: 14px; + color: $grey; + margin-top: -$default-padding; + margin-bottom: 2 * $default-padding; + } } .list-avis { diff --git a/app/views/new_gestionnaire/avis/instruction.html.haml b/app/views/new_gestionnaire/avis/instruction.html.haml index b69d3ad9f..e4e3d5b3e 100644 --- a/app/views/new_gestionnaire/avis/instruction.html.haml +++ b/app/views/new_gestionnaire/avis/instruction.html.haml @@ -14,9 +14,10 @@ = form_for @avis, url: avis_path(@avis), html: { class: 'form' } do |f| = f.text_area :answer, rows: 3, placeholder: 'Votre avis', required: true .flex.justify-between.align-baseline - %p.confidentiel + %p.confidentiel.flex %span.icon.lock - Cet avis est confidentiel et n'est pas affiché aux autres experts consultés + %span + Cet avis est confidentiel et n'est pas affiché aux autres experts consultés .send-wrapper = f.submit 'Envoyer votre avis', class: 'button send' diff --git a/app/views/new_gestionnaire/shared/avis/_form.html.haml b/app/views/new_gestionnaire/shared/avis/_form.html.haml index 037dd338e..9f9f866a0 100644 --- a/app/views/new_gestionnaire/shared/avis/_form.html.haml +++ b/app/views/new_gestionnaire/shared/avis/_form.html.haml @@ -7,14 +7,17 @@ = f.text_area :introduction, rows: 3, value: 'Bonjour, merci de me donner votre avis sur ce dossier.', required: true .flex.justify-between.align-baseline - if must_be_confidentiel - %p.confidentiel + %p.confidentiel.flex %span.icon.lock - Cet avis est confidentiel et n'est pas affiché aux autres experts consultés + %span + Cet avis est confidentiel et n'est pas affiché aux autres experts consultés mais est visible par tous les accompagnateurs .send-wrapper = f.submit 'Demander un avis', class: 'button send' - else .confidentiel-wrapper = f.label :confidentiel, 'Cet avis est' - = f.select :confidentiel, [['partagé avec les autres experts', false], ['confidentiel', true]] + = f.select :confidentiel, [['partagé avec les autres experts', false], ['confidentiel', true]], {}, onchange: "javascript:TPS.toggleCondidentielExplanation(event);" + .confidentiel-explanation + Il ne sera pas affiché aux autres experts consultés mais sera visible par les accompagnateurs .send-wrapper = f.submit 'Demander un avis', class: 'button send'