diff --git a/app/views/experts/avis/instruction.html.haml b/app/views/experts/avis/instruction.html.haml index e41869024..fb6577350 100644 --- a/app/views/experts/avis/instruction.html.haml +++ b/app/views/experts/avis/instruction.html.haml @@ -51,7 +51,7 @@ = f.submit 'Envoyer votre avis', class: 'fr-btn' - if !@dossier.termine? - = render partial: "experts/shared/avis/form", locals: { url: avis_expert_avis_path(@avis.procedure, @avis), linked_dossiers: @dossier.linked_dossiers_for(current_expert), must_be_confidentiel: @avis.confidentiel?, avis: @new_avis } + = render partial: "experts/avis/shared/form", locals: { url: avis_expert_avis_path(@avis.procedure, @avis), linked_dossiers: @dossier.linked_dossiers_for(current_expert), must_be_confidentiel: @avis.confidentiel?, avis: @new_avis } - if @dossier.avis_for_expert(current_expert).present? - = render partial: 'experts/shared/avis/list', locals: { avis: @dossier.avis_for_expert(current_expert), avis_seen_at: nil } + = render partial: 'experts/avis/shared/list', locals: { avis: @dossier.avis_for_expert(current_expert), avis_seen_at: nil } diff --git a/app/views/experts/shared/avis/_form.html.haml b/app/views/experts/avis/shared/_form.html.haml similarity index 100% rename from app/views/experts/shared/avis/_form.html.haml rename to app/views/experts/avis/shared/_form.html.haml diff --git a/app/views/experts/shared/avis/_list.html.haml b/app/views/experts/avis/shared/_list.html.haml similarity index 100% rename from app/views/experts/shared/avis/_list.html.haml rename to app/views/experts/avis/shared/_list.html.haml diff --git a/app/views/experts/avis/shared/avis/_form.html.haml b/app/views/experts/avis/shared/avis/_form.html.haml deleted file mode 100644 index 1bd3633dd..000000000 --- a/app/views/experts/avis/shared/avis/_form.html.haml +++ /dev/null @@ -1,30 +0,0 @@ -%section.ask-avis - %h1.tab-title Inviter des personnes à donner leur avis - %p.avis-notice Les invités pourront consulter le dossier, donner un avis et contribuer au fil de messagerie. Ils ne pourront pas modifier le dossier. - - = form_for avis, url: url do |f| - = f.email_field :emails, placeholder: 'Adresses email, séparées par des virgules', required: true, multiple: true, data: { controller: 'format', format: 'list' } - = f.text_area :introduction, rows: 3, class: 'fr-input', value: avis.introduction || 'Bonjour, merci de me donner votre avis sur ce dossier.', required: true - %p.tab-title Ajouter une pièce jointe - .form-group - = render Attachment::EditComponent.new(attached_file: avis.introduction_file) - - - if linked_dossiers.present? - = f.check_box :invite_linked_dossiers, {}, true, false - = f.label :invite_linked_dossiers, t('helpers.label.invite_linked_dossiers', count: linked_dossiers.length, ids: linked_dossiers.map(&:id).to_sentence) - - .flex.justify-between.align-baseline - - if must_be_confidentiel - %p.confidentiel.flex - %span.icon.lock - %span - Cet avis sera confidentiel : il ne sera pas affiché aux autres experts consultés, mais sera visible par les instructeurs. - - - else - .confidentiel-wrapper - = f.label :confidentiel, 'Cet avis sera ', class: 'fr-label' - = f.select :confidentiel, [['partagé avec les autres experts', false], ['confidentiel', true]], {}, onchange: "javascript:DS.toggleCondidentielExplanation(event);", class: 'fr-select' - .confidentiel-explanation.hidden - Il ne sera pas affiché aux autres experts consultés, mais sera visible par les instructeurs. - - = f.submit 'Demander un avis', class: 'button primary send'