From f6488eff5542653bcde6d7255852352fde03a182 Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Wed, 22 Dec 2021 19:14:04 +0100 Subject: [PATCH 1/3] styles: Make anchor tag styles reusable via composable `.link` CSS class --- app/styles/application.module.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/styles/application.module.css b/app/styles/application.module.css index efb93c4e188..7ae8ecba604 100644 --- a/app/styles/application.module.css +++ b/app/styles/application.module.css @@ -57,7 +57,7 @@ h1 { } } -a { +a, .link { color: var(--link-color); text-decoration: none; From 83932467f1b3a77e514c7556346a1449e01993fa Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Wed, 22 Dec 2021 19:14:25 +0100 Subject: [PATCH 2/3] styles: Explicitly set `pointer` cursor for links --- app/styles/application.module.css | 1 + 1 file changed, 1 insertion(+) diff --git a/app/styles/application.module.css b/app/styles/application.module.css index 7ae8ecba604..65ed02bd9c3 100644 --- a/app/styles/application.module.css +++ b/app/styles/application.module.css @@ -60,6 +60,7 @@ h1 { a, .link { color: var(--link-color); text-decoration: none; + cursor: pointer; &:hover { color: var(--link-hover-color); From a21b0a26a1f21f5b60d379ab1fbf1dc491a9bce6 Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Wed, 22 Dec 2021 19:15:26 +0100 Subject: [PATCH 3/3] catch-all: Convert links to buttons Using `javascript:...` hrefs does not work well with our CSP setup --- app/controllers/catch-all.js | 7 +++++-- app/styles/catch-all.module.css | 2 ++ app/templates/catch-all.hbs | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/controllers/catch-all.js b/app/controllers/catch-all.js index 7fc0a8dcb3c..373abce0397 100644 --- a/app/controllers/catch-all.js +++ b/app/controllers/catch-all.js @@ -2,8 +2,11 @@ import Controller from '@ember/controller'; import { action } from '@ember/object'; export default class CatchAllController extends Controller { - @action reload(event) { - event.preventDefault(); + @action reload() { this.model.transition.retry(); } + + @action back() { + history.back(); + } } diff --git a/app/styles/catch-all.module.css b/app/styles/catch-all.module.css index 61ea0fd12fd..c736c5b866f 100644 --- a/app/styles/catch-all.module.css +++ b/app/styles/catch-all.module.css @@ -15,5 +15,7 @@ } .link { + composes: button-reset from '../styles/shared/buttons.module.css'; + composes: link from '../styles/application.module.css'; font-weight: 500; } diff --git a/app/templates/catch-all.hbs b/app/templates/catch-all.hbs index 7018d397f8d..e898155870b 100644 --- a/app/templates/catch-all.hbs +++ b/app/templates/catch-all.hbs @@ -5,9 +5,9 @@

{{or @model.title "Page not found"}}

{{#if @model.tryAgain}} - Try Again + {{else}} - Go Back + {{/if}} \ No newline at end of file