From 4b67e20f644279133e7e1a909100aad9c5eafb23 Mon Sep 17 00:00:00 2001 From: kosiakkatrina <54268893+kosiakkatrina@users.noreply.github.com> Date: Thu, 2 Dec 2021 11:11:45 +0000 Subject: [PATCH] Add page titles (#135) * Add page titles and lint * Make github use Node 14 (cherry picked from commit 86baa53972aa87676bb720a9f772620afa9a1be9) Co-authored-by: baarkerlounger --- .github/workflows/pipeline.yml | 4 ++++ app/views/case_logs/edit.html.erb | 1 + app/views/case_logs/index.html.erb | 1 + app/views/devise/sessions/new.html.erb | 1 + app/views/form/check_answers.html.erb | 1 + app/views/form/page.html.erb | 2 ++ app/views/layouts/application.html.erb | 2 +- app/views/organisations/show.html.erb | 1 + app/views/organisations/users.html.erb | 1 + app/views/users/account/index.html.erb | 1 + config/routes.rb | 4 ++-- 11 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index c64e3d581..b83258ce5 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -57,6 +57,10 @@ jobs: with: # runs 'bundle install' and caches installed gems automatically bundler-cache: true + - name: Set up node + uses: actions/setup-node@v2 + with: + node-version: '14' - name: Create DB run: | diff --git a/app/views/case_logs/edit.html.erb b/app/views/case_logs/edit.html.erb index 9549285cc..19b274488 100644 --- a/app/views/case_logs/edit.html.erb +++ b/app/views/case_logs/edit.html.erb @@ -1,3 +1,4 @@ +<% content_for :title, "Case log #{@case_log.id} – #{t('service_name')} - GOV.UK" %> <%= turbo_frame_tag "case_log_form", target: "_top" do %>
diff --git a/app/views/case_logs/index.html.erb b/app/views/case_logs/index.html.erb index ba62b66ca..639b5cc38 100644 --- a/app/views/case_logs/index.html.erb +++ b/app/views/case_logs/index.html.erb @@ -1,3 +1,4 @@ +<% content_for :title, "Case logs – #{t('service_name')} - GOV.UK" %>

Your logs

diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb index 485216d4e..74bd0bcbd 100644 --- a/app/views/devise/sessions/new.html.erb +++ b/app/views/devise/sessions/new.html.erb @@ -1,3 +1,4 @@ +<% content_for :title, "Sign in – #{t('service_name')} - GOV.UK" %> <%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
diff --git a/app/views/form/check_answers.html.erb b/app/views/form/check_answers.html.erb index d2a2551d4..3c62bca81 100644 --- a/app/views/form/check_answers.html.erb +++ b/app/views/form/check_answers.html.erb @@ -1,3 +1,4 @@ +<% content_for :title, "Check answers – #{t('service_name')} - GOV.UK" %> <%= turbo_frame_tag "case_log_form", target: "_top" do %>
diff --git a/app/views/form/page.html.erb b/app/views/form/page.html.erb index d3c4dbc29..a4681a80f 100644 --- a/app/views/form/page.html.erb +++ b/app/views/form/page.html.erb @@ -1,3 +1,5 @@ +<% content_for :title, "#{subsection} – #{t('service_name')} - GOV.UK" %> + <% content_for :before_content do %> <%= govuk_back_link( text: 'Back', diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 497a24175..960a4ecbd 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -1,7 +1,7 @@ - DLUHC CORE Data Collection + <%= yield(:title).present? ? yield(:title) : t('service_name') %> <%= csrf_meta_tags %> <%= csp_meta_tag %> <%= tag :meta, name: 'viewport', content: 'width=device-width, initial-scale=1' %> diff --git a/app/views/organisations/show.html.erb b/app/views/organisations/show.html.erb index 49aa63e67..d9cac8d2a 100644 --- a/app/views/organisations/show.html.erb +++ b/app/views/organisations/show.html.erb @@ -1,3 +1,4 @@ +<% content_for :title, "Your organisation (Details) – #{t('service_name')} - GOV.UK" %> <% content_for :tab_title do %> <%= "Details" %> <% end %> diff --git a/app/views/organisations/users.html.erb b/app/views/organisations/users.html.erb index 82266b2af..390d9c0ff 100644 --- a/app/views/organisations/users.html.erb +++ b/app/views/organisations/users.html.erb @@ -1,3 +1,4 @@ +<% content_for :title, "Your organisation (Users) – #{t('service_name')} - GOV.UK" %> <% content_for :tab_title do %> <%= "Users" %> <% end %> diff --git a/app/views/users/account/index.html.erb b/app/views/users/account/index.html.erb index 940436612..bc9ae8a89 100644 --- a/app/views/users/account/index.html.erb +++ b/app/views/users/account/index.html.erb @@ -1,3 +1,4 @@ +<% content_for :title, "Your account – #{t('service_name')} - GOV.UK" %>

diff --git a/config/routes.rb b/config/routes.rb index 03345e791..3327f8917 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,6 +1,6 @@ Rails.application.routes.draw do devise_for :admin_users, ActiveAdmin::Devise.config - devise_for :users, controllers: { passwords: "users/passwords", sessions: "users/sessions" }, path_names: { sign_in: 'sign-in', sign_out: 'sign-out' }, skip: [:registrations] + devise_for :users, controllers: { passwords: "users/passwords", sessions: "users/sessions" }, path_names: { sign_in: "sign-in", sign_out: "sign-out" }, skip: [:registrations] devise_scope :user do get "confirmations/reset", to: "users/passwords#reset_confirmation" get "users/edit" => "devise/registrations#edit", :as => "edit_user_registration" @@ -30,7 +30,7 @@ Rails.application.routes.draw do end end - resources :case_logs, :path => '/case-logs' do + resources :case_logs, path: "/case-logs" do collection do post "/bulk-upload", to: "bulk_upload#bulk_upload" get "/bulk-upload", to: "bulk_upload#show"