Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing error message issue #618

Merged
merged 4 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions app/views/errors/file_not_found.html.erb
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
<h1>We are sorry, the page you requested cannot be found</h1>
<p>Please return to our <strong><a href="/">home page</a></strong>, use the navigation above, or <strong><a href="/ask-us">contact us</a></strong> for help.</p>
<div class="row">
<div class="container mt-4">
<h1 class="h2">We are sorry, the page you requested cannot be found</h1>
<p>Please return to our <strong><a href="/">home page</a></strong>, use the navigation above, or <strong><a href="/ask-us">contact us</a></strong> for help.</p>
</div>
</div>
9 changes: 7 additions & 2 deletions app/views/errors/internal_server_error.html.haml
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
<h1>We are sorry, something has gone wrong</h1>
<p>Please return to our <strong><a href="/">home page</a></strong>, use the navigation above, or <strong><a href="/ask-us">contact us</a></strong> for help.</p>

<div class="row">
<div class="container mt-4">
<h1 class="h2">We are sorry, something has gone wrong</h1>
<p>Please return to our <strong><a href="/">home page</a></strong>, use the navigation above, or <strong><a href="/ask-us">contact us</a></strong> for help.</p>
</div>
</div>
8 changes: 6 additions & 2 deletions app/views/errors/unprocessable.html.haml
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
<h1>We are sorry, your request cannot be processed</h1>
<p>Please return to our <strong><a href="/">home page</a></strong>, use the navigation above, or <strong><a href="/ask-us">contact us</a></strong> for help.</p>
<div class="row">
<div class="container mt-4">
<h1 class="h2">We are sorry, your request cannot be processed</h1>
<p>Please return to our <strong><a href="/">home page</a></strong>, use the navigation above, or <strong><a href="/ask-us">contact us</a></strong> for help.</p>
</div>
</div>
22 changes: 2 additions & 20 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
<meta content="width=device-width, initial-scale=1" name="viewport">
<title>
<% if content_for(:title) %>
<%= yield(:title) %>
<% elsif @cms_page %>
<%= @cms_page.label %>
<% else %>
Library
<% end %>
U of A Library
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious why you removed the content for(:title)/cms_page.label stuff? This seemed useful?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can tell the cms calls were creating the error so I decided to just remove them.

</title>
<link href="https://www.ualberta.ca/apple-touch-icon.png" rel="apple-touch-icon" sizes="180x180">
<link color="#275d38" href="https://www.ualberta.ca/safari-pinned-tab.svg" rel="mask-icon">
Expand All @@ -21,15 +15,14 @@
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
<script src="https://kit.fontawesome.com/5abf36224f.js" crossorigin="anonymous"></script>
<link href="https://www.ualberta.ca/_assets/css/framework-v2.css" media="screen" rel="stylesheet">
<link rel="stylesheet" href="https://library.ualberta.ca/cms-css/1/english-main.css">
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-MX43PRW2');</script>
<!-- End Google Tag Manager -->
<%= stylesheet_link_tag comfy_cms_render_css_path(@cms_site.id, @cms_layout.identifier) %>
Copy link
Collaborator

@murny murny Aug 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could just wrap this in a check? If we have a @cms_site then we are in the CMS, so we want the stylesheets/js from the CMS. Otherwise we are not in the CMS, so don't include the css/js from the CMS? So it works for both worlds?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could do - but as far as I can tell the only thing that uses the application layout are these error pages. This seemed like the quickest and easiest way to get everything working :)

<%= javascript_include_tag comfy_cms_render_js_path(@cms_site.id, @cms_layout.identifier) %>
</head>
<body>
<!-- Google Tag Manager (noscript) -->
Expand All @@ -48,17 +41,6 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<div class="site-title">
<a href="/">Library</a>
</div>
<div class="nav-right-buttons language-width">
<div class="language-selector notranslate">
<a id="dark-mode-toggle" data-toggle-second="tooltip" data-bs-placement="left" title="dark mode" tabindex="0" aria-label="dark mode" data-original-title="Dark/Light Mode" type="button"><span aria-hidden="true" class="fa-solid fa-moon" id="mode"></span></a>
<span class="d-block d-lg-none"><a aria-label="Language Selector" class="btn nav-language-btn language-toggle notranslate" data-language="fr-CA" href="{{ cms:text translated-url }}" type="button">FR</a></span>
<span class="d-none d-lg-block"><a aria-label="Language Selector" class="btn nav-language-btn d-none d-lg-block language-toggle notranslate" data-language="fr-CA" href="{{ cms:text translated-url }}" type="button">Français</a></span>

<a aria-label="Site Search" class="nav-search-btn btn" data-bs-target="#navSearchBanner" data-toggle-second="tooltip" data-bs-placement="right" title="site search" id="navSearchButton" type="button" href="/site-search">
<span aria-hidden="true" class="m-search fa fa-search"></span>
</a>
</div>
</div>
<div class="standard-nav nav-order nav-width">
<nav>
<button aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle Menu" class="navbar-toggler nav-menu-btn btn" data-bs-target="#navbarSupportedContent" data-bs-toggle="collapse" title="Menu" type="button">
Expand Down
Loading