diff --git a/app/assets/stylesheets/new_design/status_progress.scss b/app/assets/stylesheets/new_design/status_overview.scss similarity index 98% rename from app/assets/stylesheets/new_design/status_progress.scss rename to app/assets/stylesheets/new_design/status_overview.scss index e9a5261eb..49ad8a55b 100644 --- a/app/assets/stylesheets/new_design/status_progress.scss +++ b/app/assets/stylesheets/new_design/status_overview.scss @@ -1,7 +1,7 @@ @import "colors"; @import "constants"; -.status-progress { +.status-overview { text-align: center; } diff --git a/app/controllers/new_user/dossiers_controller.rb b/app/controllers/new_user/dossiers_controller.rb index 138ee6848..0f8fcfc4e 100644 --- a/app/controllers/new_user/dossiers_controller.rb +++ b/app/controllers/new_user/dossiers_controller.rb @@ -4,8 +4,8 @@ module NewUser helper_method :new_demarche_url - before_action :ensure_ownership!, except: [:index, :show, :formulaire, :modifier, :update, :recherche] - before_action :ensure_ownership_or_invitation!, only: [:show, :formulaire, :modifier, :update] + before_action :ensure_ownership!, except: [:index, :show, :demande, :modifier, :update, :recherche] + before_action :ensure_ownership_or_invitation!, only: [:show, :demande, :modifier, :update] before_action :ensure_dossier_can_be_updated, only: [:update_identite, :update] before_action :forbid_invite_submission!, only: [:update] @@ -34,7 +34,7 @@ module NewUser @dossier = dossier end - def formulaire + def demande @dossier = dossier end @@ -109,7 +109,7 @@ module NewUser redirect_to merci_dossier_path(@dossier) elsif current_user.owns?(dossier) if Flipflop.new_dossier_details? - redirect_to formulaire_dossier_path(@dossier) + redirect_to demande_dossier_path(@dossier) else redirect_to users_dossier_recapitulatif_path(@dossier) end diff --git a/app/views/new_gestionnaire/avis/show.html.haml b/app/views/new_gestionnaire/avis/show.html.haml index d008c0536..225e0c6f3 100644 --- a/app/views/new_gestionnaire/avis/show.html.haml +++ b/app/views/new_gestionnaire/avis/show.html.haml @@ -2,4 +2,4 @@ = render partial: 'header', locals: { avis: @avis, dossier: @dossier } -= render partial: 'shared/dossiers/show', locals: { dossier: @dossier, demande_seen_at: nil } += render partial: 'shared/dossiers/demande', locals: { dossier: @dossier, demande_seen_at: nil } diff --git a/app/views/new_gestionnaire/dossiers/show.html.haml b/app/views/new_gestionnaire/dossiers/show.html.haml index 378bfcdc3..694aea923 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: "shared/dossiers/show", locals: { dossier: @dossier, demande_seen_at: @demande_seen_at } += render partial: "shared/dossiers/demande", locals: { dossier: @dossier, demande_seen_at: @demande_seen_at } diff --git a/app/views/new_user/dossiers/formulaire.html.haml b/app/views/new_user/dossiers/demande.html.haml similarity index 55% rename from app/views/new_user/dossiers/formulaire.html.haml rename to app/views/new_user/dossiers/demande.html.haml index 986935c40..f5be19d48 100644 --- a/app/views/new_user/dossiers/formulaire.html.haml +++ b/app/views/new_user/dossiers/demande.html.haml @@ -1,7 +1,9 @@ +- content_for(:title, "Demande · Dossier nº #{@dossier.id} (#{@dossier.procedure.libelle})") + #dossier-show = render partial: 'new_user/dossiers/show/header', locals: { dossier: @dossier } - = render partial: 'shared/dossiers/show', locals: { dossier: @dossier, demande_seen_at: nil } + = render partial: 'shared/dossiers/demande', locals: { dossier: @dossier, demande_seen_at: nil } .container - if !@dossier.read_only? diff --git a/app/views/new_user/dossiers/identite.html.haml b/app/views/new_user/dossiers/identite.html.haml index cef41586f..920184db9 100644 --- a/app/views/new_user/dossiers/identite.html.haml +++ b/app/views/new_user/dossiers/identite.html.haml @@ -1,3 +1,5 @@ +- content_for(:title, "Nouveau dossier (#{@dossier.procedure.libelle})") + - content_for :footer do = render partial: "new_user/dossiers/footer", locals: { dossier: @dossier } diff --git a/app/views/new_user/dossiers/index.html.haml b/app/views/new_user/dossiers/index.html.haml index e878a79fb..10a5d6a78 100644 --- a/app/views/new_user/dossiers/index.html.haml +++ b/app/views/new_user/dossiers/index.html.haml @@ -1,3 +1,5 @@ +- content_for(:title, "Dossiers") + .dossiers-headers.sub-header .container = link_to "Commencer une nouvelle démarche", new_demarche_url, class: "button secondary new-demarche" diff --git a/app/views/new_user/dossiers/merci.html.haml b/app/views/new_user/dossiers/merci.html.haml index 7fddc5696..1e3344109 100644 --- a/app/views/new_user/dossiers/merci.html.haml +++ b/app/views/new_user/dossiers/merci.html.haml @@ -1,3 +1,5 @@ +- content_for(:title, "Dossier bien envoyé (#{@dossier.procedure.libelle})") + .merci .container = image_tag('user/envoi-dossier.svg') diff --git a/app/views/new_user/dossiers/modifier.html.haml b/app/views/new_user/dossiers/modifier.html.haml index 0a20b7d77..81f264954 100644 --- a/app/views/new_user/dossiers/modifier.html.haml +++ b/app/views/new_user/dossiers/modifier.html.haml @@ -1,3 +1,5 @@ +- content_for(:title, "Modification du brouillon nº #{@dossier.id} (#{@dossier.procedure.libelle})") + - content_for :footer do = render partial: "new_user/dossiers/footer", locals: { dossier: @dossier } diff --git a/app/views/new_user/dossiers/show.html.haml b/app/views/new_user/dossiers/show.html.haml index 073022c10..e6e17707c 100644 --- a/app/views/new_user/dossiers/show.html.haml +++ b/app/views/new_user/dossiers/show.html.haml @@ -1,5 +1,7 @@ +- content_for(:title, "Résumé · Dossier nº #{@dossier.id} (#{@dossier.procedure.libelle})") + #dossier-show = render partial: 'new_user/dossiers/show/header', locals: { dossier: @dossier } .container - = render partial: 'new_user/dossiers/show/status_progress', locals: { dossier: @dossier } + = render partial: 'new_user/dossiers/show/status_overview', locals: { dossier: @dossier } diff --git a/app/views/new_user/dossiers/show/_header.html.haml b/app/views/new_user/dossiers/show/_header.html.haml index ebb2445de..bc9d94dd7 100644 --- a/app/views/new_user/dossiers/show/_header.html.haml +++ b/app/views/new_user/dossiers/show/_header.html.haml @@ -9,4 +9,4 @@ %ul.tabs = active_tab_item('Résumé', dossier_path(dossier)) - = active_tab_item('Formulaire', formulaire_dossier_path(dossier)) + = active_tab_item('Demande', demande_dossier_path(dossier)) diff --git a/app/views/new_user/dossiers/show/_status_progress.html.haml b/app/views/new_user/dossiers/show/_status_overview.html.haml similarity index 99% rename from app/views/new_user/dossiers/show/_status_progress.html.haml rename to app/views/new_user/dossiers/show/_status_overview.html.haml index f2acfb447..026020eec 100644 --- a/app/views/new_user/dossiers/show/_status_progress.html.haml +++ b/app/views/new_user/dossiers/show/_status_overview.html.haml @@ -1,4 +1,4 @@ -.status-progress +.status-overview - if !dossier.termine? %ul.status-timeline %li.brouillon{ class: dossier.brouillon? ? 'active' : nil } diff --git a/app/views/shared/dossiers/_show.html.haml b/app/views/shared/dossiers/_demande.html.haml similarity index 100% rename from app/views/shared/dossiers/_show.html.haml rename to app/views/shared/dossiers/_demande.html.haml diff --git a/app/views/shared/dossiers/_status.html.haml b/app/views/shared/dossiers/_status.html.haml index 6afc81dc6..775a93b0f 100644 --- a/app/views/shared/dossiers/_status.html.haml +++ b/app/views/shared/dossiers/_status.html.haml @@ -2,7 +2,7 @@ %span.label.brouillon brouillon - elsif dossier.en_construction? %span.label.construction en construction -- if dossier.en_instruction? +- elsif dossier.en_instruction? %span.label.instruction en instruction - elsif dossier.accepte? %span.label.accepted accepté diff --git a/config/routes.rb b/config/routes.rb index 0b6e8a877..7f34ca76e 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -278,7 +278,7 @@ Rails.application.routes.draw do get 'modifier' patch 'modifier', to: 'dossiers#update' get 'merci' - get 'formulaire' + get 'demande' post 'ask_deletion' get 'attestation' end diff --git a/spec/controllers/new_user/dossiers_controller_spec.rb b/spec/controllers/new_user/dossiers_controller_spec.rb index 3889b974e..33cfd3566 100644 --- a/spec/controllers/new_user/dossiers_controller_spec.rb +++ b/spec/controllers/new_user/dossiers_controller_spec.rb @@ -517,10 +517,10 @@ describe NewUser::DossiersController, type: :controller do sign_in(user) end - subject! { get(:formulaire, params: { id: dossier.id }) } + subject! { get(:demande, params: { id: dossier.id }) } it { expect(assigns(:dossier)).to eq(dossier) } - it { is_expected.to render_template(:formulaire) } + it { is_expected.to render_template(:demande) } end describe '#ask_deletion' do diff --git a/spec/features/new_user/dossier_details_spec.rb b/spec/features/new_user/dossier_details_spec.rb index 6ddc49e11..4fc026e95 100644 --- a/spec/features/new_user/dossier_details_spec.rb +++ b/spec/features/new_user/dossier_details_spec.rb @@ -20,16 +20,16 @@ describe 'Dossier details:' do scenario 'the user can see and edit dossier before instruction' do visit_dossier dossier - click_on 'Formulaire' + click_on 'Demande' - expect(page).to have_current_path(formulaire_dossier_path(dossier)) + expect(page).to have_current_path(demande_dossier_path(dossier)) click_on 'Modifier le dossier' expect(page).to have_current_path(modifier_dossier_path(dossier)) fill_in('texte obligatoire', with: 'Nouveau texte') click_on 'Enregistrer les modifications du dossier' - expect(page).to have_current_path(formulaire_dossier_path(dossier)) + expect(page).to have_current_path(demande_dossier_path(dossier)) expect(page).to have_content('Nouveau texte') end diff --git a/spec/views/new_user/dossiers/formulaire.html.haml_spec.rb b/spec/views/new_user/dossiers/demande.html.haml_spec.rb similarity index 89% rename from spec/views/new_user/dossiers/formulaire.html.haml_spec.rb rename to spec/views/new_user/dossiers/demande.html.haml_spec.rb index 81bce7907..0dff42b3d 100644 --- a/spec/views/new_user/dossiers/formulaire.html.haml_spec.rb +++ b/spec/views/new_user/dossiers/demande.html.haml_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'new_user/dossiers/formulaire.html.haml', type: :view do +describe 'new_user/dossiers/demande.html.haml', type: :view do let(:procedure) { create(:procedure, :published, :with_two_type_de_piece_justificative, :with_type_de_champ, :with_type_de_champ_private) } let(:dossier) { create(:dossier, :en_construction, :with_entreprise, procedure: procedure) } @@ -16,7 +16,7 @@ describe 'new_user/dossiers/formulaire.html.haml', type: :view do it 'renders the dossier infos' do expect(rendered).to have_text('Identité') - expect(rendered).to have_text('Formulaire') + expect(rendered).to have_text('Demande') expect(rendered).to have_text('Pièces jointes') end diff --git a/spec/views/new_user/dossiers/show/_header.html.haml_spec.rb b/spec/views/new_user/dossiers/show/_header.html.haml_spec.rb index ece6e94fe..8c37b55f4 100644 --- a/spec/views/new_user/dossiers/show/_header.html.haml_spec.rb +++ b/spec/views/new_user/dossiers/show/_header.html.haml_spec.rb @@ -10,6 +10,6 @@ describe 'new_user/dossiers/show/header.html.haml', type: :view do expect(rendered).to have_selector("ul.tabs") expect(rendered).to have_link("Résumé", href: dossier_path(dossier)) - expect(rendered).to have_link("Formulaire", href: formulaire_dossier_path(dossier)) + expect(rendered).to have_link("Demande", href: demande_dossier_path(dossier)) end end diff --git a/spec/views/new_user/dossiers/show/_status_progress.html.haml_spec.rb b/spec/views/new_user/dossiers/show/_status_overview.html.haml_spec.rb similarity index 95% rename from spec/views/new_user/dossiers/show/_status_progress.html.haml_spec.rb rename to spec/views/new_user/dossiers/show/_status_overview.html.haml_spec.rb index 3ed819b07..e239555ca 100644 --- a/spec/views/new_user/dossiers/show/_status_progress.html.haml_spec.rb +++ b/spec/views/new_user/dossiers/show/_status_overview.html.haml_spec.rb @@ -1,5 +1,5 @@ -describe 'new_user/dossiers/show/_status_progress.html.haml', type: :view do - subject! { render 'new_user/dossiers/show/status_progress.html.haml', dossier: dossier } +describe 'new_user/dossiers/show/_status_overview.html.haml', type: :view do + subject! { render 'new_user/dossiers/show/status_overview.html.haml', dossier: dossier } matcher :have_timeline_item do |selector| match do |rendered|