diff --git a/app/assets/stylesheets/base/base.scss b/app/assets/stylesheets/base/base.scss index 32b37cc86..62fdd444e 100644 --- a/app/assets/stylesheets/base/base.scss +++ b/app/assets/stylesheets/base/base.scss @@ -18,6 +18,7 @@ @import 'templates/static-page'; @import 'templates/item-page'; @import 'templates/collection-page'; +@import 'templates/error-page'; @import 'templates/index-page'; @import 'templates/homepage'; @import 'components/banner/collection-banner'; diff --git a/app/assets/stylesheets/base/templates/_error-page.scss b/app/assets/stylesheets/base/templates/_error-page.scss new file mode 100644 index 000000000..06baa993d --- /dev/null +++ b/app/assets/stylesheets/base/templates/_error-page.scss @@ -0,0 +1,36 @@ +.content-container--error-page { + margin: 0 auto; + max-width: 832px; + + .error-page__title-row { + margin-bottom: 48px; + color: $ucla-darkest-blue; + + h1 { + font-size: 52px; + font-weight: 700; + line-height: 62px; + text-align: center; + } + + h4 { + font-size: 24px; + line-height: 36px; + } + } + + ul { + margin-left: 40px; + + li { + margin-bottom: 10px; + + a { + font-size: 16px; + line-height: 24px; + text-decoration: underline; + color: #000; + } + } + } +} diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 766df0d35..f894f618b 100755 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -52,9 +52,10 @@ def cors_preflight_check protect_from_forgery with: :exception rescue_from Blacklight::AccessControls::AccessDenied, with: :render_404 + rescue_from Blacklight::Exceptions::RecordNotFound, with: :render_404 def render_404 - render file: Rails.root.join('public', '404.html'), status: :not_found, layout: false + render 'errors/not_found' end def solr_document_path(*args) diff --git a/app/controllers/errors_controller.rb b/app/controllers/errors_controller.rb new file mode 100644 index 000000000..58cc96911 --- /dev/null +++ b/app/controllers/errors_controller.rb @@ -0,0 +1,4 @@ +# frozen_string_literal: true +class ErrorsController < ApplicationController + def not_found; end +end diff --git a/app/views/catalog/_browse_results.html.erb b/app/views/catalog/_browse_results.html.erb index ec8d811a8..c78997fb7 100644 --- a/app/views/catalog/_browse_results.html.erb +++ b/app/views/catalog/_browse_results.html.erb @@ -13,7 +13,8 @@ <% else %>

- <%= @response['response'].dig(:numFound) %> Catalog Results + <%= number_with_delimiter @response['response'].dig(:numFound) %> + Catalog Results

<%= render_results_collection_tools wrapping_class: "search-widgets search-widgets-wrapper search-widgets-wrapper--sinai" %>
diff --git a/app/views/catalog/banners/_collection_masthead_overlay.html.erb b/app/views/catalog/banners/_collection_masthead_overlay.html.erb index 621a4ac6c..ba4f86339 100644 --- a/app/views/catalog/banners/_collection_masthead_overlay.html.erb +++ b/app/views/catalog/banners/_collection_masthead_overlay.html.erb @@ -2,7 +2,7 @@

<%= document[:title_tesim][0] %>

diff --git a/app/views/errors/not_found.html.erb b/app/views/errors/not_found.html.erb new file mode 100644 index 000000000..71d68ab34 --- /dev/null +++ b/app/views/errors/not_found.html.erb @@ -0,0 +1,20 @@ +
+
+

Page not found.

+
+ +
+

+ We can’t find the page you are looking for, but we're here to help. Try + these regularly visited links. +

+
+ + +
diff --git a/app/views/layouts/blacklight/base.html.erb b/app/views/layouts/blacklight/base.html.erb index f8f38243c..02bd1fe47 100644 --- a/app/views/layouts/blacklight/base.html.erb +++ b/app/views/layouts/blacklight/base.html.erb @@ -23,8 +23,14 @@ 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','<%= ENV["GOOGLE_TAG_MGR_ID"] %>'); <% end %> + <% if ENV["RAILS_HOST"] && ENV["RAILS_HOST"].include?("stage") %> + <% end $> + <% if ENV["RAILS_HOST"] && (ENV["RAILS_HOST"].include?("stage") || ENV["RAILS_HOST"].include?("test") || ENV["RAILS_HOST"].include?("dev") || ENV["RAILS_HOST"].include?("localhost")) %> + + <% else %> + <% end %> <%= render_page_title %> diff --git a/app/views/shared/header/_header_navbar.html.erb b/app/views/shared/header/_header_navbar.html.erb index 5c32df1f1..b99f14826 100644 --- a/app/views/shared/header/_header_navbar.html.erb +++ b/app/views/shared/header/_header_navbar.html.erb @@ -1,4 +1,4 @@ -<%= render 'shared/header/alert-bar' %> +<%#= render 'shared/header/alert-bar' %>