split form and avis answers in 2 views for experts and add sidemenu
This commit is contained in:
parent
603d66e020
commit
c51e6aa2e6
7 changed files with 81 additions and 44 deletions
|
@ -6,7 +6,7 @@ module Experts
|
||||||
before_action :authenticate_expert!, except: [:sign_up, :update_expert]
|
before_action :authenticate_expert!, except: [:sign_up, :update_expert]
|
||||||
before_action :check_if_avis_revoked, except: [:index, :procedure]
|
before_action :check_if_avis_revoked, except: [:index, :procedure]
|
||||||
before_action :redirect_if_no_sign_up_needed, only: [:sign_up, :update_expert]
|
before_action :redirect_if_no_sign_up_needed, only: [:sign_up, :update_expert]
|
||||||
before_action :set_avis_and_dossier, only: [:show, :instruction, :messagerie, :create_commentaire, :delete_commentaire, :update, :telecharger_pjs]
|
before_action :set_avis_and_dossier, only: [:show, :instruction, :avis_list, :messagerie, :create_commentaire, :delete_commentaire, :update, :telecharger_pjs]
|
||||||
|
|
||||||
A_DONNER_STATUS = 'a-donner'
|
A_DONNER_STATUS = 'a-donner'
|
||||||
DONNES_STATUS = 'donnes'
|
DONNES_STATUS = 'donnes'
|
||||||
|
@ -56,6 +56,9 @@ module Experts
|
||||||
@new_avis = Avis.new
|
@new_avis = Avis.new
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def avis_list
|
||||||
|
end
|
||||||
|
|
||||||
def create_avis
|
def create_avis
|
||||||
@procedure = Procedure.find(params[:procedure_id])
|
@procedure = Procedure.find(params[:procedure_id])
|
||||||
@new_avis = create_avis_from_params(avis.dossier, current_expert, avis.confidentiel)
|
@new_avis = create_avis_from_params(avis.dossier, current_expert, avis.confidentiel)
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
@import '@gouvfr/dsfr/dist/component/header/header.css';
|
@import '@gouvfr/dsfr/dist/component/header/header.css';
|
||||||
@import '@gouvfr/dsfr/dist/component/footer/footer.css';
|
@import '@gouvfr/dsfr/dist/component/footer/footer.css';
|
||||||
@import '@gouvfr/dsfr/dist/component/search/search.css';
|
@import '@gouvfr/dsfr/dist/component/search/search.css';
|
||||||
|
@import '@gouvfr/dsfr/dist/component/sidemenu/sidemenu.css';
|
||||||
@import '@gouvfr/dsfr/dist/component/translate/translate.css';
|
@import '@gouvfr/dsfr/dist/component/translate/translate.css';
|
||||||
@import '@gouvfr/dsfr/dist/component/pagination/pagination.css';
|
@import '@gouvfr/dsfr/dist/component/pagination/pagination.css';
|
||||||
@import '@gouvfr/dsfr/dist/component/skiplink/skiplink.css';
|
@import '@gouvfr/dsfr/dist/component/skiplink/skiplink.css';
|
||||||
|
|
|
@ -18,5 +18,5 @@
|
||||||
%nav.tabs
|
%nav.tabs
|
||||||
%ul
|
%ul
|
||||||
= dynamic_tab_item('Demande', expert_avis_path(avis.procedure, avis))
|
= dynamic_tab_item('Demande', expert_avis_path(avis.procedure, avis))
|
||||||
= dynamic_tab_item('Avis', instruction_expert_avis_path(avis.procedure, avis), notification: avis.answer.blank?)
|
= dynamic_tab_item('Avis', [instruction_expert_avis_path(avis.procedure, avis), avis_list_expert_avis_path(avis.procedure, avis)], notification: avis.answer.blank?)
|
||||||
= dynamic_tab_item('Messagerie', messagerie_expert_avis_path(avis.procedure, avis))
|
= dynamic_tab_item('Messagerie', messagerie_expert_avis_path(avis.procedure, avis))
|
||||||
|
|
17
app/views/experts/avis/_sidemenu.html.haml
Normal file
17
app/views/experts/avis/_sidemenu.html.haml
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
%nav.fr-sidemenu{"aria-labelledby" => "fr-sidemenu-title"}
|
||||||
|
.fr-sidemenu__inner
|
||||||
|
%button.fr-sidemenu__btn{"aria-controls" => "fr-sidemenu-wrapper", "aria-expanded" => "false", hidden: ""} Dans cette rubrique
|
||||||
|
#fr-sidemenu-wrapper.fr-collapse
|
||||||
|
%ul.fr-sidemenu__list
|
||||||
|
- current_page = current_page?(instruction_expert_avis_path(@avis.procedure, @avis))
|
||||||
|
%li{class: "fr-sidemenu__item fr-sidemenu__item#{current_page ? '--active' : ''}"}
|
||||||
|
%a.fr-sidemenu__link{'aria-current': current_page ? 'page' : nil, href: instruction_expert_avis_path(@avis.procedure, @avis), target: "_self"} Donner votre avis
|
||||||
|
|
||||||
|
- current_page = current_page?(avis_list_expert_avis_path(@avis.procedure, @avis))
|
||||||
|
- if @dossier.avis_for_expert(current_expert).present?
|
||||||
|
%li{class: "fr-sidemenu__item fr-sidemenu__item#{current_page ? '--active' : ''}"}
|
||||||
|
%a.fr-sidemenu__link{'aria-current': current_page ? 'page' : nil,href: avis_list_expert_avis_path(@avis.procedure, @avis), target: "_self"} Voir les avis
|
||||||
|
|
||||||
|
-# - if !@dossier.termine?
|
||||||
|
-# %li.fr-sidemenu__item
|
||||||
|
-# %a.fr-sidemenu__link{href: "#", target: "_self"} Demander un nouvel avis
|
11
app/views/experts/avis/avis_list.html.haml
Normal file
11
app/views/experts/avis/avis_list.html.haml
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
- content_for(:title, "Avis · Dossier nº #{@dossier.id} (#{@dossier.owner_name})")
|
||||||
|
|
||||||
|
= render partial: 'header', locals: { avis: @avis, dossier: @dossier }
|
||||||
|
|
||||||
|
.container
|
||||||
|
.fr-grid-row
|
||||||
|
.fr-col.fr-col-12.fr-col-md-3
|
||||||
|
= render partial: 'sidemenu'
|
||||||
|
.fr-col
|
||||||
|
- if @dossier.avis_for_expert(current_expert).present?
|
||||||
|
= render partial: 'experts/avis/shared/list', locals: { avis: @dossier.avis_for_expert(current_expert), avis_seen_at: nil }
|
|
@ -3,6 +3,10 @@
|
||||||
= render partial: 'header', locals: { avis: @avis, dossier: @dossier }
|
= render partial: 'header', locals: { avis: @avis, dossier: @dossier }
|
||||||
|
|
||||||
.container
|
.container
|
||||||
|
.fr-grid-row
|
||||||
|
.fr-col.fr-col-12.fr-col-md-3
|
||||||
|
= render partial: 'sidemenu'
|
||||||
|
.fr-col
|
||||||
%section.give-avis
|
%section.give-avis
|
||||||
%h1.tab-title Donner votre avis
|
%h1.tab-title Donner votre avis
|
||||||
%h2.claimant
|
%h2.claimant
|
||||||
|
@ -50,8 +54,8 @@
|
||||||
.send-wrapper
|
.send-wrapper
|
||||||
= f.submit 'Envoyer votre avis', class: 'fr-btn'
|
= f.submit 'Envoyer votre avis', class: 'fr-btn'
|
||||||
|
|
||||||
- if !@dossier.termine?
|
-# - if !@dossier.termine?
|
||||||
= 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 }
|
-# = 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?
|
-# - if @dossier.avis_for_expert(current_expert).present?
|
||||||
= render partial: 'experts/avis/shared/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 }
|
||||||
|
|
|
@ -355,6 +355,7 @@ Rails.application.routes.draw do
|
||||||
get '', action: 'procedure', on: :collection, as: :procedure
|
get '', action: 'procedure', on: :collection, as: :procedure
|
||||||
member do
|
member do
|
||||||
get 'instruction'
|
get 'instruction'
|
||||||
|
get 'avis_list'
|
||||||
get 'messagerie'
|
get 'messagerie'
|
||||||
post 'commentaire' => 'avis#create_commentaire'
|
post 'commentaire' => 'avis#create_commentaire'
|
||||||
post 'avis' => 'avis#create_avis'
|
post 'avis' => 'avis#create_avis'
|
||||||
|
|
Loading…
Reference in a new issue