From 79878240682b2f7e335db4edd4c6a4ed8044a170 Mon Sep 17 00:00:00 2001 From: Ruben Verborgh Date: Mon, 19 Sep 2022 20:15:30 +0200 Subject: [PATCH] fix: Clarify application consent screen. --- .../identity/email-password/consent.html.ejs | 92 ++++++++++--------- templates/scripts/util.js | 10 ++ templates/styles/main.css | 39 +++++++- 3 files changed, 96 insertions(+), 45 deletions(-) diff --git a/templates/identity/email-password/consent.html.ejs b/templates/identity/email-password/consent.html.ejs index b38a888f1..543203e8b 100644 --- a/templates/identity/email-password/consent.html.ejs +++ b/templates/identity/email-password/consent.html.ejs @@ -1,8 +1,12 @@ -

Authorize

-

Your WebID:

-

The following client wants to do authorized requests in your name:

- +

An application is requesting access

+

+ Your WebID is +

+

+ Do you trust this application + to read and write data on your behalf? +

+

@@ -15,52 +19,54 @@

- - + + +

- - diff --git a/templates/scripts/util.js b/templates/scripts/util.js index 2b07423b5..117315be7 100644 --- a/templates/scripts/util.js +++ b/templates/scripts/util.js @@ -1,3 +1,13 @@ +/** + * Returns an object that maps IDs to the corresponding element. + * + * @param ...ids - IDs of the element (empty to retrieve all elements) + */ +function getElements(...ids) { + ids = ids.length ? ids : [...document.querySelectorAll("[id]")].map(e => e.id); + return Object.fromEntries(ids.map(id => [id, document.getElementById(id)])); +} + /** * Acquires all data from the given form and POSTs it as JSON to the target URL. * In case of failure this function will throw an error. diff --git a/templates/styles/main.css b/templates/styles/main.css index 77d8a1bf2..7e5e21ed4 100644 --- a/templates/styles/main.css +++ b/templates/styles/main.css @@ -138,6 +138,20 @@ ul ul, ol ul { padding-left: 1em; } +dl { + padding: 0 0 0 2em; + margin: .75em 0 0; +} +dl dt { + font-weight: bold; + float: left; + clear: left; + min-width: 4em; +} +dl dt:after { + content: ": "; +} + pre { overflow-x: scroll; } @@ -207,12 +221,30 @@ button { border: 0px; background-color: var(--solid-purple); color: white; - - font-weight: 600; } button:hover { background-color: var(--solid-blue); } +button[type=submit] { + font-weight: 600; +} + +button.alternate { + display: block; + padding: 0; + margin: .5em 0; + + background: none; + color: var(--solid-purple); + font-weight: normal; +} +button.alternate:hover { + color: var(--solid-blue); +} + +input:focus, button:focus { + outline: var(--solid-blue) solid 1.5px; +} form p.actions { margin: .5em 0 1em 11em; @@ -222,6 +254,9 @@ form p.error { color: #ad0f0f; font-weight: 600; } +form p.error:empty { + display :none; +} form ul.actions { padding: 0;