diff --git a/app/controllers/auth.js b/app/controllers/auth.js index 0b05fb1..4dec3b3 100644 --- a/app/controllers/auth.js +++ b/app/controllers/auth.js @@ -159,7 +159,6 @@ class AuthController extends SiteController { // scrub login return URL from session delete req.session.loginReturnTo; - await this.saveSession(req); // redirect to whatever was wanted return res.redirect(redirectUri); @@ -201,6 +200,7 @@ class AuthController extends SiteController { async getCoreHome (req, res, next) { const { coreNode: coreNodeService } = this.dtp.services; try { + res.locals.currentView = 'welcome'; res.locals.pagination = this.getPaginationParameters(req, 20); res.locals.connectedCores = await coreNodeService.getConnectedCores(res.locals.pagination); res.render('welcome/core-home'); diff --git a/app/controllers/welcome.js b/app/controllers/welcome.js index fc8ecff..09b54d3 100644 --- a/app/controllers/welcome.js +++ b/app/controllers/welcome.js @@ -26,7 +26,10 @@ class WelcomeController extends SiteController { captcha.loadFont(path.join(this.dtp.config.root, 'client', 'fonts', 'Dirty Sweb.ttf')); const router = express.Router(); - this.dtp.app.use('/welcome', welcomeLimiter, router); + this.dtp.app.use('/welcome', welcomeLimiter, async (req, res, next) => { + res.locals.currentView = 'welcome'; + return next(); + }, router); router.get('/core-member', this.getWelcomeCoreMember.bind(this)); router.get('/signup/captcha', this.getSignupCaptcha.bind(this)); diff --git a/app/views/welcome/core-home.pug b/app/views/welcome/core-home.pug index aeb2a1f..bb313d9 100644 --- a/app/views/welcome/core-home.pug +++ b/app/views/welcome/core-home.pug @@ -1,21 +1,28 @@ -extends ../layouts/main +extends ../layouts/focused block content section.uk-section.uk-section-default .uk-container - .uk-margin-large - h1.uk-text-center Select Community - p.uk-text-center #{site.name} is connected with the following Core Communities. - div(uk-grid).uk-flex-center - each core in connectedCores - div(class="uk-width-1-1 uk-width-1-2@m uk-width-1-3@l") - //- pre= JSON.stringify(connectedCores, null, 2) - a(href=`/auth/core/${core._id}`).uk-display-block.uk-link-text - .uk-tile.uk-tile-default.uk-padding-small.uk-border-small - div(uk-grid).uk-grid-small.uk-flex-middle - .uk-width-auto - img(src=`http://${core.meta.domain}/img/icon/dtp-core.svg`, style="width: 48px; height: auto;") - .uk-width-expand - h4.uk-margin-remove= core.meta.name - .uk-text-small.uk-text-muted= core.meta.description \ No newline at end of file + .uk-card.uk-card-default + .uk-card-header + h1.uk-card-title Select Community + + .uk-card-body + div(uk-grid).uk-grid-small + each core in connectedCores + div(class="uk-width-1-1 uk-width-1-2@m uk-width-1-3@xl") + //- pre= JSON.stringify(connectedCores, null, 2) + a(href=`/auth/core/${core._id}`).uk-display-block.uk-link-reset + .dtp-core-list-item.uk-border-rounded + div(uk-grid).uk-grid-small.uk-flex-middle + .uk-width-auto + img(src=`http://${core.meta.domain}/img/icon/dtp-core.svg`, style="width: 48px; height: auto;") + .uk-width-expand + .core-name= core.meta.name + .core-description= core.meta.description + + .uk-card-footer + div(uk-grid).uk-grid-small + .uk-width-expand + +renderBackButton() \ No newline at end of file diff --git a/app/views/welcome/index.pug b/app/views/welcome/index.pug index d75df26..5dc3183 100644 --- a/app/views/welcome/index.pug +++ b/app/views/welcome/index.pug @@ -1,7 +1,7 @@ -extends ../layouts/main +extends ../layouts/focused block content - section.uk-section.uk-section-secondary + section.uk-section.uk-section-default .uk-container.uk-text-center .uk-width-auto.uk-margin-auto img(src=`/img/icon/${site.domainKey}/icon-256x256.png`).uk-border-rounded @@ -13,13 +13,13 @@ block content div(uk-grid).uk-flex-center div(class="uk-width-1-1 uk-width-1-3@m") .uk-margin-small - a(href="/auth/core").uk-button.dtp-button-primary.uk-border-rounded DTP Connect + a(href="/auth/core").uk-button.uk-button-primary.uk-border-rounded DTP Connect .uk-text-small Connect using DTP Core div(class="uk-width-1-1 uk-width-1-3@m") .uk-margin-small - a(href="/welcome/signup").uk-button.dtp-button-secondary.uk-border-rounded Create Account + a(href="/welcome/signup").uk-button.uk-button-secondary.uk-border-rounded Create Account .uk-text-small Create a local account div(class="uk-width-1-1 uk-width-1-3@m") .uk-margin-small - a(href="/welcome/login").uk-button.dtp-button-secondary.uk-border-rounded Sign In + a(href="/welcome/login").uk-button.uk-button-default.uk-border-rounded Sign In .uk-text-small Log in with your local account \ No newline at end of file diff --git a/app/views/welcome/login.pug b/app/views/welcome/login.pug index aab8ff1..40b2a25 100644 --- a/app/views/welcome/login.pug +++ b/app/views/welcome/login.pug @@ -1,12 +1,13 @@ -extends ../layouts/main +extends ../layouts/focused block content - form(method="POST", action="/auth/login").uk-form - section.uk-section.uk-section-default - .uk-container - .uk-card.uk-card-secondary.uk-card-small.uk-width-xlarge.uk-margin-auto.uk-border-rounded + section.uk-section.uk-section-default.uk-section-xsmall + .uk-container.uk-container-small + form(method="POST", action="/auth/login").uk-form + .uk-card.uk-card-default.uk-card-small.uk-width-xlarge.uk-margin-auto.uk-border-rounded .uk-card-header - +renderSectionTitle('Member Login') + h1.uk-card-title Member Login + .uk-card-body fieldset.uk-fieldset .uk-margin-small @@ -25,8 +26,10 @@ block content input(id="password", name="password", type="password", placeholder="Enter password").uk-input .uk-card-footer - .uk-flex.uk-flex-right.uk-flex-middle + div(uk-grid).uk-grid-small.uk-flex-middle .uk-width-expand + +renderBackButton() + .uk-width-auto a(href="/").uk-text-muted Forgot password .uk-width-auto button(type="submit").uk-button.dtp-button-primary Login \ No newline at end of file diff --git a/app/views/welcome/signup.pug b/app/views/welcome/signup.pug index 1f33b81..84fd927 100644 --- a/app/views/welcome/signup.pug +++ b/app/views/welcome/signup.pug @@ -1,48 +1,54 @@ -extends ../layouts/main +extends ../layouts/focused block content - form(method="POST", action="/user").uk-form - section.uk-section.uk-section-default.uk-section-xsmall - .uk-container.uk-container-small - p You are creating a new member account on #[+renderSiteLink()]. If you have an account, please #[a(href="/welcome/login") log in here]. An account is required to comment on posts and use other site features. - - .uk-margin - label(for="email").uk-form-label Email - input(id="email", name="email", type="email", autocomplete="off", placeholder="Enter your email address").uk-input - .uk-text-small.uk-text-muted.uk-margin-small-top(class="uk-visible@m") I'm throwing your email address away after the demo, and I'm not verifying it. You won't receive email. - - .uk-margin - label(for="username").uk-form-label Username - input(id="username", name="username", type="text", autocomplete="off", placeholder="Enter a username").uk-input - .uk-text-small.uk-text-muted.uk-margin-small-top(class="uk-visible@m") 40 characters max. No spaces. A-Z, a-z, 0-9, - (dash) and _ (underscore). - - .uk-margin - label(for="display-name").uk-form-label Display Name - input(id="display-name", name="displayName", type="text", autocomplete="off", placeholder="Enter a display name").uk-input - .uk-text-small.uk-text-muted.uk-margin-small-top(class="uk-visible@m") 40 characters max, and can include most printable characters including emojis, spaces, whatever you're into within reason. - - .uk-margin - div(uk-grid) - .uk-width-1-2 - .uk-margin - label(for="password").uk-form-label Password - input(id="password", name="password", type="password", placeholder="Enter password").uk-input - .uk-text-small.uk-text-muted.uk-margin-small-top(class="uk-visible@m") Don't forget your password. There is no reset (yet). - - .uk-width-1-2 - .uk-margin - label(for="passwordv").uk-form-label Verify password - input(id="passwordv", name="passwordv", type="password", placeholder="Verify password").uk-input - .uk-text-small.uk-text-muted.uk-margin-small-top(class="uk-visible@m") Please enter your password again to prove you're not an idiot. - - section.uk-section.uk-section-secondary.uk-section - .uk-container.uk-container-small - .uk-margin-large - .uk-text-center + section.uk-section.uk-section-default.uk-section-xsmall + .uk-container.uk-container-small + form(method="POST", action="/user").uk-form + .uk-card.uk-card-default.uk-card-small.uk-width-xlarge.uk-margin-auto.uk-border-rounded + .uk-card-header + h1.uk-card-title Create New Account + + .uk-card-body + p You are creating a new member account on #[+renderSiteLink()]. If you have an account, please #[a(href="/welcome/login") log in here]. An account is required to comment on posts and use other site features. + + .uk-margin + label(for="email").uk-form-label Email + input(id="email", name="email", type="email", autocomplete="off", placeholder="Enter your email address").uk-input + .uk-text-small.uk-text-muted.uk-margin-small-top(class="uk-visible@m") I'm throwing your email address away after the demo, and I'm not verifying it. You won't receive email. + + .uk-margin + label(for="username").uk-form-label Username + input(id="username", name="username", type="text", autocomplete="off", placeholder="Enter a username").uk-input + .uk-text-small.uk-text-muted.uk-margin-small-top(class="uk-visible@m") 40 characters max. No spaces. A-Z, a-z, 0-9, - (dash) and _ (underscore). + .uk-margin + label(for="display-name").uk-form-label Display Name + input(id="display-name", name="displayName", type="text", autocomplete="off", placeholder="Enter a display name").uk-input + .uk-text-small.uk-text-muted.uk-margin-small-top(class="uk-visible@m") 40 characters max, and can include most printable characters including emojis, spaces, whatever you're into within reason. + + .uk-margin + div(uk-grid) + .uk-width-1-2 + .uk-margin + label(for="password").uk-form-label Password + input(id="password", name="password", type="password", placeholder="Enter password").uk-input + .uk-text-small.uk-text-muted.uk-margin-small-top(class="uk-visible@m") Don't forget your password. There is no reset (yet). + + .uk-width-1-2 + .uk-margin + label(for="passwordv").uk-form-label Verify password + input(id="passwordv", name="passwordv", type="password", placeholder="Verify password").uk-input + .uk-text-small.uk-text-muted.uk-margin-small-top(class="uk-visible@m") Please enter your password again to prove you're not an idiot. + + .uk-text-center.uk-margin .uk-width-medium.uk-margin-auto div(style="background: white;") img(src='/welcome/signup/captcha', style="padding: 8px 0;").uk-display-block.uk-margin-auto input(id="captcha", name="captcha", type="text", placeholder="Enter captcha text").uk-input.uk-text-center - .uk-margin-small - button(type="submit").uk-button.dtp-button-primary Create Account + + .uk-card-footer + div(uk-grid).uk-grid-small.uk-flex-middle + .uk-width-expand + +renderBackButton() + .uk-width-auto + button(type="submit").uk-button.uk-button-primary Create Account diff --git a/client/img/icon/dtp-core.svg b/client/img/icon/dtp-core.svg index bf76ef7..9b1f0be 100644 --- a/client/img/icon/dtp-core.svg +++ b/client/img/icon/dtp-core.svg @@ -39,9 +39,9 @@ inkscape:window-height="1019" id="namedview218" showgrid="false" - inkscape:zoom="0.178797" - inkscape:cx="-105.42657" - inkscape:cy="572.35887" + inkscape:zoom="1.0114286" + inkscape:cx="288.51293" + inkscape:cy="296.52704" inkscape:window-x="0" inkscape:window-y="36" inkscape:window-maximized="1" @@ -354,22 +354,22 @@ d="m 448.56,281.75 c 0,9.3125 7.5781,16.891 16.891,16.891 9.3086,0 16.891,-7.5781 16.891,-16.891 0,-9.3008 -7.582,-16.891 -16.891,-16.891 -9.3164,0.008 -16.891,7.5898 -16.891,16.891 z" id="path120" inkscape:connector-curvature="0" - style="fill:#ffaaaa" /> + style="fill:#000000" /> + style="fill:#000000" /> + style="fill:#000000" /> + style="fill:#000000" />