Skip to content

Commit

Permalink
Update 404 page to handle missing contact link. Small template refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
jabrah committed Dec 18, 2023
1 parent bbf2f45 commit e64df11
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
5 changes: 2 additions & 3 deletions app/controllers/not-found-error.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
/* eslint-disable ember/no-get */
import Controller from '@ember/controller';
import { get } from '@ember/object';

export default class NotFoundErrorController extends Controller {
get icon() {
return `${get(this, 'model.config.branding.error.icon')}`;
return this.model.config.branding.error?.icon;
}

get contactUrl() {
return `${get(this, 'model.config.branding.pages.contactUrl')}`;
return this.model.config.branding.pages?.contactUrl;
}
}
15 changes: 11 additions & 4 deletions app/templates/not-found-error.hbs
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
{{outlet}}
<div class="row">
<div class="col">
<img src="{{this.icon}}" local-class="error-icon" alt="Error icon" />
<p local-class="error-text"><br />404: Page not found</p>
<div class="col-2">
<img src="{{this.icon}}" alt="Error icon" />
</div>
<div class="col my-auto">
<h2>404: Page not found</h1>
<p local-class="helpful-text">Looks like the page you're looking for does not exist. If you think there is a problem
with the site, please
<a href="{{this.contactUrl}}">let us know</a>.</p>
{{#if this.contactUrl}}
<a href="{{this.contactUrl}}">let us know</a>.
{{else}}
contact your administrator.
{{/if}}
</p>
</div>
</div>

0 comments on commit e64df11

Please sign in to comment.