From 0ff59ffc66c5922b039b7d96812ea2f108e5014c Mon Sep 17 00:00:00 2001 From: Chris Beer Date: Fri, 10 May 2024 08:07:14 -0700 Subject: [PATCH] Add some page titles to the patron requests --- app/views/layouts/application_new.html.erb | 2 +- app/views/patron_requests/login.html.erb | 2 ++ app/views/patron_requests/new.html.erb | 2 ++ app/views/patron_requests/show.html.erb | 7 ++++--- app/views/patron_requests/unauthorized.html.erb | 2 ++ config/locales/en.yml | 3 ++- spec/features/home_page_spec.rb | 2 +- 7 files changed, 14 insertions(+), 6 deletions(-) diff --git a/app/views/layouts/application_new.html.erb b/app/views/layouts/application_new.html.erb index 199e6021a..84b17cf73 100644 --- a/app/views/layouts/application_new.html.erb +++ b/app/views/layouts/application_new.html.erb @@ -6,7 +6,7 @@ - <%= yield(:page_title).blank? ? SULRequests::Application.config.application_name : yield(:page_title)%> + <%= yield(:page_title).blank? ? t('shared.default_page_title') : yield(:page_title) %> <%= favicon_link_tag 'favicon.ico' %> <%= stylesheet_link_tag "application_redesign" %> <%= stylesheet_link_tag "https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,700" %> diff --git a/app/views/patron_requests/login.html.erb b/app/views/patron_requests/login.html.erb index e2e859f1c..326286117 100644 --- a/app/views/patron_requests/login.html.erb +++ b/app/views/patron_requests/login.html.erb @@ -1,3 +1,5 @@ +<% content_for :page_title do %>Request: <%= @patron_request.item_title %><% end %> +

<%= @patron_request.item_title %>

diff --git a/app/views/patron_requests/new.html.erb b/app/views/patron_requests/new.html.erb index 85ecce72f..6776e11f5 100644 --- a/app/views/patron_requests/new.html.erb +++ b/app/views/patron_requests/new.html.erb @@ -1,3 +1,5 @@ +<% content_for :page_title do %>Request: <%= @patron_request.item_title %><% end %> + <% unless current_user&.patron&.blank? %> <%= render 'user_header' %> <% end %> diff --git a/app/views/patron_requests/show.html.erb b/app/views/patron_requests/show.html.erb index 2b602d165..e43d5aaee 100644 --- a/app/views/patron_requests/show.html.erb +++ b/app/views/patron_requests/show.html.erb @@ -1,15 +1,16 @@ -<%= render 'confirmation_screen' %> +<% content_for :page_title do %>Request confirmation: <%= @patron_request.item_title %><% end %> +<%= render 'confirmation_screen' %> <% if can? :debug, @patron_request %>
<% if current_request.folio_responses.present? %>

ILS Response

-
<%= JSON.pretty_generate(current_request.folio_responses || {}) %>
+
<%= JSON.pretty_generate(@patron_request.folio_responses || {}) %>
<% end %> <% if current_request.illiad_response_data.present? %>

Illiad Response

-
<%= JSON.pretty_generate(current_request.illiad_response_data) %>
+
<%= JSON.pretty_generate(@patron_request.illiad_response_data) %>
<% end %> <% end %> diff --git a/app/views/patron_requests/unauthorized.html.erb b/app/views/patron_requests/unauthorized.html.erb index 07ed20fa0..e7f505170 100644 --- a/app/views/patron_requests/unauthorized.html.erb +++ b/app/views/patron_requests/unauthorized.html.erb @@ -1,3 +1,5 @@ +<% content_for :page_title do %>Request: <%= @patron_request.item_title %><% end %> + <% if current_user&.patron %> <%= render 'user_header' %> <% end %>

<%= @patron_request.item_title %>

diff --git a/config/locales/en.yml b/config/locales/en.yml index 75a3503f9..c815206d3 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -206,8 +206,9 @@ en: one: "Select an item from the list above." other: "Select one or more items from the list above." shared: + default_page_title: "Requests : Stanford Libraries" sul_header: - sul: Stanford University Libraries + sul: Stanford Libraries login: Login logout: "%{sunetid}: Logout" mylibrary: My Account diff --git a/spec/features/home_page_spec.rb b/spec/features/home_page_spec.rb index c6ea41126..e506b8eca 100644 --- a/spec/features/home_page_spec.rb +++ b/spec/features/home_page_spec.rb @@ -9,7 +9,7 @@ end it 'renders the page' do - expect(page).to have_title('SUL Requests') + expect(page).to have_title('Requests : Stanford Libraries') expect(page).to have_css('.sul-logo') expect(page).to have_link('My Account') expect(page).to have_link('Feedback')