diff --git a/Phraseanet-production-client/config/config.js b/Phraseanet-production-client/config/config.js index e258c6a2af..a8eed31cae 100644 --- a/Phraseanet-production-client/config/config.js +++ b/Phraseanet-production-client/config/config.js @@ -13,5 +13,5 @@ module.exports = { setupDir: _root + 'tests/setup/node.js', karmaConf: _root + 'config/karma.conf.js', // change this version when you change JS file for lazy loading - assetFileVersion: 101 + assetFileVersion: 102 }; diff --git a/Phraseanet-production-client/dist/authenticate.js b/Phraseanet-production-client/dist/authenticate.js index eb659f68ef..f92ba6b92e 100644 --- a/Phraseanet-production-client/dist/authenticate.js +++ b/Phraseanet-production-client/dist/authenticate.js @@ -96,7 +96,7 @@ return /******/ (function(modules) { // webpackBootstrap /******/ if (__webpack_require__.nc) { /******/ script.setAttribute("nonce", __webpack_require__.nc); /******/ } -/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".js?v=101"; +/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".js?v=102"; /******/ var timeout = setTimeout(onScriptComplete, 120000); /******/ script.onerror = script.onload = onScriptComplete; /******/ function onScriptComplete() { @@ -4558,7 +4558,7 @@ var ErrorView = _backbone2.default.View.extend({ }, render: function render() { if (this.errors.length > 0) { - var template = _underscore2.default.template((0, _jquery2.default)(this.errorTemplate).html(), { + var template = _underscore2.default.template((0, _jquery2.default)(this.errorTemplate).html())({ errors: this.errors }); @@ -4740,10 +4740,7 @@ var renewPassword = function renewPassword(services) { }, { name: 'password[password]', rules: 'min_length[5]', - message: localeService.t('validation_length_min', { - postProcess: 'sprintf', - sprintf: ['5'] - }) + message: localeService.t('validation_length_min') }, { name: 'password[confirm]', rules: 'matches[password[password]]', @@ -4828,10 +4825,7 @@ var regiser = function regiser(services) { }, { name: 'password[password]', rules: 'min_length[5]', - message: localeService.t('validation_length_min', { - postProcess: 'sprintf', - sprintf: ['5'] - }) + message: localeService.t('validation_length_min') }, { name: 'password[confirm]', rules: 'matches[password[password]]', @@ -4844,10 +4838,7 @@ var regiser = function regiser(services) { }, { name: 'collections[]', rules: 'min_length[1]', - message: localeService.t('validation_choice_min', { - postProcess: 'sprintf', - sprintf: ['1'] - }), + message: localeService.t('validation_choice_min'), type: 'multiple' }]; @@ -4964,10 +4955,7 @@ var registerProvider = function registerProvider(services) { }, { name: 'password', rules: 'min_length[5]', - message: localeService.t('validation_length_min', { - postProcess: 'sprintf', - sprintf: ['5'] - }) + message: localeService.t('validation_length_min') }, { name: 'passwordConfirm', rules: 'matches[password]', @@ -4980,10 +4968,7 @@ var registerProvider = function registerProvider(services) { }, { name: 'collections[]', rules: 'min_length[1]', - message: localeService.t('validation_choice_min', { - postProcess: 'sprintf', - sprintf: ['1'] - }), + message: localeService.t('validation_choice_min'), type: 'multiple' }]; @@ -5317,10 +5302,7 @@ var changePassword = function changePassword(services) { }, { name: 'password[password]', rules: 'min_length[5]', - message: localeService.t('validation_length_min', { - postProcess: 'sprintf', - sprintf: ['5'] - }) + message: localeService.t('validation_length_min') }, { name: 'password[confirm]', rules: 'matches[password[password]]', diff --git a/Phraseanet-production-client/dist/authenticate.min.js b/Phraseanet-production-client/dist/authenticate.min.js index d23bbfe33f..f82548d9ce 100644 --- a/Phraseanet-production-client/dist/authenticate.min.js +++ b/Phraseanet-production-client/dist/authenticate.min.js @@ -96,7 +96,7 @@ return /******/ (function(modules) { // webpackBootstrap /******/ if (__webpack_require__.nc) { /******/ script.setAttribute("nonce", __webpack_require__.nc); /******/ } -/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".min.js?v=101"; +/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".min.js?v=102"; /******/ var timeout = setTimeout(onScriptComplete, 120000); /******/ script.onerror = script.onload = onScriptComplete; /******/ function onScriptComplete() { @@ -4558,7 +4558,7 @@ var ErrorView = _backbone2.default.View.extend({ }, render: function render() { if (this.errors.length > 0) { - var template = _underscore2.default.template((0, _jquery2.default)(this.errorTemplate).html(), { + var template = _underscore2.default.template((0, _jquery2.default)(this.errorTemplate).html())({ errors: this.errors }); @@ -4740,10 +4740,7 @@ var renewPassword = function renewPassword(services) { }, { name: 'password[password]', rules: 'min_length[5]', - message: localeService.t('validation_length_min', { - postProcess: 'sprintf', - sprintf: ['5'] - }) + message: localeService.t('validation_length_min') }, { name: 'password[confirm]', rules: 'matches[password[password]]', @@ -4828,10 +4825,7 @@ var regiser = function regiser(services) { }, { name: 'password[password]', rules: 'min_length[5]', - message: localeService.t('validation_length_min', { - postProcess: 'sprintf', - sprintf: ['5'] - }) + message: localeService.t('validation_length_min') }, { name: 'password[confirm]', rules: 'matches[password[password]]', @@ -4844,10 +4838,7 @@ var regiser = function regiser(services) { }, { name: 'collections[]', rules: 'min_length[1]', - message: localeService.t('validation_choice_min', { - postProcess: 'sprintf', - sprintf: ['1'] - }), + message: localeService.t('validation_choice_min'), type: 'multiple' }]; @@ -4964,10 +4955,7 @@ var registerProvider = function registerProvider(services) { }, { name: 'password', rules: 'min_length[5]', - message: localeService.t('validation_length_min', { - postProcess: 'sprintf', - sprintf: ['5'] - }) + message: localeService.t('validation_length_min') }, { name: 'passwordConfirm', rules: 'matches[password]', @@ -4980,10 +4968,7 @@ var registerProvider = function registerProvider(services) { }, { name: 'collections[]', rules: 'min_length[1]', - message: localeService.t('validation_choice_min', { - postProcess: 'sprintf', - sprintf: ['1'] - }), + message: localeService.t('validation_choice_min'), type: 'multiple' }]; @@ -5317,10 +5302,7 @@ var changePassword = function changePassword(services) { }, { name: 'password[password]', rules: 'min_length[5]', - message: localeService.t('validation_length_min', { - postProcess: 'sprintf', - sprintf: ['5'] - }) + message: localeService.t('validation_length_min') }, { name: 'password[confirm]', rules: 'matches[password[password]]', diff --git a/Phraseanet-production-client/dist/commons.js b/Phraseanet-production-client/dist/commons.js index c7b67d1dbb..a2dec26d2d 100644 --- a/Phraseanet-production-client/dist/commons.js +++ b/Phraseanet-production-client/dist/commons.js @@ -91,7 +91,7 @@ /******/ if (__webpack_require__.nc) { /******/ script.setAttribute("nonce", __webpack_require__.nc); /******/ } -/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".js?v=101"; +/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".js?v=102"; /******/ var timeout = setTimeout(onScriptComplete, 120000); /******/ script.onerror = script.onload = onScriptComplete; /******/ function onScriptComplete() { diff --git a/Phraseanet-production-client/dist/commons.min.js b/Phraseanet-production-client/dist/commons.min.js index 19822460a6..0954abe988 100644 --- a/Phraseanet-production-client/dist/commons.min.js +++ b/Phraseanet-production-client/dist/commons.min.js @@ -91,7 +91,7 @@ /******/ if (__webpack_require__.nc) { /******/ script.setAttribute("nonce", __webpack_require__.nc); /******/ } -/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".min.js?v=101"; +/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".min.js?v=102"; /******/ var timeout = setTimeout(onScriptComplete, 120000); /******/ script.onerror = script.onload = onScriptComplete; /******/ function onScriptComplete() { diff --git a/Phraseanet-production-client/src/components/authentication/changePassword.js b/Phraseanet-production-client/src/components/authentication/changePassword.js index 1d0e53496a..4a08abd3f7 100644 --- a/Phraseanet-production-client/src/components/authentication/changePassword.js +++ b/Phraseanet-production-client/src/components/authentication/changePassword.js @@ -33,10 +33,7 @@ const changePassword = (services) => { { name: 'password[password]', rules: 'min_length[5]', - message: localeService.t('validation_length_min', { - postProcess: 'sprintf', - sprintf: ['5'] - }) + message: localeService.t('validation_length_min') }, { name: 'password[confirm]', diff --git a/Phraseanet-production-client/src/components/authentication/common/forms/views/error.js b/Phraseanet-production-client/src/components/authentication/common/forms/views/error.js index d69566f375..7edbaa2818 100644 --- a/Phraseanet-production-client/src/components/authentication/common/forms/views/error.js +++ b/Phraseanet-production-client/src/components/authentication/common/forms/views/error.js @@ -31,7 +31,7 @@ var ErrorView = Backbone.View.extend({ }, render: function () { if (this.errors.length > 0) { - var template = _.template($(this.errorTemplate).html(), { + var template = _.template($(this.errorTemplate).html())({ errors: this.errors }); diff --git a/Phraseanet-production-client/src/components/authentication/register.js b/Phraseanet-production-client/src/components/authentication/register.js index 0cdc205fd1..688957f43b 100644 --- a/Phraseanet-production-client/src/components/authentication/register.js +++ b/Phraseanet-production-client/src/components/authentication/register.js @@ -47,10 +47,7 @@ const regiser = (services) => { { name: 'password[password]', rules: 'min_length[5]', - message: localeService.t('validation_length_min', { - postProcess: 'sprintf', - sprintf: ['5'] - }) + message: localeService.t('validation_length_min') }, { name: 'password[confirm]', @@ -66,10 +63,7 @@ const regiser = (services) => { { name: 'collections[]', rules: 'min_length[1]', - message: localeService.t('validation_choice_min', { - postProcess: 'sprintf', - sprintf: ['1'] - }), + message: localeService.t('validation_choice_min'), type: 'multiple' } ]; diff --git a/Phraseanet-production-client/src/components/authentication/registerProvider.js b/Phraseanet-production-client/src/components/authentication/registerProvider.js index f7de8a800b..9f183a9bb8 100644 --- a/Phraseanet-production-client/src/components/authentication/registerProvider.js +++ b/Phraseanet-production-client/src/components/authentication/registerProvider.js @@ -46,10 +46,7 @@ const registerProvider = (services) => { { name: 'password', rules: 'min_length[5]', - message: localeService.t('validation_length_min', { - postProcess: 'sprintf', - sprintf: ['5'] - }) + message: localeService.t('validation_length_min') }, { name: 'passwordConfirm', @@ -65,10 +62,7 @@ const registerProvider = (services) => { { name: 'collections[]', rules: 'min_length[1]', - message: localeService.t('validation_choice_min', { - postProcess: 'sprintf', - sprintf: ['1'] - }), + message: localeService.t('validation_choice_min'), type: 'multiple' } ]; diff --git a/Phraseanet-production-client/src/components/authentication/renewPassword.js b/Phraseanet-production-client/src/components/authentication/renewPassword.js index a4bce35925..038731c460 100644 --- a/Phraseanet-production-client/src/components/authentication/renewPassword.js +++ b/Phraseanet-production-client/src/components/authentication/renewPassword.js @@ -28,10 +28,7 @@ const renewPassword = (services) => { { name: 'password[password]', rules: 'min_length[5]', - message: localeService.t('validation_length_min', { - postProcess: 'sprintf', - sprintf: ['5'] - }) + message: localeService.t('validation_length_min') }, { name: 'password[confirm]', diff --git a/lib/Alchemy/Phrasea/Controller/Root/LoginController.php b/lib/Alchemy/Phrasea/Controller/Root/LoginController.php index e437aa18ec..92eb0afbdf 100644 --- a/lib/Alchemy/Phrasea/Controller/Root/LoginController.php +++ b/lib/Alchemy/Phrasea/Controller/Root/LoginController.php @@ -137,10 +137,10 @@ class LoginController extends Controller { $response = $this->app->json([ 'validation_blank' => $this->app->trans('Please provide a value.'), - 'validation_choice_min' => $this->app->trans('Please select at least %s choice.'), + 'validation_choice_min' => $this->app->trans('Please select at least %s choice.', ['%s' => 1]), 'validation_email' => $this->app->trans('Please provide a valid email address.'), 'validation_ip' => $this->app->trans('Please provide a valid IP address.'), - 'validation_length_min' => $this->app->trans('Please provide a longer value. It should have %s character or more.'), + 'validation_length_min' => $this->app->trans('Please provide a longer value. It should have %s character or more.', ['%s' => 5]), 'password_match' => $this->app->trans('Please provide the same passwords.'), 'email_match' => $this->app->trans('Please provide the same emails.'), 'accept_tou' => $this->app->trans('Please accept the terms of use to register.'), diff --git a/lib/Alchemy/Phrasea/Twig/PhraseanetExtension.php b/lib/Alchemy/Phrasea/Twig/PhraseanetExtension.php index d0ed4749fc..2447a8211d 100644 --- a/lib/Alchemy/Phrasea/Twig/PhraseanetExtension.php +++ b/lib/Alchemy/Phrasea/Twig/PhraseanetExtension.php @@ -62,7 +62,7 @@ class PhraseanetExtension extends \Twig_Extension { return [ // change this version when you change JS file to force the navigation to reload js file - 'assetFileVersion' => 101 + 'assetFileVersion' => 102 ]; } diff --git a/templates/web/account/change-password.html.twig b/templates/web/account/change-password.html.twig index 3a285d5a4d..8686ee08bf 100644 --- a/templates/web/account/change-password.html.twig +++ b/templates/web/account/change-password.html.twig @@ -62,7 +62,7 @@ // adapted from http://friendlybit.com/js/lazy-loading-asyncronous-javascript/ (function() { - var ZXCVBN_SRC = 'assets/vendors/zxcvbn/zxcvbn{% if not app.debug %}.min{% endif %}.js'; + var ZXCVBN_SRC = '/assets/vendors/zxcvbn/zxcvbn{% if not app.debug %}.min{% endif %}.js'; var async_load = function() { var first, s; diff --git a/www/scripts/common/forms/views/error.js b/www/scripts/common/forms/views/error.js index 95143bd577..707979ca37 100644 --- a/www/scripts/common/forms/views/error.js +++ b/www/scripts/common/forms/views/error.js @@ -33,7 +33,7 @@ define([ }, render: function () { if (this.errors.length > 0) { - var template = _.template($(this.errorTemplate).html(), { + var template = _.template($(this.errorTemplate).html())({ errors: this.errors });