From eb55c32a5ea84d7145d0d9c1c868cf238368d870 Mon Sep 17 00:00:00 2001 From: rob Date: Mon, 4 Jul 2022 22:20:17 -0400 Subject: [PATCH] wip to Core --- app/views/layouts/focused.pug | 6 ++ app/views/oauth2/authorize-dialog.pug | 117 +++++++++++++------------- 2 files changed, 66 insertions(+), 57 deletions(-) create mode 100644 app/views/layouts/focused.pug diff --git a/app/views/layouts/focused.pug b/app/views/layouts/focused.pug new file mode 100644 index 0000000..3c2fbdd --- /dev/null +++ b/app/views/layouts/focused.pug @@ -0,0 +1,6 @@ +extends main +block dtp-navbar +block focused-content + + h1 FOCUS + block content \ No newline at end of file diff --git a/app/views/oauth2/authorize-dialog.pug b/app/views/oauth2/authorize-dialog.pug index 881e517..ba952f6 100644 --- a/app/views/oauth2/authorize-dialog.pug +++ b/app/views/oauth2/authorize-dialog.pug @@ -1,62 +1,65 @@ -extends ../layouts/main -block dtp-navbar +extends ../layouts/focused block content section.uk-section.uk-section-default .uk-container - .uk-card.uk-card-default - .uk-card-header - h1.uk-card-title DTP Connect - - .uk-card-body - .uk-margin - div #{oauth2.client.site.name} is requesting access to your #{oauth2.user.username_lc}@#{site.domainKey} community account. If you authorize this access, you will be able to use #{oauth2.client.site.name} as #{oauth2.user.username_lc}@#{oauth2.client.site.domainKey}. - - .uk-margin - div(uk-grid).uk-flex-middle.uk-grid-divider.uk-grid-match - div(class="uk-width-1-1 uk-width-auto@m") - div(uk-grid).uk-grid-small.uk-flex-middle - .uk-width-auto - img(src=`http://${oauth2.client.site.domain}/img/icon/${oauth2.client.site.domainKey}/icon-48x48.png`) - .uk-width-expand - h4.uk-margin-remove= oauth2.client.site.name - .uk-text-small.uk-text-muted= oauth2.client.site.domainKey - - div(class="uk-width-1-1 uk-width-auto@m").uk-text-center - span - i.fas.fa-link - - div(class="uk-width-1-1 uk-width-auto@m") - div(uk-grid).uk-grid-small - .uk-width-auto - img(src=`/image/${oauth2.user.picture.small._id}`, style="width: 48px; height: auto;") - div(class="uk-width-auto") - h4.uk-margin-remove= oauth2.user.displayName - .uk-text-small.uk-text-muted @#{oauth2.user.username} - - .uk-margin - - - var scopeMap = { - 'account-read': 'Read account information (not email)', - 'event-write': 'Write events to your timelines', - }; - var scopes = oauth2.client.scopes.map((scope) => { - return scopeMap[scope] || scope; - }); - - .uk-text-bold Permissions requested: - ul.uk-list.uk-list-square - each scope in scopes - li= scope - - .uk-card-footer - div(uk-grid) - .uk-width-expand - +renderBackButton() - .uk-width-auto - button(id="deny", type="submit", value="Deny").uk-button.uk-button-default Deny - .uk-width-auto - button(id="allow", type="submit", value="Allow").uk-button.uk-button-primary Allow - - //- pre= JSON.stringify(oauth2, null, 2) \ No newline at end of file + form(method="POST", action="/oauth2/authorize/decision").uk-form + + input(name="transaction_id", type="hidden", value= oauth2.transactionID) + + .uk-card.uk-card-default + .uk-card-header + h1.uk-card-title DTP Connect + + .uk-card-body + .uk-margin + div #{oauth2.client.site.name} is requesting access to your #{oauth2.user.username_lc}@#{site.domainKey} community account. If you authorize this access, you will be able to use #{oauth2.client.site.name} as #{oauth2.user.username_lc}@#{oauth2.client.site.domainKey}. + + .uk-margin + div(uk-grid).uk-flex-middle.uk-grid-divider.uk-grid-match + div(class="uk-width-1-1 uk-width-auto@m") + div(uk-grid).uk-grid-small.uk-flex-middle + .uk-width-auto + img(src=`http://${oauth2.client.site.domain}/img/icon/${oauth2.client.site.domainKey}/icon-48x48.png`) + .uk-width-expand + h4.uk-margin-remove= oauth2.client.site.name + .uk-text-small.uk-text-muted= oauth2.client.site.domainKey + + div(class="uk-width-1-1 uk-width-auto@m").uk-text-center + span + i.fas.fa-link + + div(class="uk-width-1-1 uk-width-auto@m") + div(uk-grid).uk-grid-small + .uk-width-auto + img(src=`/image/${oauth2.user.picture.small._id}`, style="width: 48px; height: auto;") + div(class="uk-width-auto") + h4.uk-margin-remove= oauth2.user.displayName + .uk-text-small.uk-text-muted @#{oauth2.user.username} + + .uk-margin + - + var scopeMap = { + 'account-read': 'Read account information (not email)', + 'event-write': 'Write events to your timelines', + }; + var scopes = oauth2.client.scopes.map((scope) => { + return scopeMap[scope] || scope; + }); + + .uk-text-bold Permissions requested: + ul.uk-list.uk-list-square + each scope in scopes + li= scope + + .uk-card-footer + div(uk-grid) + .uk-width-expand + +renderBackButton() + .uk-width-auto + button(id="deny", type="submit", value="Deny").uk-button.uk-button-default Deny + .uk-width-auto + button(id="allow", type="submit", value="Allow").uk-button.uk-button-primary Allow + + pre= JSON.stringify(oauth2, null, 2) \ No newline at end of file