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 %>