Expert Layout
This commit is contained in:
parent
e79b1204e0
commit
5519ee8417
6 changed files with 94 additions and 5 deletions
|
@ -31,8 +31,8 @@
|
|||
.send-wrapper
|
||||
= f.submit 'Envoyer votre avis', class: 'button send'
|
||||
|
||||
- if !@dossier.termine? && !feature_enabled_for?(:expert_not_allowed_to_invite, @avis.procedure)
|
||||
= render partial: "instructeurs/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 }
|
||||
- if !@dossier.termine? && !@avis.procedure.feature_enabled?(:expert_not_allowed_to_invite)
|
||||
= 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 }
|
||||
|
||||
- if @dossier.avis_for(current_expert).present?
|
||||
= render partial: 'instructeurs/shared/avis/list', locals: { avis: @dossier.avis_for(current_expert), avis_seen_at: nil }
|
||||
- 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 }
|
||||
|
|
5
app/views/experts/avis/messagerie.html.haml
Normal file
5
app/views/experts/avis/messagerie.html.haml
Normal file
|
@ -0,0 +1,5 @@
|
|||
- content_for(:title, "Messagerie · Dossier nº #{@dossier.id} (#{@dossier.owner_name})")
|
||||
|
||||
= render partial: 'header', locals: { avis: @avis, dossier: @dossier }
|
||||
|
||||
= render partial: "shared/dossiers/messagerie", locals: { dossier: @dossier, connected_user: current_expert, messagerie_seen_at: nil, new_commentaire: @commentaire, form_url: commentaire_expert_avis_path(@avis) }
|
|
@ -2,4 +2,4 @@
|
|||
|
||||
= render partial: 'header', locals: { avis: @avis, dossier: @dossier }
|
||||
|
||||
= render partial: 'shared/dossiers/demande', locals: { dossier: @dossier, demande_seen_at: nil, profile: 'instructeur' }
|
||||
= render partial: 'shared/dossiers/demande', locals: { dossier: @dossier, demande_seen_at: nil, profile: 'expert' }
|
||||
|
|
16
app/views/experts/avis/sign_up.html.haml
Normal file
16
app/views/experts/avis/sign_up.html.haml
Normal file
|
@ -0,0 +1,16 @@
|
|||
.two-columns.avis-sign-up
|
||||
.columns-container
|
||||
.column.left
|
||||
%p.description= @dossier.procedure.libelle
|
||||
%p.dossier Dossier nº #{@dossier.id}
|
||||
.column
|
||||
= form_for(User.new, url: { controller: "experts/avis", action: :update_expert }, method: :post, html: { class: "form" }) do |f|
|
||||
%h1 Créez-vous un compte
|
||||
|
||||
= f.label :email, "Email"
|
||||
= f.email_field :email, value: @email, disabled: true
|
||||
|
||||
= f.label :password, "Mot de passe"
|
||||
= f.password_field :password, required: true, placeholder: "#{PASSWORD_MIN_LENGTH} caractères minimum"
|
||||
|
||||
= f.submit "Créer un compte", class: "button large primary expand"
|
30
app/views/experts/shared/avis/_form.html.haml
Normal file
30
app/views/experts/shared/avis/_form.html.haml
Normal file
|
@ -0,0 +1,30 @@
|
|||
%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, html: { class: 'form' } do |f|
|
||||
= f.email_field :emails, placeholder: 'Adresses email, séparées par des virgules', required: true, multiple: true, onchange: "javascript:DS.replaceSemicolonByComma(event);"
|
||||
= f.text_area :introduction, rows: 3, 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
|
||||
= text_upload_and_render f, 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 '
|
||||
= f.select :confidentiel, [['partagé avec les autres experts', false], ['confidentiel', true]], {}, onchange: "javascript:DS.toggleCondidentielExplanation(event);"
|
||||
.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'
|
38
app/views/experts/shared/avis/_list.html.haml
Normal file
38
app/views/experts/shared/avis/_list.html.haml
Normal file
|
@ -0,0 +1,38 @@
|
|||
%section.list-avis
|
||||
%h1.tab-title
|
||||
Avis des invités
|
||||
%span.count= avis.count
|
||||
|
||||
%ul
|
||||
- avis.each do |avis|
|
||||
%li.one-avis.flex.align-start
|
||||
.width-100
|
||||
%h2.claimant
|
||||
= "#{t('claimant', scope: 'activerecord.attributes.avis')} :"
|
||||
%span.email= (avis.claimant.email == current_expert.email) ? 'Vous' : avis.claimant.email
|
||||
- if avis.confidentiel?
|
||||
%span.confidentiel
|
||||
= t('confidentiel', scope: 'activerecord.attributes.avis')
|
||||
%span.icon.lock{ title: t('confidentiel', scope: 'helpers.hint') }
|
||||
%span.date{ class: highlight_if_unseen_class(avis_seen_at, avis.created_at) }
|
||||
= t('demande_envoyee_le', scope: 'views.shared.avis', date: l(avis.created_at, format: '%d/%m/%y à %H:%M'))
|
||||
%p= avis.introduction
|
||||
|
||||
.answer.flex.align-start
|
||||
%span.icon.bubble.avis-icon
|
||||
.width-100
|
||||
%h2.instructeur
|
||||
= (avis.expert.email == current_expert.email) ? 'Vous' : avis.expert.email
|
||||
- if avis.answer.present?
|
||||
- if avis.revoked?
|
||||
%span.waiting{ class: highlight_if_unseen_class(avis_seen_at, avis.revoked_at) }
|
||||
= t('demande_revoquee_le', scope: 'views.shared.avis', date: l(avis.revoked_at, format: '%d/%m/%y à %H:%M'))
|
||||
%span.date{ class: highlight_if_unseen_class(avis_seen_at, avis.updated_at) }
|
||||
= t('reponse_donnee_le', scope: 'views.shared.avis', date: l(avis.updated_at, format: '%d/%m/%y à %H:%M'))
|
||||
- else
|
||||
%span.waiting
|
||||
= t('en_attente', scope: 'views.shared.avis')
|
||||
- if avis.piece_justificative_file.attached?
|
||||
= render partial: 'shared/attachment/show', locals: { attachment: avis.piece_justificative_file.attachment }
|
||||
.answer-body
|
||||
= simple_format(avis.answer)
|
Loading…
Reference in a new issue