remove unused view and routes from instructeurs avis
This commit is contained in:
parent
d21ff7a762
commit
c1b5daadef
14 changed files with 12 additions and 124 deletions
|
@ -142,7 +142,7 @@ module Experts
|
|||
extension = params[:format]
|
||||
render extension.to_sym => avis.dossier.etablissement.entreprise_bilans_bdf_to_sheet(extension)
|
||||
else
|
||||
redirect_to instructeur_avis_path(avis)
|
||||
redirect_to expert_avis_path(avis)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -13,12 +13,12 @@
|
|||
.procedure-details
|
||||
%p.fr-mb-2w
|
||||
= procedure_badge(p)
|
||||
= link_to(p.libelle, procedure_instructeur_avis_index_path(p), class: "fr-link fr-ml-1w")
|
||||
= link_to(p.libelle, procedure_expert_avis_index_path(p), class: "fr-link fr-ml-1w")
|
||||
|
||||
%ul.procedure-stats.flex
|
||||
%li
|
||||
%object
|
||||
= link_to(procedure_instructeur_avis_index_path(p, statut: Instructeurs::AvisController::A_DONNER_STATUS)) do
|
||||
= link_to(procedure_expert_avis_index_path(p, statut: Instructeurs::AvisController::A_DONNER_STATUS)) do
|
||||
- without_answer_count = procedure_avis.select { |a| a.answer.nil? }.size
|
||||
- if without_answer_count > 0
|
||||
%span.notifications{ 'aria-label': "notifications" }
|
||||
|
@ -28,7 +28,7 @@
|
|||
avis à donner
|
||||
%li
|
||||
%object
|
||||
= link_to(procedure_instructeur_avis_index_path(p, statut: Instructeurs::AvisController::DONNES_STATUS)) do
|
||||
= link_to(procedure_expert_avis_index_path(p, statut: Instructeurs::AvisController::DONNES_STATUS)) do
|
||||
- with_answer_count = procedure_avis.select { |a| a.answer.present? }.size
|
||||
.stats-number= with_answer_count
|
||||
.stats-legend
|
||||
|
|
|
@ -36,11 +36,11 @@
|
|||
- @avis.each do |avis|
|
||||
%tr
|
||||
%td.number-col
|
||||
= link_to(instructeur_avis_path(avis.procedure, avis), class: 'cell-link') do
|
||||
= link_to(expert_avis_path(avis.procedure, avis), class: 'cell-link') do
|
||||
%span.icon.folder
|
||||
#{avis.dossier.id}
|
||||
%td= link_to(avis.dossier.user_email_for(:display), instructeur_avis_path(avis.procedure, avis), class: 'cell-link')
|
||||
%td= link_to(avis.procedure.libelle, instructeur_avis_path(avis.procedure, avis), class: 'cell-link')
|
||||
%td= link_to(avis.dossier.user_email_for(:display), expert_avis_path(avis.procedure, avis), class: 'cell-link')
|
||||
%td= link_to(avis.procedure.libelle, expert_avis_path(avis.procedure, avis), class: 'cell-link')
|
||||
= paginate(@avis)
|
||||
- else
|
||||
%h2.empty-text Aucun avis
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
.sub-header
|
||||
.container
|
||||
%ul.breadcrumbs
|
||||
%li= link_to('Avis', instructeur_all_avis_path)
|
||||
%li
|
||||
= link_to(procedure.libelle, procedure_instructeur_avis_index_path(avis.procedure), class: "fr-link")
|
||||
= procedure_badge(dossier.procedure)
|
||||
%li= link_to("Dossier nº #{dossier.id}", instructeur_avis_path(avis.procedure, avis))
|
||||
|
||||
%nav.tabs
|
||||
%ul
|
||||
= dynamic_tab_item('Demande', instructeur_avis_path(avis.procedure, avis))
|
||||
= dynamic_tab_item('Avis', instruction_instructeur_avis_path(avis.procedure, avis), notification: avis.answer.blank?)
|
||||
= dynamic_tab_item('Messagerie', messagerie_instructeur_avis_path(avis.procedure, avis))
|
|
@ -1,41 +0,0 @@
|
|||
- content_for(:title, "Avis")
|
||||
|
||||
.container
|
||||
%h1.page-title Avis
|
||||
|
||||
%ul.procedure-list
|
||||
- @avis_by_procedure.each do |p, procedure_avis|
|
||||
%li.procedure-item.flex.align-start
|
||||
= link_to(procedure_instructeur_avis_index_path(p)) do
|
||||
.flex
|
||||
|
||||
.procedure-logo{ style: "background-image: url(#{p.logo_url})" }
|
||||
|
||||
.procedure-details
|
||||
%p.procedure-title
|
||||
= procedure_libelle p
|
||||
%ul.procedure-stats.flex
|
||||
%li
|
||||
%object
|
||||
= link_to(procedure_instructeur_avis_index_path(p, statut: Instructeurs::AvisController::A_DONNER_STATUS)) do
|
||||
- without_answer_count = procedure_avis.select { |a| a.answer.nil? }.size
|
||||
- if without_answer_count > 0
|
||||
%span.notifications{ 'aria-label': "notifications" }
|
||||
.stats-number
|
||||
= without_answer_count
|
||||
.stats-legend
|
||||
avis à donner
|
||||
%li
|
||||
%object
|
||||
= link_to(procedure_instructeur_avis_index_path(p, statut: Instructeurs::AvisController::DONNES_STATUS)) do
|
||||
- with_answer_count = procedure_avis.select { |a| a.answer.present? }.size
|
||||
.stats-number= with_answer_count
|
||||
.stats-legend
|
||||
= pluralize(with_answer_count, "avis donné")
|
||||
|
||||
- if p.close?
|
||||
.procedure-status
|
||||
%span.label Close
|
||||
- elsif p.depubliee?
|
||||
.procedure-status
|
||||
%span.label Dépubliée
|
|
@ -1,5 +0,0 @@
|
|||
- 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_instructeur, messagerie_seen_at: nil, new_commentaire: @commentaire, form_url: commentaire_instructeur_avis_path(@avis) }
|
|
@ -1,46 +0,0 @@
|
|||
- avis_statut = (@statut == Instructeurs::AvisController::A_DONNER_STATUS) ? 'à donner' : 'rendus'
|
||||
- content_for(:title, "Avis #{avis_statut}")
|
||||
|
||||
#procedure-show
|
||||
.sub-header
|
||||
.container.flex
|
||||
|
||||
.procedure-logo{ style: "background-image: url(#{@procedure.logo_url})",
|
||||
role: 'img', 'aria-label': "logo de la démarche #{@procedure.libelle}" }
|
||||
|
||||
.procedure-header
|
||||
%h1= procedure_libelle @procedure
|
||||
|
||||
%nav.tabs
|
||||
%ul
|
||||
= tab_item('avis à donner',
|
||||
procedure_instructeur_avis_index_path(statut: Instructeurs::AvisController::A_DONNER_STATUS),
|
||||
active: @statut == Instructeurs::AvisController::A_DONNER_STATUS,
|
||||
badge: @avis_a_donner.count,
|
||||
notification: @avis_a_donner.any?)
|
||||
|
||||
= tab_item("avis #{'donné'.pluralize(@avis_donnes.count)}",
|
||||
procedure_instructeur_avis_index_path(statut: Instructeurs::AvisController::DONNES_STATUS),
|
||||
active: @statut == Instructeurs::AvisController::DONNES_STATUS,
|
||||
badge: @avis_donnes.count)
|
||||
|
||||
.container
|
||||
- if @avis.present?
|
||||
%table.table.dossiers-table.hoverable
|
||||
%thead
|
||||
%tr
|
||||
%th.number-col Nº dossier
|
||||
%th Demandeur
|
||||
%th Démarche
|
||||
%tbody
|
||||
- @avis.each do |avis|
|
||||
%tr
|
||||
%td.number-col
|
||||
= link_to(instructeur_avis_path(avis.procedure, avis), class: 'cell-link') do
|
||||
%span.icon.folder
|
||||
#{avis.dossier.id}
|
||||
%td= link_to(avis.dossier.user_email_for(:display), instructeur_avis_path(avis.procedure, avis), class: 'cell-link')
|
||||
%td= link_to(avis.procedure.libelle, instructeur_avis_path(avis.procedure, avis), class: 'cell-link')
|
||||
= paginate(@avis)
|
||||
- else
|
||||
%h2.empty-text Aucun avis
|
|
@ -1,5 +0,0 @@
|
|||
- content_for(:title, "Demande · Dossier nº #{@dossier.id} (#{@dossier.owner_name})")
|
||||
|
||||
= render partial: 'header', locals: { avis: @avis, dossier: @dossier }
|
||||
|
||||
= render partial: 'shared/dossiers/demande', locals: { dossier: @dossier, demande_seen_at: nil, profile: 'instructeur' }
|
|
@ -8,7 +8,7 @@
|
|||
= render partial: 'instructeurs/avis/sidemenu'
|
||||
.fr-col
|
||||
- if @dossier.avis.present?
|
||||
= render partial: 'instructeurs/avis/shared/list', locals: { avis: @dossier.avis, avis_seen_at: @avis_seen_at }
|
||||
= render partial: 'instructeurs/avis/list', locals: { avis: @dossier.avis, avis_seen_at: @avis_seen_at }
|
||||
|
||||
-else
|
||||
%h2.empty-text Aucun avis.
|
||||
|
|
|
@ -9,6 +9,6 @@
|
|||
.fr-col
|
||||
- if !@dossier.termine?
|
||||
- if @dossier.procedure.allow_expert_review
|
||||
= render partial: "instructeurs/avis/shared/form", locals: { url: avis_instructeur_dossier_path(@dossier.procedure, @dossier), linked_dossiers: @dossier.linked_dossiers_for(current_instructeur), must_be_confidentiel: false, avis: @avis }
|
||||
= render partial: "instructeurs/avis/form", locals: { url: avis_instructeur_dossier_path(@dossier.procedure, @dossier), linked_dossiers: @dossier.linked_dossiers_for(current_instructeur), must_be_confidentiel: false, avis: @avis }
|
||||
- else
|
||||
%p Cette démarche n’autorise pas la demande d’avis à un expert. Veuillez contacter votre administrateur
|
||||
|
|
|
@ -392,8 +392,7 @@ Rails.application.routes.draw do
|
|||
end
|
||||
end
|
||||
|
||||
resources :avis, only: [:show, :update] do
|
||||
get '', action: 'procedure', on: :collection, as: :procedure
|
||||
resources :avis, only: [] do
|
||||
member do
|
||||
patch 'revoquer'
|
||||
get 'remind'
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
describe 'instructeurs/avis/shared/_list.html.haml', type: :view do
|
||||
describe 'instructeurs/avis/_list.html.haml', type: :view do
|
||||
before { view.extend DossierHelper }
|
||||
|
||||
subject { render 'instructeurs/avis/shared/list.html.haml', avis: avis, avis_seen_at: seen_at, current_instructeur: instructeur }
|
||||
subject { render 'instructeurs/avis/list.html.haml', avis: avis, avis_seen_at: seen_at, current_instructeur: instructeur }
|
||||
|
||||
let(:instructeur) { create(:instructeur) }
|
||||
let(:instructeur2) { create(:instructeur) }
|
Loading…
Reference in a new issue