gestionnaire: move dossier partials to a shared location
This commit is contained in:
parent
c286e5fa41
commit
86539413ee
14 changed files with 39 additions and 39 deletions
|
@ -2,5 +2,5 @@
|
|||
|
||||
= render partial: 'header', locals: { avis: @avis, dossier: @dossier }
|
||||
|
||||
= render partial: 'new_gestionnaire/shared/show', locals: { dossier: @dossier, demande_seen_at: nil }
|
||||
= render partial: 'shared/dossiers/show', locals: { dossier: @dossier, demande_seen_at: nil }
|
||||
|
||||
|
|
|
@ -3,19 +3,19 @@
|
|||
|
||||
%h2 Identité du demandeur
|
||||
|
||||
= render partial: "new_gestionnaire/dossiers/user_infos", locals: { user: @dossier.user }
|
||||
= render partial: "shared/dossiers/user_infos", locals: { user: @dossier.user }
|
||||
|
||||
- if @dossier.etablissement.present?
|
||||
= render partial: "identite_entreprise", locals: { etablissement: @dossier.etablissement }
|
||||
= render partial: "shared/dossiers/identite_entreprise", locals: { etablissement: @dossier.etablissement }
|
||||
|
||||
- if @dossier.individual.present?
|
||||
= render partial: "identite_individual", locals: { individual: @dossier.individual }
|
||||
= render partial: "shared/dossiers/identite_individual", locals: { individual: @dossier.individual }
|
||||
|
||||
%h2 Formulaire
|
||||
|
||||
- champs = @dossier.ordered_champs.decorate
|
||||
- if champs.any?
|
||||
= render partial: "champs", locals: { champs: champs, dossier: @dossier, demande_seen_at: nil }
|
||||
= render partial: "shared/dossiers/champs", locals: { champs: champs, dossier: @dossier, demande_seen_at: nil }
|
||||
|
||||
- if @dossier.procedure.use_api_carto
|
||||
%h3 Cartographie
|
||||
|
|
|
@ -2,4 +2,4 @@
|
|||
|
||||
= render partial: "header", locals: { dossier: @dossier }
|
||||
|
||||
= render partial: 'new_gestionnaire/shared/show', locals: { dossier: @dossier, demande_seen_at: @demande_seen_at }
|
||||
= render partial: "shared/dossiers/show", locals: { dossier: @dossier, demande_seen_at: @demande_seen_at }
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
.container
|
||||
.tab-title Identité du demandeur
|
||||
.card
|
||||
= render partial: "new_gestionnaire/dossiers/user_infos", locals: { user: dossier.user }
|
||||
|
||||
- if dossier.etablissement.present?
|
||||
= render partial: "new_gestionnaire/dossiers/identite_entreprise", locals: { etablissement: dossier.etablissement }
|
||||
|
||||
- if dossier.individual.present?
|
||||
= render partial: "new_gestionnaire/dossiers/identite_individual", locals: { individual: dossier.individual }
|
||||
|
||||
.tab-title Formulaire
|
||||
- champs = dossier.ordered_champs.includes(:type_de_champ).decorate
|
||||
- if champs.any?
|
||||
.card
|
||||
= render partial: "new_gestionnaire/dossiers/champs", locals: { champs: champs, demande_seen_at: demande_seen_at }
|
||||
|
||||
- if dossier.procedure.use_api_carto
|
||||
.tab-title Cartographie
|
||||
.card
|
||||
= render partial: "new_gestionnaire/dossiers/map", locals: { dossier: dossier }
|
||||
|
||||
- if dossier.types_de_piece_justificative.any?
|
||||
.tab-title Pièces jointes
|
||||
.card
|
||||
= render partial: "new_gestionnaire/dossiers/pieces_jointes", locals: { dossier: dossier, demande_seen_at: demande_seen_at }
|
|
@ -55,7 +55,7 @@
|
|||
%td.rich-text
|
||||
%span{ class: highlight_if_unseen_class(demande_seen_at, c.updated_at) }
|
||||
- if c.etablissement.present?
|
||||
= render partial: "new_gestionnaire/dossiers/identite_entreprise", locals: { etablissement: c.etablissement }
|
||||
= render partial: "shared/dossiers/identite_entreprise", locals: { etablissement: c.etablissement }
|
||||
- else
|
||||
%th.libelle
|
||||
= "#{c.libelle} :"
|
26
app/views/shared/dossiers/_show.html.haml
Normal file
26
app/views/shared/dossiers/_show.html.haml
Normal file
|
@ -0,0 +1,26 @@
|
|||
.container
|
||||
.tab-title Identité du demandeur
|
||||
.card
|
||||
= render partial: "shared/dossiers/user_infos", locals: { user: dossier.user }
|
||||
|
||||
- if dossier.etablissement.present?
|
||||
= render partial: "shared/dossiers/identite_entreprise", locals: { etablissement: dossier.etablissement }
|
||||
|
||||
- if dossier.individual.present?
|
||||
= render partial: "shared/dossiers/identite_individual", locals: { individual: dossier.individual }
|
||||
|
||||
.tab-title Formulaire
|
||||
- champs = dossier.ordered_champs.includes(:type_de_champ).decorate
|
||||
- if champs.any?
|
||||
.card
|
||||
= render partial: "shared/dossiers/champs", locals: { champs: champs, demande_seen_at: demande_seen_at }
|
||||
|
||||
- if dossier.procedure.use_api_carto
|
||||
.tab-title Cartographie
|
||||
.card
|
||||
= render partial: "shared/dossiers/map", locals: { dossier: dossier }
|
||||
|
||||
- if dossier.types_de_piece_justificative.any?
|
||||
.tab-title Pièces jointes
|
||||
.card
|
||||
= render partial: "shared/dossiers/pieces_jointes", locals: { dossier: dossier, demande_seen_at: demande_seen_at }
|
|
@ -1,4 +1,4 @@
|
|||
describe 'new_gestionnaire/dossiers/champs.html.haml', type: :view do
|
||||
describe 'shared/dossiers/champs.html.haml', type: :view do
|
||||
let(:gestionnaire) { create(:gestionnaire) }
|
||||
let(:demande_seen_at) { nil }
|
||||
|
||||
|
@ -8,7 +8,7 @@ describe 'new_gestionnaire/dossiers/champs.html.haml', type: :view do
|
|||
allow(view).to receive(:current_gestionnaire).and_return(gestionnaire)
|
||||
end
|
||||
|
||||
subject { render 'new_gestionnaire/dossiers/champs.html.haml', champs: champs, demande_seen_at: demande_seen_at }
|
||||
subject { render 'shared/dossiers/champs.html.haml', champs: champs, demande_seen_at: demande_seen_at }
|
||||
|
||||
context "there are some champs" do
|
||||
let(:dossier) { create(:dossier) }
|
|
@ -1,5 +1,5 @@
|
|||
describe 'new_gestionnaire/dossiers/identite_entreprise.html.haml', type: :view do
|
||||
before { render 'new_gestionnaire/dossiers/identite_entreprise.html.haml', etablissement: etablissement }
|
||||
describe 'shared/dossiers/identite_entreprise.html.haml', type: :view do
|
||||
before { render 'shared/dossiers/identite_entreprise.html.haml', etablissement: etablissement }
|
||||
|
||||
context "there is an association" do
|
||||
let(:etablissement) { create(:etablissement, :is_association) }
|
|
@ -1,8 +1,8 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe 'new_gestionnaire/dossiers/_map.html.haml', type: :view do
|
||||
describe 'shared/dossiers/map.html.haml', type: :view do
|
||||
subject do
|
||||
render(partial: 'new_gestionnaire/dossiers/map.html.haml', locals: { dossier: dossier })
|
||||
render(partial: 'shared/dossiers/map.html.haml', locals: { dossier: dossier })
|
||||
end
|
||||
|
||||
describe "javascript variables printing" do
|
Loading…
Reference in a new issue