diff --git a/app/views/new_gestionnaire/avis/show.html.haml b/app/views/new_gestionnaire/avis/show.html.haml index c8a4ae923..6a0e2e9d8 100644 --- a/app/views/new_gestionnaire/avis/show.html.haml +++ b/app/views/new_gestionnaire/avis/show.html.haml @@ -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 } diff --git a/app/views/new_gestionnaire/dossiers/print.html.haml b/app/views/new_gestionnaire/dossiers/print.html.haml index 88017ec0c..ac7af1845 100644 --- a/app/views/new_gestionnaire/dossiers/print.html.haml +++ b/app/views/new_gestionnaire/dossiers/print.html.haml @@ -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 diff --git a/app/views/new_gestionnaire/dossiers/show.html.haml b/app/views/new_gestionnaire/dossiers/show.html.haml index c7a827ef3..378bfcdc3 100644 --- a/app/views/new_gestionnaire/dossiers/show.html.haml +++ b/app/views/new_gestionnaire/dossiers/show.html.haml @@ -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 } diff --git a/app/views/new_gestionnaire/shared/_show.html.haml b/app/views/new_gestionnaire/shared/_show.html.haml deleted file mode 100644 index ac26279b8..000000000 --- a/app/views/new_gestionnaire/shared/_show.html.haml +++ /dev/null @@ -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 } diff --git a/app/views/new_gestionnaire/dossiers/_champs.html.haml b/app/views/shared/dossiers/_champs.html.haml similarity index 95% rename from app/views/new_gestionnaire/dossiers/_champs.html.haml rename to app/views/shared/dossiers/_champs.html.haml index 57d6d0e35..81537a06a 100644 --- a/app/views/new_gestionnaire/dossiers/_champs.html.haml +++ b/app/views/shared/dossiers/_champs.html.haml @@ -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} :" diff --git a/app/views/new_gestionnaire/dossiers/_identite_entreprise.html.haml b/app/views/shared/dossiers/_identite_entreprise.html.haml similarity index 100% rename from app/views/new_gestionnaire/dossiers/_identite_entreprise.html.haml rename to app/views/shared/dossiers/_identite_entreprise.html.haml diff --git a/app/views/new_gestionnaire/dossiers/_identite_individual.html.haml b/app/views/shared/dossiers/_identite_individual.html.haml similarity index 100% rename from app/views/new_gestionnaire/dossiers/_identite_individual.html.haml rename to app/views/shared/dossiers/_identite_individual.html.haml diff --git a/app/views/new_gestionnaire/dossiers/_map.html.haml b/app/views/shared/dossiers/_map.html.haml similarity index 100% rename from app/views/new_gestionnaire/dossiers/_map.html.haml rename to app/views/shared/dossiers/_map.html.haml diff --git a/app/views/new_gestionnaire/dossiers/_pieces_jointes.html.haml b/app/views/shared/dossiers/_pieces_jointes.html.haml similarity index 100% rename from app/views/new_gestionnaire/dossiers/_pieces_jointes.html.haml rename to app/views/shared/dossiers/_pieces_jointes.html.haml diff --git a/app/views/shared/dossiers/_show.html.haml b/app/views/shared/dossiers/_show.html.haml new file mode 100644 index 000000000..4405f57b3 --- /dev/null +++ b/app/views/shared/dossiers/_show.html.haml @@ -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 } diff --git a/app/views/new_gestionnaire/dossiers/_user_infos.html.haml b/app/views/shared/dossiers/_user_infos.html.haml similarity index 100% rename from app/views/new_gestionnaire/dossiers/_user_infos.html.haml rename to app/views/shared/dossiers/_user_infos.html.haml diff --git a/spec/views/new_gestionnaire/dossiers/_champs.html.haml_spec.rb b/spec/views/shared/dossiers/_champs.html.haml_spec.rb similarity index 92% rename from spec/views/new_gestionnaire/dossiers/_champs.html.haml_spec.rb rename to spec/views/shared/dossiers/_champs.html.haml_spec.rb index 05a2e22d2..9f86d9cec 100644 --- a/spec/views/new_gestionnaire/dossiers/_champs.html.haml_spec.rb +++ b/spec/views/shared/dossiers/_champs.html.haml_spec.rb @@ -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) } diff --git a/spec/views/new_gestionnaire/dossiers/_identite_entreprise.html.haml_spec.rb b/spec/views/shared/dossiers/_identite_entreprise.html.haml_spec.rb similarity index 65% rename from spec/views/new_gestionnaire/dossiers/_identite_entreprise.html.haml_spec.rb rename to spec/views/shared/dossiers/_identite_entreprise.html.haml_spec.rb index 121e08044..f80e4eee8 100644 --- a/spec/views/new_gestionnaire/dossiers/_identite_entreprise.html.haml_spec.rb +++ b/spec/views/shared/dossiers/_identite_entreprise.html.haml_spec.rb @@ -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) } diff --git a/spec/views/new_gestionnaire/dossiers/_map_spec.rb b/spec/views/shared/dossiers/_map_spec.rb similarity index 87% rename from spec/views/new_gestionnaire/dossiers/_map_spec.rb rename to spec/views/shared/dossiers/_map_spec.rb index d9c998cce..9e3d05c48 100644 --- a/spec/views/new_gestionnaire/dossiers/_map_spec.rb +++ b/spec/views/shared/dossiers/_map_spec.rb @@ -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