From 19224d592a5b957089352aea4b0757421f5092a3 Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Mon, 6 Jul 2020 12:45:09 +0200 Subject: [PATCH 1/7] Add optional icon only menu layout --- assets/sass/layout.scss | 42 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/assets/sass/layout.scss b/assets/sass/layout.scss index e91200e..9aad28f 100644 --- a/assets/sass/layout.scss +++ b/assets/sass/layout.scss @@ -64,6 +64,7 @@ header { list-style: none; a, span { + position: relative; display: flex; flex-direction: row; align-items: center; @@ -72,7 +73,15 @@ header { .feather { --icon-size: 24px; - margin-right: 10px; + } + + &:hover { + .tip { + visibility: visible; + opacity: 1; + transition: opacity ease-out 100ms; + transition-delay: 150ms; + } } } @@ -129,9 +138,40 @@ header { &.open { transform: translateX(0%); } + + li a { + .tip { + display: block; + margin-left: 8px; + } + } } } } + + @media (min-width: $menuLayoutSwitchTreshold) { + nav ul li a .tip { + visibility: hidden; + position: absolute; + display: block; + width: max-content; + height: 30px; + padding: 4px 8px; + line-height: 22px; + top: calc(100% + 8px); + left: 50%; + transform: translateX(-50%); + + text-align: center; + font-size: 18px; + color: $defaultTextColor; + opacity: 0; + transition: opacity ease-out 100ms, visibility step-end 150ms; + transition-delay: 0ms; + background-color: #000; + border-radius: 5px; + } + } } footer { From 8aad5210148792cae75a11f2f619e8c54f160045 Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Mon, 6 Jul 2020 12:49:28 +0200 Subject: [PATCH 2/7] Fix last menu item tip overflowing out of document --- assets/sass/layout.scss | 46 ++++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/assets/sass/layout.scss b/assets/sass/layout.scss index 9aad28f..9c179ec 100644 --- a/assets/sass/layout.scss +++ b/assets/sass/layout.scss @@ -150,26 +150,34 @@ header { } @media (min-width: $menuLayoutSwitchTreshold) { - nav ul li a .tip { - visibility: hidden; - position: absolute; - display: block; - width: max-content; - height: 30px; - padding: 4px 8px; - line-height: 22px; - top: calc(100% + 8px); - left: 50%; - transform: translateX(-50%); + nav ul li { + a .tip { + visibility: hidden; + position: absolute; + display: block; + width: max-content; + height: 30px; + padding: 4px 8px; + line-height: 22px; + top: calc(100% + 8px); + left: 50%; + transform: translateX(-50%); - text-align: center; - font-size: 18px; - color: $defaultTextColor; - opacity: 0; - transition: opacity ease-out 100ms, visibility step-end 150ms; - transition-delay: 0ms; - background-color: #000; - border-radius: 5px; + text-align: center; + font-size: 18px; + color: $defaultTextColor; + opacity: 0; + transition: opacity ease-out 100ms, visibility step-end 150ms; + transition-delay: 0ms; + background-color: #000; + border-radius: 5px; + } + + &:last-child a .tip { + left: unset; + right: 4px; + transform: none; + } } } } From c8708af549ee978cce614f5325e3717d8ca32c35 Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Sun, 12 Jul 2020 11:56:10 +0200 Subject: [PATCH 3/7] Promote some views to wms-core --- views/errors/400.njk | 2 - views/errors/401.njk | 2 - views/errors/403.njk | 2 - views/errors/404.njk | 2 - views/errors/429.njk | 2 - views/errors/500.njk | 2 - views/errors/503.njk | 2 - views/errors/error.njk | 36 ----- views/layouts/barebone.njk | 37 ----- views/layouts/base.njk | 2 +- views/macros.njk | 142 -------------------- views/magic_link.njk | 19 --- views/magic_link_lobby.njk | 58 -------- views/mails/account_review_notice.mjml.njk | 41 ------ views/mails/base_layout.mjml.njk | 115 ---------------- views/mails/magic_link.mjml.njk | 66 --------- views/mails/pending_account_review.mjml.njk | 66 --------- yarn.lock | 6 +- 18 files changed, 4 insertions(+), 598 deletions(-) delete mode 100644 views/errors/400.njk delete mode 100644 views/errors/401.njk delete mode 100644 views/errors/403.njk delete mode 100644 views/errors/404.njk delete mode 100644 views/errors/429.njk delete mode 100644 views/errors/500.njk delete mode 100644 views/errors/503.njk delete mode 100644 views/errors/error.njk delete mode 100644 views/layouts/barebone.njk delete mode 100644 views/macros.njk delete mode 100644 views/magic_link.njk delete mode 100644 views/magic_link_lobby.njk delete mode 100644 views/mails/account_review_notice.mjml.njk delete mode 100644 views/mails/base_layout.mjml.njk delete mode 100644 views/mails/magic_link.mjml.njk delete mode 100644 views/mails/pending_account_review.mjml.njk diff --git a/views/errors/400.njk b/views/errors/400.njk deleted file mode 100644 index a5bc022..0000000 --- a/views/errors/400.njk +++ /dev/null @@ -1,2 +0,0 @@ -{% extends './error.njk' %} -{% import 'macros.njk' as macros %} diff --git a/views/errors/401.njk b/views/errors/401.njk deleted file mode 100644 index a5bc022..0000000 --- a/views/errors/401.njk +++ /dev/null @@ -1,2 +0,0 @@ -{% extends './error.njk' %} -{% import 'macros.njk' as macros %} diff --git a/views/errors/403.njk b/views/errors/403.njk deleted file mode 100644 index a5bc022..0000000 --- a/views/errors/403.njk +++ /dev/null @@ -1,2 +0,0 @@ -{% extends './error.njk' %} -{% import 'macros.njk' as macros %} diff --git a/views/errors/404.njk b/views/errors/404.njk deleted file mode 100644 index a5bc022..0000000 --- a/views/errors/404.njk +++ /dev/null @@ -1,2 +0,0 @@ -{% extends './error.njk' %} -{% import 'macros.njk' as macros %} diff --git a/views/errors/429.njk b/views/errors/429.njk deleted file mode 100644 index a5bc022..0000000 --- a/views/errors/429.njk +++ /dev/null @@ -1,2 +0,0 @@ -{% extends './error.njk' %} -{% import 'macros.njk' as macros %} diff --git a/views/errors/500.njk b/views/errors/500.njk deleted file mode 100644 index a5bc022..0000000 --- a/views/errors/500.njk +++ /dev/null @@ -1,2 +0,0 @@ -{% extends './error.njk' %} -{% import 'macros.njk' as macros %} diff --git a/views/errors/503.njk b/views/errors/503.njk deleted file mode 100644 index a5bc022..0000000 --- a/views/errors/503.njk +++ /dev/null @@ -1,2 +0,0 @@ -{% extends './error.njk' %} -{% import 'macros.njk' as macros %} diff --git a/views/errors/error.njk b/views/errors/error.njk deleted file mode 100644 index 3d05ea9..0000000 --- a/views/errors/error.njk +++ /dev/null @@ -1,36 +0,0 @@ -{% extends '../layouts/barebone.njk' %} - -{% set title = error_code + ' - ' + error_message %} - -{% block _stylesheets %} - -{% endblock %} - -{% block _body %} - - -
- {% if flash %} - {{ macros.messages(flash) }} - {% endif %} - -
{{ error_code }}
-
{{ error_message }}
-
{{ error_instructions|safe }}
- - -
- -
- Error ID: {{ error_id }} -
- If you think this isn't right, please contact us with the above error ID at - {{ app.contact_email }}. -
-{% endblock %} \ No newline at end of file diff --git a/views/layouts/barebone.njk b/views/layouts/barebone.njk deleted file mode 100644 index 3a82d94..0000000 --- a/views/layouts/barebone.njk +++ /dev/null @@ -1,37 +0,0 @@ - - - - - {{ title }} - - - - - - - - {% if description %} - - {% endif %} - - {% if refresh_after %} - - {% endif %} - - {% block _stylesheets %}{% endblock %} - {% block _scripts %} - - {% endblock %} - - - -
- {% block header %}{% endblock %} -
- -{% block _body %}{% endblock %} - -
{% block footer %}{% endblock %}
- - - \ No newline at end of file diff --git a/views/layouts/base.njk b/views/layouts/base.njk index 28033ac..4820bec 100644 --- a/views/layouts/base.njk +++ b/views/layouts/base.njk @@ -1,4 +1,4 @@ -{% extends './barebone.njk' %} +{% extends 'layouts/barebone.njk' %} {% import 'macros.njk' as macros %} {% block _stylesheets %} diff --git a/views/macros.njk b/views/macros.njk deleted file mode 100644 index 789700a..0000000 --- a/views/macros.njk +++ /dev/null @@ -1,142 +0,0 @@ -{% macro message(type, content, raw=false, discreet=false) %} -
- - - {{ content|safe if raw else content }} - -
-{% endmacro %} - -{% macro messages(flash) %} - {% set flashed = flash() %} - {% set display = 0 %} - - {% for type, bag in flashed %} - {% if bag|length %} - {% set display = 1 %} - {% endif %} - {% endfor %} - - {% if display %} -
- {% for type, bag in flashed %} - {% for content in bag %} - {{ message(type, content) }} - {% endfor %} - {% endfor %} -
- {% endif %} -{% endmacro %} - -{% macro csrf(getCSRFToken) %} - -{% endmacro %} - -{% macro field(_locals, type, name, value, placeholder, hint, validation_attributes='', extraData='') %} - {% set validation = _locals.validation() %} - {% set validation = validation[name] if validation[name] or null %} - {% set previousFormData = _locals.previousFormData() %} - {% set value = previousFormData[name] or value or validation.value or '' %} - - {% if type == 'hidden' %} - {% if validation %} - {{ message('error', validation.message) }} - {% endif %} - - {% else %} -
- {% if type == 'duration' %} -
- {% for f in extraData %} -
- {% if previousFormData[name] %} - {% set v = value[f] %} - {% else %} - {% set v = (value % 60) if f == 's' else (((value - value % 60) / 60 % 60) if f == 'm' else ((value - value % 3600) / 3600 if f == 'h')) %} - {% endif %} - - -
- {% endfor %} -
- {% elseif type == 'select' %} - - - {% else %} - - {% endif %} - - - {{ fieldError(_locals, name) }} - {% if hint %} -
{{ hint }}
- {% endif %} -
- {% endif %} -{% endmacro %} - -{% macro fieldError(_locals, name) %} - {% set validation = _locals.validation() %} - {% set validation = validation[name] if validation[name] or null %} - {% if validation %} -
{{ validation.message }}
- {% endif %} -{% endmacro %} - -{% macro websocket(websocketUrl, listener, reconnectOnClose = 1, checkFunction = 0) %} - -{% endmacro %} - -{% macro paginate(pagination, routeName) %} - {% if pagination.hasPrevious() or pagination.hasNext() %} - - {% endif %} -{% endmacro %} \ No newline at end of file diff --git a/views/magic_link.njk b/views/magic_link.njk deleted file mode 100644 index 41e6e17..0000000 --- a/views/magic_link.njk +++ /dev/null @@ -1,19 +0,0 @@ -{% extends 'layouts/base.njk' %} -{% import 'macros.njk' as macros %} - -{% set actionType = magicLink.action_type %} -{% set title = 'WMS: Magic Link' + (' - ' + actionType if actionType) %} -{% set h1 = 'Magic Link' + (' - ' + actionType if actionType) %} - -{% block body %} -
-
- {% if err %} - {{ macros.message('error', err) }} - {% else %} - {{ macros.message('success', 'Success!') }} -

You can now close this page.

- {% endif %} -
-
-{% endblock %} \ No newline at end of file diff --git a/views/magic_link_lobby.njk b/views/magic_link_lobby.njk deleted file mode 100644 index e1a15a4..0000000 --- a/views/magic_link_lobby.njk +++ /dev/null @@ -1,58 +0,0 @@ -{% extends 'layouts/base.njk' %} -{% import 'macros.njk' as macros %} - -{% set title = 'Authentication lobby' %} -{% set h1 = 'Authentication lobby' %} - -{% block body %} -
-
- {{ macros.message('success', 'We sent a link to ' + email + '. To authenticate, open it from any device.') }} - {{ macros.message('info', 'This link will be valid for and can only be used once.', true, true) }} - -

Waiting for you to open the link...

-
-
-{% endblock %} - -{% block scripts %} - - - {{ macros.websocket(websocketUrl, 'websocketListen', 1, 'isValid') }} -{% endblock %} \ No newline at end of file diff --git a/views/mails/account_review_notice.mjml.njk b/views/mails/account_review_notice.mjml.njk deleted file mode 100644 index de5b77f..0000000 --- a/views/mails/account_review_notice.mjml.njk +++ /dev/null @@ -1,41 +0,0 @@ -{% extends './base_layout.mjml.njk' %} - -{% block body %} - - - - {% if approved %} - Your registration was approved! - {% else %} - Sorry, your registration was rejected. - {% endif %} - - - {% if approved %} - An administrator approved your registration. You can now log in to your account. - {% else %} - Your registration was rejected and your account was deleted from our database. - If you believe that this is an error, please contact us via email. - {% endif %} - - - {% if approved %} - Login - {% endif %} - - -{% endblock %} - -{% block text %} - {% if approved %} - Hi - Your registration was approved! - - You can now log in to your account by follwing this link: {{ link|safe }} - {% else %} - Hi - Sorry, your registration was rejected. Your account was deleted from our database. - - If you believe that this is an error, please contact us via email. - {% endif %} -{% endblock %} \ No newline at end of file diff --git a/views/mails/base_layout.mjml.njk b/views/mails/base_layout.mjml.njk deleted file mode 100644 index fdae4b5..0000000 --- a/views/mails/base_layout.mjml.njk +++ /dev/null @@ -1,115 +0,0 @@ -{% if not text %} - - - {{ mail_subject }} - - - - - - - - - - - - - - - - - - - - - .link { - color: #00766c !important; - text-decoration: none; - } - - - .link:hover { - color: #00a99b !important; - } - - {% block head %}{% endblock %} - - - {% if mail_link %} - - - - Does this mail display improperly? - Open it in the browser - - - - {% endif %} - - - - - {{ app.name }} - - - - - {% block body %}{% endblock %} - - - - - All rights reserved. Contact us at - {{ app.contact_email }} - - - - - -{% else %} - {% block text %}{% endblock %} -{% endif %} \ No newline at end of file diff --git a/views/mails/magic_link.mjml.njk b/views/mails/magic_link.mjml.njk deleted file mode 100644 index 5bb0fba..0000000 --- a/views/mails/magic_link.mjml.njk +++ /dev/null @@ -1,66 +0,0 @@ -{% extends './base_layout.mjml.njk' %} - -{% block body %} - - - - {% if type == 'register' %} - Register an account on (app) - {% else %} - Log in to (app) - {% endif %} - - - {% if type == 'register' %} - Someone has requested an account registration for {{ mail_to }}. If it was not you, - please ignore this message. - {% else %} - Someone is attempting to log in to your account {{ mail_to }}. - {% endif %} - - - {% if type == 'register' %} - Finalize my account registration - {% else %} - If it is not you, DO NOT CLICK ON THIS BUTTON. - {% endif %} - - - - {% if type == 'login' %} - - - - IP: {{ ip }} - - - Location: {{ geo }} - - - - - Authorize log in - - - - {% endif %} -{% endblock %} - -{% block text %} - {% if type == 'register' %} - Hi! - Someone requested an account registration for {{ mail_to }}. If it was not you, - please ignore this message. - - To finalize your account registration, please follow this link: {{ link|safe }} - {% else %} - Hi! - Someone is attempting to log in to your account {{ mail_to }}. - - If it is not you, DO NOT FOLLOW THIS LINK. - - IP: {{ ip }} - Location: {{ geo }} - To authorize this log in, please follow this link: {{ link|safe }} - {% endif %} -{% endblock %} \ No newline at end of file diff --git a/views/mails/pending_account_review.mjml.njk b/views/mails/pending_account_review.mjml.njk deleted file mode 100644 index 5bb0fba..0000000 --- a/views/mails/pending_account_review.mjml.njk +++ /dev/null @@ -1,66 +0,0 @@ -{% extends './base_layout.mjml.njk' %} - -{% block body %} - - - - {% if type == 'register' %} - Register an account on (app) - {% else %} - Log in to (app) - {% endif %} - - - {% if type == 'register' %} - Someone has requested an account registration for {{ mail_to }}. If it was not you, - please ignore this message. - {% else %} - Someone is attempting to log in to your account {{ mail_to }}. - {% endif %} - - - {% if type == 'register' %} - Finalize my account registration - {% else %} - If it is not you, DO NOT CLICK ON THIS BUTTON. - {% endif %} - - - - {% if type == 'login' %} - - - - IP: {{ ip }} - - - Location: {{ geo }} - - - - - Authorize log in - - - - {% endif %} -{% endblock %} - -{% block text %} - {% if type == 'register' %} - Hi! - Someone requested an account registration for {{ mail_to }}. If it was not you, - please ignore this message. - - To finalize your account registration, please follow this link: {{ link|safe }} - {% else %} - Hi! - Someone is attempting to log in to your account {{ mail_to }}. - - If it is not you, DO NOT FOLLOW THIS LINK. - - IP: {{ ip }} - Location: {{ geo }} - To authorize this log in, please follow this link: {{ link|safe }} - {% endif %} -{% endblock %} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 8634a8a..571beda 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9837,9 +9837,9 @@ widest-line@^3.1.0: string-width "^4.0.0" wms-core@^0: - version "0.13.1" - resolved "https://registry.toot.party/wms-core/-/wms-core-0.13.1.tgz#73771a77cf0f3940f932418f932d77d0d6737cf5" - integrity sha512-DVRz+nLXsaa1CSzJJU310RJ8Qfdq1EIP/TwDfRs89Ko1IwaojP6by9np3nQHrRL3tQ3k9zg3YtHq3m24FOvpQw== + version "0.13.8" + resolved "https://registry.toot.party/wms-core/-/wms-core-0.13.8.tgz#bbd3d90c573c3df41607c48656bbeb417e6c1327" + integrity sha512-E/neyduIa+b1b4FEROXVrwbZsu0jOcgqhW5jk1LIHdxACqxbdKjSqpGXWATjCpiTmnBn7r4KQOS96y/6AwfcDg== dependencies: argon2 "^0.26.2" compression "^1.7.4" From 6a57dcdf9101d35c4674629d26c07688e47ac65d Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Sun, 12 Jul 2020 12:12:47 +0200 Subject: [PATCH 4/7] Promote some views to wms-core and update dependencies --- package.json | 19 +++-- views/errors/400.njk | 2 - views/errors/401.njk | 2 - views/errors/403.njk | 2 - views/errors/404.njk | 2 - views/errors/429.njk | 2 - views/errors/500.njk | 2 - views/errors/503.njk | 2 - views/errors/error.njk | 36 ---------- views/layouts/barebone.njk | 37 ---------- views/layouts/base.njk | 2 +- views/macros.njk | 142 ------------------------------------- 12 files changed, 13 insertions(+), 237 deletions(-) delete mode 100644 views/errors/400.njk delete mode 100644 views/errors/401.njk delete mode 100644 views/errors/403.njk delete mode 100644 views/errors/404.njk delete mode 100644 views/errors/429.njk delete mode 100644 views/errors/500.njk delete mode 100644 views/errors/503.njk delete mode 100644 views/errors/error.njk delete mode 100644 views/layouts/barebone.njk delete mode 100644 views/macros.njk diff --git a/package.json b/package.json index f9bf4df..beda726 100644 --- a/package.json +++ b/package.json @@ -18,9 +18,14 @@ "@babel/preset-env": "^7.9.5", "@types/config": "^0.0.36", "@types/express": "^4.17.6", + "@types/express-session": "^1.17.0", "@types/formidable": "^1.0.31", - "@types/jest": "^25.2.1", + "@types/jest": "^26.0.4", + "@types/mysql": "^2.15.15", "@types/node": "^13.13.2", + "@types/nodemailer": "^6.4.0", + "@types/nunjucks": "^3.1.3", + "@types/ws": "^7.2.6", "babel-loader": "^8.1.0", "concurrently": "^5.1.0", "css-loader": "^3.5.2", @@ -28,16 +33,16 @@ "file-loader": "^6.0.0", "imagemin": "^7.0.1", "imagemin-gifsicle": "^7.0.0", - "imagemin-mozjpeg": "^8.0.0", - "imagemin-pngquant": "^8.0.0", - "imagemin-svgo": "^7.1.0", + "imagemin-mozjpeg": "^9.0.0", + "imagemin-pngquant": "^9.0.0", + "imagemin-svgo": "^8.0.0", "img-loader": "^3.0.1", - "jest": "^25.4.0", + "jest": "^26.1.0", "mini-css-extract-plugin": "^0.9.0", "node-sass": "^4.14.0", "nodemon": "^2.0.3", - "sass-loader": "^8.0.2", - "ts-jest": "^25.4.0", + "sass-loader": "^9.0.2", + "ts-jest": "^26.1.1", "typescript": "^3.8.3", "uglifyjs-webpack-plugin": "^2.2.0", "webpack": "^4.43.0", diff --git a/views/errors/400.njk b/views/errors/400.njk deleted file mode 100644 index a5bc022..0000000 --- a/views/errors/400.njk +++ /dev/null @@ -1,2 +0,0 @@ -{% extends './error.njk' %} -{% import 'macros.njk' as macros %} diff --git a/views/errors/401.njk b/views/errors/401.njk deleted file mode 100644 index a5bc022..0000000 --- a/views/errors/401.njk +++ /dev/null @@ -1,2 +0,0 @@ -{% extends './error.njk' %} -{% import 'macros.njk' as macros %} diff --git a/views/errors/403.njk b/views/errors/403.njk deleted file mode 100644 index a5bc022..0000000 --- a/views/errors/403.njk +++ /dev/null @@ -1,2 +0,0 @@ -{% extends './error.njk' %} -{% import 'macros.njk' as macros %} diff --git a/views/errors/404.njk b/views/errors/404.njk deleted file mode 100644 index a5bc022..0000000 --- a/views/errors/404.njk +++ /dev/null @@ -1,2 +0,0 @@ -{% extends './error.njk' %} -{% import 'macros.njk' as macros %} diff --git a/views/errors/429.njk b/views/errors/429.njk deleted file mode 100644 index a5bc022..0000000 --- a/views/errors/429.njk +++ /dev/null @@ -1,2 +0,0 @@ -{% extends './error.njk' %} -{% import 'macros.njk' as macros %} diff --git a/views/errors/500.njk b/views/errors/500.njk deleted file mode 100644 index a5bc022..0000000 --- a/views/errors/500.njk +++ /dev/null @@ -1,2 +0,0 @@ -{% extends './error.njk' %} -{% import 'macros.njk' as macros %} diff --git a/views/errors/503.njk b/views/errors/503.njk deleted file mode 100644 index a5bc022..0000000 --- a/views/errors/503.njk +++ /dev/null @@ -1,2 +0,0 @@ -{% extends './error.njk' %} -{% import 'macros.njk' as macros %} diff --git a/views/errors/error.njk b/views/errors/error.njk deleted file mode 100644 index 3d05ea9..0000000 --- a/views/errors/error.njk +++ /dev/null @@ -1,36 +0,0 @@ -{% extends '../layouts/barebone.njk' %} - -{% set title = error_code + ' - ' + error_message %} - -{% block _stylesheets %} - -{% endblock %} - -{% block _body %} - - -
- {% if flash %} - {{ macros.messages(flash) }} - {% endif %} - -
{{ error_code }}
-
{{ error_message }}
-
{{ error_instructions|safe }}
- - -
- -
- Error ID: {{ error_id }} -
- If you think this isn't right, please contact us with the above error ID at - {{ app.contact_email }}. -
-{% endblock %} \ No newline at end of file diff --git a/views/layouts/barebone.njk b/views/layouts/barebone.njk deleted file mode 100644 index 3a82d94..0000000 --- a/views/layouts/barebone.njk +++ /dev/null @@ -1,37 +0,0 @@ - - - - - {{ title }} - - - - - - - - {% if description %} - - {% endif %} - - {% if refresh_after %} - - {% endif %} - - {% block _stylesheets %}{% endblock %} - {% block _scripts %} - - {% endblock %} - - - -
- {% block header %}{% endblock %} -
- -{% block _body %}{% endblock %} - -
{% block footer %}{% endblock %}
- - - \ No newline at end of file diff --git a/views/layouts/base.njk b/views/layouts/base.njk index f87c6aa..cb76570 100644 --- a/views/layouts/base.njk +++ b/views/layouts/base.njk @@ -1,4 +1,4 @@ -{% extends './barebone.njk' %} +{% extends 'layouts/barebone.njk' %} {% import 'macros.njk' as macros %} {% block _stylesheets %} diff --git a/views/macros.njk b/views/macros.njk deleted file mode 100644 index 789700a..0000000 --- a/views/macros.njk +++ /dev/null @@ -1,142 +0,0 @@ -{% macro message(type, content, raw=false, discreet=false) %} -
- - - {{ content|safe if raw else content }} - -
-{% endmacro %} - -{% macro messages(flash) %} - {% set flashed = flash() %} - {% set display = 0 %} - - {% for type, bag in flashed %} - {% if bag|length %} - {% set display = 1 %} - {% endif %} - {% endfor %} - - {% if display %} -
- {% for type, bag in flashed %} - {% for content in bag %} - {{ message(type, content) }} - {% endfor %} - {% endfor %} -
- {% endif %} -{% endmacro %} - -{% macro csrf(getCSRFToken) %} - -{% endmacro %} - -{% macro field(_locals, type, name, value, placeholder, hint, validation_attributes='', extraData='') %} - {% set validation = _locals.validation() %} - {% set validation = validation[name] if validation[name] or null %} - {% set previousFormData = _locals.previousFormData() %} - {% set value = previousFormData[name] or value or validation.value or '' %} - - {% if type == 'hidden' %} - {% if validation %} - {{ message('error', validation.message) }} - {% endif %} - - {% else %} -
- {% if type == 'duration' %} -
- {% for f in extraData %} -
- {% if previousFormData[name] %} - {% set v = value[f] %} - {% else %} - {% set v = (value % 60) if f == 's' else (((value - value % 60) / 60 % 60) if f == 'm' else ((value - value % 3600) / 3600 if f == 'h')) %} - {% endif %} - - -
- {% endfor %} -
- {% elseif type == 'select' %} - - - {% else %} - - {% endif %} - - - {{ fieldError(_locals, name) }} - {% if hint %} -
{{ hint }}
- {% endif %} -
- {% endif %} -{% endmacro %} - -{% macro fieldError(_locals, name) %} - {% set validation = _locals.validation() %} - {% set validation = validation[name] if validation[name] or null %} - {% if validation %} -
{{ validation.message }}
- {% endif %} -{% endmacro %} - -{% macro websocket(websocketUrl, listener, reconnectOnClose = 1, checkFunction = 0) %} - -{% endmacro %} - -{% macro paginate(pagination, routeName) %} - {% if pagination.hasPrevious() or pagination.hasNext() %} - - {% endif %} -{% endmacro %} \ No newline at end of file From 5f4bcae38cef09beed27a7eeeda376ad044b6162 Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Sun, 12 Jul 2020 12:13:26 +0200 Subject: [PATCH 5/7] Rename ExampleApp.test.ts to more useful App.test.ts --- test/{ExampleApp.test.ts => App.test.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename test/{ExampleApp.test.ts => App.test.ts} (100%) diff --git a/test/ExampleApp.test.ts b/test/App.test.ts similarity index 100% rename from test/ExampleApp.test.ts rename to test/App.test.ts From e7e5981af741c74c8c99e4cb5b4cecf3216d4a45 Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Sun, 12 Jul 2020 12:15:22 +0200 Subject: [PATCH 6/7] Improve progress bar design --- assets/sass/layout.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/assets/sass/layout.scss b/assets/sass/layout.scss index e91200e..a818460 100644 --- a/assets/sass/layout.scss +++ b/assets/sass/layout.scss @@ -652,6 +652,7 @@ button, .button { top: 0; width: var(--progress); height: 100%; + transition: width ease-out 150ms; background: $secondary; } From deab6d7962801247d61ca38233527ece7510cdec Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Tue, 14 Jul 2020 15:20:47 +0200 Subject: [PATCH 7/7] Upgrade dependencies --- views/auth.njk | 42 ------------------------------------- yarn.lock | 56 +++++++++++++++++++++++++------------------------- 2 files changed, 28 insertions(+), 70 deletions(-) delete mode 100644 views/auth.njk diff --git a/views/auth.njk b/views/auth.njk deleted file mode 100644 index 3e4e380..0000000 --- a/views/auth.njk +++ /dev/null @@ -1,42 +0,0 @@ -{% extends 'layouts/base.njk' %} -{% import 'macros.njk' as macros %} - -{% set title = 'Authentication / Registration' %} -{% set decription = 'Join ' + app.name + ' and share your files!' %} -{% set h1 = 'Authentication and registration' %} - -{% block body %} -
-
- {% if register_confirm_email %} -
-

Register

- {{ macros.message('question', 'Do you wish to create a new account with ' + register_confirm_email + '?', false, false) }} - {{ macros.message('warning', 'If you already have an account, please log in with your existing email first and then add your new email in the Account page.', false, true) }} - - - -
-
Email: {{ register_confirm_email }}
-
- - Go back - - - {{ macros.csrf(getCSRFToken) }} -
- {% else %} -
-

Log in or register

- {# {{ macros.message('info', 'If we don\'t find your email address in our database, you will be able to register.', false, true) }}#} -
- {{ macros.field(_locals, 'email', 'email', query.email or '', 'Your email address', "If we don't find your email address in our database, you will be able to register.", 'required') }} -
- - - {{ macros.csrf(getCSRFToken) }} -
- {% endif %} -
-
-{% endblock %} diff --git a/yarn.lock b/yarn.lock index 0da6e75..3b02ba5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1238,9 +1238,9 @@ "@types/node" "*" "@types/node@*": - version "14.0.22" - resolved "https://registry.toot.party/@types%2fnode/-/node-14.0.22.tgz#23ea4d88189cec7d58f9e6b66f786b215eb61bdc" - integrity sha512-emeGcJvdiZ4Z3ohbmw93E/64jRzUHAItSHt8nF7M4TGgQTiWqFVGB8KNpLGFmUHmHLvjvBgFwVlqNcq+VuGv9g== + version "14.0.23" + resolved "https://registry.toot.party/@types%2fnode/-/node-14.0.23.tgz#676fa0883450ed9da0bb24156213636290892806" + integrity sha512-Z4U8yDAl5TFkmYsZdFPdjeMa57NOvnaf1tljHzhouaPEp7LCj2JKkejpI1ODviIAQuW4CcQmxkQ77rnLsOOoKw== "@types/node@^13.13.2": version "13.13.14" @@ -2320,9 +2320,9 @@ camelcase@^6.0.0: integrity sha512-8KMDF1Vz2gzOq54ONPJS65IvTUaB1cHJ2DMM7MbPmLZljDH1qpzzLsWdiN9pHh6qvkRVDTi/07+eNGch/oLU4w== caniuse-lite@^1.0.30001093: - version "1.0.30001097" - resolved "https://registry.toot.party/caniuse-lite/-/caniuse-lite-1.0.30001097.tgz#1129c40c9f5ee3282158da08fd915d301f4a9bd8" - integrity sha512-TeuSleKt/vWXaPkLVFqGDnbweYfq4IaZ6rUugFf3rWY6dlII8StUZ8Ddin0PkADfgYZ4wRqCdO2ORl4Rn5eZIA== + version "1.0.30001099" + resolved "https://registry.toot.party/caniuse-lite/-/caniuse-lite-1.0.30001099.tgz#540118fcc6842d1fde62f4ee5521d1ec6afdb40e" + integrity sha512-sdS9A+sQTk7wKoeuZBN/YMAHVztUfVnjDi4/UV3sDE8xoh7YR12hKW+pIdB3oqKGwr9XaFL2ovfzt9w8eUI5CA== capture-exit@^2.0.0: version "2.0.0" @@ -3431,9 +3431,9 @@ ee-first@1.1.1: integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= electron-to-chromium@^1.3.488: - version "1.3.496" - resolved "https://registry.toot.party/electron-to-chromium/-/electron-to-chromium-1.3.496.tgz#3f43d32930481d82ad3663d79658e7c59a58af0b" - integrity sha512-TXY4mwoyowwi4Lsrq9vcTUYBThyc1b2hXaTZI13p8/FRhY2CTaq5lK+DVjhYkKiTLsKt569Xes+0J5JsVXFurQ== + version "1.3.497" + resolved "https://registry.toot.party/electron-to-chromium/-/electron-to-chromium-1.3.497.tgz#de00f2f2f44c258c4577fbfbd5124b94c18bfa44" + integrity sha512-sPdW5bUDZwiFtoonuZCUwRGzsZmKzcLM0bMVhp6SMCfUG+B3faENLx3cE+o+K0Jl+MPuNA9s9cScyFjOlixZpQ== elliptic@^6.0.0, elliptic@^6.5.2: version "6.5.3" @@ -5583,7 +5583,7 @@ jest-snapshot@^26.1.0: pretty-format "^26.1.0" semver "^7.3.2" -jest-util@^26.1.0: +jest-util@26.x, jest-util@^26.1.0: version "26.1.0" resolved "https://registry.toot.party/jest-util/-/jest-util-26.1.0.tgz#80e85d4ba820decacf41a691c2042d5276e5d8d8" integrity sha512-rNMOwFQevljfNGvbzNQAxdmXQ+NawW/J72dmddsK0E8vgxXCMtwQ/EH0BiWEIxh0hhMcTsxwAxINt7Lh46Uzbg== @@ -6202,14 +6202,6 @@ methods@~1.1.2: resolved "https://registry.toot.party/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= -micromatch@4.x, micromatch@^4.0.2: - version "4.0.2" - resolved "https://registry.toot.party/micromatch/-/micromatch-4.0.2.tgz#4fcb0999bf9fbc2fcbdd212f6d629b9a56c39259" - integrity sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q== - dependencies: - braces "^3.0.1" - picomatch "^2.0.5" - micromatch@^3.0.4, micromatch@^3.1.10, micromatch@^3.1.4: version "3.1.10" resolved "https://registry.toot.party/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" @@ -6229,6 +6221,14 @@ micromatch@^3.0.4, micromatch@^3.1.10, micromatch@^3.1.4: snapdragon "^0.8.1" to-regex "^3.0.2" +micromatch@^4.0.2: + version "4.0.2" + resolved "https://registry.toot.party/micromatch/-/micromatch-4.0.2.tgz#4fcb0999bf9fbc2fcbdd212f6d629b9a56c39259" + integrity sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q== + dependencies: + braces "^3.0.1" + picomatch "^2.0.5" + miller-rabin@^4.0.0: version "4.0.1" resolved "https://registry.toot.party/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d" @@ -8054,9 +8054,9 @@ regexpu-core@^4.7.0: unicode-match-property-value-ecmascript "^1.2.0" registry-auth-token@^4.0.0: - version "4.1.1" - resolved "https://registry.toot.party/registry-auth-token/-/registry-auth-token-4.1.1.tgz#40a33be1e82539460f94328b0f7f0f84c16d9479" - integrity sha512-9bKS7nTl9+/A1s7tnPeGrUpRcVY+LUh7bfFgzpndALdPfXQBfQV77rQVtqgUV3ti4vc/Ik81Ex8UJDWDQ12zQA== + version "4.2.0" + resolved "https://registry.toot.party/registry-auth-token/-/registry-auth-token-4.2.0.tgz#1d37dffda72bbecd0f581e4715540213a65eb7da" + integrity sha512-P+lWzPrsgfN+UEpDS3U8AQKg/UjZX6mQSJueZj3EK+vNESoqBSpBUD3gmu4sF9lOsjXWjF11dQKUqemf3veq1w== dependencies: rc "^1.2.8" @@ -9264,17 +9264,17 @@ trim-repeated@^1.0.0: glob "^7.1.2" ts-jest@^26.1.1: - version "26.1.1" - resolved "https://registry.toot.party/ts-jest/-/ts-jest-26.1.1.tgz#b98569b8a4d4025d966b3d40c81986dd1c510f8d" - integrity sha512-Lk/357quLg5jJFyBQLnSbhycnB3FPe+e9i7ahxokyXxAYoB0q1pPmqxxRPYr4smJic1Rjcf7MXDBhZWgxlli0A== + version "26.1.2" + resolved "https://registry.toot.party/ts-jest/-/ts-jest-26.1.2.tgz#dd2e832ffae9cb803361483b6a3010a6413dc475" + integrity sha512-V4SyBDO9gOdEh+AF4KtXJeP+EeI4PkOrxcA8ptl4o8nCXUVM5Gg/8ngGKneS5BsZaR9DXVQNqj9k+iqGAnpGow== dependencies: bs-logger "0.x" buffer-from "1.x" fast-json-stable-stringify "2.x" + jest-util "26.x" json5 "2.x" lodash.memoize "4.x" make-error "1.x" - micromatch "4.x" mkdirp "1.x" semver "7.x" yargs-parser "18.x" @@ -9839,9 +9839,9 @@ widest-line@^3.1.0: string-width "^4.0.0" wms-core@^0: - version "0.13.8" - resolved "https://registry.toot.party/wms-core/-/wms-core-0.13.8.tgz#bbd3d90c573c3df41607c48656bbeb417e6c1327" - integrity sha512-E/neyduIa+b1b4FEROXVrwbZsu0jOcgqhW5jk1LIHdxACqxbdKjSqpGXWATjCpiTmnBn7r4KQOS96y/6AwfcDg== + version "0.13.9" + resolved "https://registry.toot.party/wms-core/-/wms-core-0.13.9.tgz#a86fc5764663d2afe7e70b416e061a83dcb458c0" + integrity sha512-AkKKXEWUQGSkZ43hGZ3kziZTD2p0xO4Bj7szF8uSWxSj3leuGac+thDSPk/OJz53s1SQ89Zq2MjVFNh19sjPeQ== dependencies: argon2 "^0.26.2" compression "^1.7.4"