diff --git a/.eslintignore b/.eslintignore index 60bff4f5..54f42aa5 100644 --- a/.eslintignore +++ b/.eslintignore @@ -7,3 +7,4 @@ datumaro/ keys/ logs/ static/ +templates/ diff --git a/.eslintrc.js b/.eslintrc.js index 27ecc3c8..b171226f 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -4,14 +4,13 @@ module.exports = { env: { - node: false, + node: true, browser: true, es6: true, - jquery: true, - qunit: true, }, parserOptions: { - sourceType: 'script', + sourceType: 'module', + ecmaVersion: 2018, }, plugins: ['eslint-plugin-header'], extends: ['eslint:recommended', 'prettier'], diff --git a/.prettierignore b/.prettierignore index 60bff4f5..54f42aa5 100644 --- a/.prettierignore +++ b/.prettierignore @@ -7,3 +7,4 @@ datumaro/ keys/ logs/ static/ +templates/ diff --git a/.vscode/settings.json b/.vscode/settings.json index 506e3105..7efcd4e6 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,27 +1,22 @@ { "python.pythonPath": ".env/bin/python", "eslint.enable": true, - "eslint.validate": [ + "eslint.probe": [ "javascript", "typescript", - "typescriptreact", + "typescriptreact" ], + "eslint.onIgnoredFiles": "warn", "eslint.workingDirectories": [ { - "directory": "./cvat-core", - "changeProcessCWD": true + "directory": "${cwd}", }, { - "directory": "./cvat-canvas", - "changeProcessCWD": true + "pattern": "cvat-*" }, { - "directory": "./cvat-ui", - "changeProcessCWD": true - }, - { - "directory": ".", - "changeProcessCWD": true + "directory": "tests", + "!cwd": true } ], "python.linting.pylintEnabled": true, diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f8c3eda..eb9c68ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,7 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed -- +- Django templates for email and user guide () ### Security diff --git a/cvat-core/.eslintrc.js b/cvat-core/.eslintrc.js index 1b300300..5d883037 100644 --- a/cvat-core/.eslintrc.js +++ b/cvat-core/.eslintrc.js @@ -4,12 +4,9 @@ module.exports = { env: { - amd: true, - node: false, + node: true, browser: true, es6: true, - jquery: true, - qunit: true, 'jest/globals': true, }, parserOptions: { @@ -17,7 +14,7 @@ module.exports = { sourceType: 'module', ecmaVersion: 2018, }, - plugins: ['security', 'jest', 'no-unsanitized', 'no-unsafe-innerhtml'], + plugins: ['security', 'jest', 'no-unsafe-innerhtml'], extends: ['eslint:recommended', 'plugin:security/recommended', 'plugin:no-unsanitized/DOM', 'airbnb-base'], rules: { 'no-await-in-loop': [0], diff --git a/cvat-core/package-lock.json b/cvat-core/package-lock.json index dd367461..52e1e138 100644 --- a/cvat-core/package-lock.json +++ b/cvat-core/package-lock.json @@ -2822,6 +2822,10 @@ }, "cvat-data": { "version": "file:../cvat-data", + "requires": { + "async-mutex": "^0.2.4", + "jszip": "3.5.0" + }, "dependencies": { "@babel/cli": { "version": "7.6.4", @@ -3932,9 +3936,19 @@ "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==" }, "async-mutex": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/async-mutex/-/async-mutex-0.1.4.tgz", - "integrity": "sha512-zVWTmAnxxHaeB2B1te84oecI8zTDJ/8G49aVBblRX6be0oq6pAybNcUSxwfgVOmOjSCvN4aYZAqwtyNI8e1YGw==" + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/async-mutex/-/async-mutex-0.2.4.tgz", + "integrity": "sha512-fcQKOXUKMQc57JlmjBCHtkKNrfGpHyR7vu18RfuLfeTAf4hK9PgOadPR5cDrBQ682zasrLUhJFe7EKAHJOduDg==", + "requires": { + "tslib": "^2.0.0" + }, + "dependencies": { + "tslib": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.3.tgz", + "integrity": "sha512-uZtkfKblCEQtZKBF6EBXVZeQNl82yqtDQdv+eck8u7tdPxjLu2/lp5/uPW+um2tpuxINHWy3GhiccY7QgEaVHQ==" + } + } }, "atob": { "version": "2.1.2", @@ -5068,11 +5082,6 @@ "event-emitter": "~0.3.5" } }, - "es6-promise": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.0.2.tgz", - "integrity": "sha1-AQ1YWEI6XxGJeWZfRkhqlcbuK7Y=" - }, "es6-set": { "version": "0.1.5", "resolved": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.5.tgz", @@ -6781,22 +6790,14 @@ "integrity": "sha1-T9kss04OnbPInIYi7PUfm5eMbLk=" }, "jszip": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.1.5.tgz", - "integrity": "sha512-5W8NUaFRFRqTOL7ZDDrx5qWHJyBXy6velVudIzQUSoqAAYqzSh2Z7/m0Rf1QbmQJccegD0r+YZxBjzqoBiEeJQ==", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.5.0.tgz", + "integrity": "sha512-WRtu7TPCmYePR1nazfrtuF216cIVon/3GWOvHS9QR5bIwSbnxtdpma6un3jyGGNhHsKCSzn5Ypk+EkDRvTGiFA==", "requires": { - "core-js": "~2.3.0", - "es6-promise": "~3.0.2", - "lie": "~3.1.0", + "lie": "~3.3.0", "pako": "~1.0.2", - "readable-stream": "~2.0.6" - }, - "dependencies": { - "core-js": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.3.0.tgz", - "integrity": "sha1-+rg/uwstjchfpjbEudNMdUIMbWU=" - } + "readable-stream": "~2.3.6", + "set-immediate-shim": "~1.0.1" } }, "kind-of": { @@ -6822,9 +6823,9 @@ } }, "lie": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/lie/-/lie-3.1.1.tgz", - "integrity": "sha1-mkNrLMd0bKWd56QfpGmz77dr2H4=", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz", + "integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==", "requires": { "immediate": "~3.0.5" } @@ -7699,9 +7700,9 @@ "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=" }, "process-nextick-args": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", - "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=" + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" }, "progress": { "version": "2.0.3", @@ -7891,15 +7892,16 @@ } }, "readable-stream": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", - "integrity": "sha1-j5A0HmilPMySh4jaz80Rs265t44=", + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", "requires": { "core-util-is": "~1.0.0", - "inherits": "~2.0.1", + "inherits": "~2.0.3", "isarray": "~1.0.0", - "process-nextick-args": "~1.0.6", - "string_decoder": "~0.10.x", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", "util-deprecate": "~1.0.1" } }, @@ -8243,6 +8245,11 @@ "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" }, + "set-immediate-shim": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", + "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=" + }, "set-value": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", @@ -8620,9 +8627,12 @@ } }, "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } }, "strip-ansi": { "version": "3.0.1", diff --git a/cvat/apps/authentication/templates/account/email/email_confirmation_signup_message.html b/cvat/apps/authentication/templates/account/email/email_confirmation_signup_message.html index c121b810..ec80776a 100644 --- a/cvat/apps/authentication/templates/account/email/email_confirmation_signup_message.html +++ b/cvat/apps/authentication/templates/account/email/email_confirmation_signup_message.html @@ -1,5 +1,6 @@ -{% load account %}{% user_display user as user_display %}{% load i18n %}{% autoescape off %}{% blocktrans with -site_name=current_site.name site_domain=current_site.domain %}Hello from {{ site_name }}! +{% load account %}{% user_display user as user_display %}{% load i18n %}{% autoescape off %} +{% blocktrans with site_name=current_site.name site_domain=current_site.domain %} +Hello from {{ site_name }}!

You're receiving this e-mail because user {{ user_display }} has given yours as an e-mail address @@ -7,6 +8,7 @@ site_name=current_site.name site_domain=current_site.domain %}Hello from {{ site

To confirm this is correct, go to {{ activate_url }}

-{% endblocktrans %} {% blocktrans with site_name=current_site.name site_domain=current_site.domain %} +{% endblocktrans %} +{% blocktrans with site_name=current_site.name site_domain=current_site.domain %} {{ site_domain }} {% endblocktrans %} {% endautoescape %} diff --git a/cvat/apps/authentication/templates/authentication/password_reset_email.html b/cvat/apps/authentication/templates/authentication/password_reset_email.html index e2c68db1..fa3eef8b 100644 --- a/cvat/apps/authentication/templates/authentication/password_reset_email.html +++ b/cvat/apps/authentication/templates/authentication/password_reset_email.html @@ -1,5 +1,16 @@ -{% load i18n %}{% autoescape off %} {% blocktrans %}You're receiving this email because you requested a password reset -for your user account at {{ site_name }}.{% endblocktrans %} {% trans "Please go to the following page and choose a new -password:" %} {% block reset_link %} {{ protocol }}://{{ domain }}/auth/password/reset/confirm?uid={{ uid }}&token={{ -token }} {% endblock %} {% trans "Your username, in case you've forgotten:" %} {{ user.get_username }} {% trans "Thanks -for using our site!" %} {% blocktrans %}The {{ site_name }} team{% endblocktrans %} {% endautoescape %} +{% load i18n %}{% autoescape off %} +{% blocktrans %} +You're receiving this email because you requested a password reset for your user account at {{ site_name }}. +{% endblocktrans %} + +{% trans "Please go to the following page and choose a new password:" %} +{% block reset_link %} +{{ protocol }}://{{ domain }}/auth/password/reset/confirm?uid={{ uid }}&token={{ token }} +{% endblock %} +{% trans "Your username, in case you've forgotten:" %} {{ user.get_username }} + +{% trans "Thanks for using our site!" %} + +{% blocktrans %}The {{ site_name }} team{% endblocktrans %} + +{% endautoescape %} diff --git a/cvat/apps/documentation/templates/documentation/base_page.html b/cvat/apps/documentation/templates/documentation/base_page.html index be127111..f49fe5f1 100644 --- a/cvat/apps/documentation/templates/documentation/base_page.html +++ b/cvat/apps/documentation/templates/documentation/base_page.html @@ -1,5 +1,5 @@ @@ -15,8 +15,7 @@ -