This is an automated email from the git hooks/post-receive script. New commit to branch feature/pollen-riot-js in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit b0e0ac1cca44ba5c2f8704e618d1b1ad425b1db9 Author: Tony CHEMIT <dev@tchemit.fr> Date: Sat Jan 14 14:41:39 2017 +0100 Amélioration i18n + utilisation base par défaut sinon certaines pages ne sont pas accessibles en direct --- pollen-ui-riot-js/src/main/web/i18n.json | 186 ++++++++++----------- pollen-ui-riot-js/src/main/web/index.js | 1 - pollen-ui-riot-js/src/main/web/js/I18nHelper.js | 48 ++---- pollen-ui-riot-js/src/main/web/tag/CreatePoll.tag | 1 + pollen-ui-riot-js/src/main/web/tag/Footer.tag | 10 +- pollen-ui-riot-js/src/main/web/tag/Header.tag | 17 +- pollen-ui-riot-js/src/main/web/tag/HeaderI18n.tag | 2 +- pollen-ui-riot-js/src/main/web/tag/Home.tag | 6 +- .../src/main/web/tag/PollDescription.tag | 2 +- pollen-ui-riot-js/src/main/web/tag/Pollen.tag | 7 +- pollen-ui-riot-js/src/main/web/tag/SignCheck.tag | 82 ++++++++- pollen-ui-riot-js/src/main/web/tag/SignIn.tag | 16 +- pollen-ui-riot-js/src/main/web/tag/SignUp.tag | 18 +- .../src/main/web/tag/popup/AccountCreated.tag | 10 +- .../src/main/web/tag/popup/NewPassword.tag | 10 +- .../src/main/web/tag/popup/ResendValidation.tag | 10 +- 16 files changed, 245 insertions(+), 181 deletions(-) diff --git a/pollen-ui-riot-js/src/main/web/i18n.json b/pollen-ui-riot-js/src/main/web/i18n.json index afaac9b..8a82321 100644 --- a/pollen-ui-riot-js/src/main/web/i18n.json +++ b/pollen-ui-riot-js/src/main/web/i18n.json @@ -1,102 +1,100 @@ { "fr": { - "signup.title": "Créer un compte", - "signup.email": "Email", - "signup.email.placeholder": "Entrer l'email", - "signup.name": "Nom", - "signup.name.placeholder": "Entrer votre nom d'utilisateur", - "signup.validate": "Valider", - "signup.resendValidation": "Déja inscrit, mais compte non validé ?", - "signup.error": "Impossible d'enregister le compte.", - "signup.error.email": "L'adresse email est déjà utilisé pour un autre compte.", - "signup.createAccount.title": "Votre compte a bien été créé", - "signup.createAccount.description": "Un courriel vous a été envoyé avec vos identifiants ainsi que l'url de validation de votre compte.", - "signup.createAccount.validate": "Continuer", - "resendvalidation.title": "Renvoyer un courriel de validation de compte", - "resendvalidation.action": "Envoyer", - "resendvalidation.placeholder": "Entrer votre courriel", - "resendvalidation.sent": "Un nouveau courriel d'invitation a été envoyé", - "resendvalidation.error.emailNotFound": "Le courriel n'a pas été trouvé", - "signin.title": "Déjà membre ?", - "signin.login": "Email", - "signin.login.placeholder": "Entrer l'email", - "signin.password": "Mot de passe", - "signin.password.placeholder": "Entrer le mot de passe", - "signin.lostpassword": "Mot de passe perdu ?", - "signin.connexion": "Se connecter", - "signin.error.signin": "Courriel ou de mot de passe invalide", - "newpassword.title": "Obtenir un nouveau mot de passe", - "newpassword.action": "Envoyer", - "newpassword.placeholder": "Entrer votre courriel", - "newpassword.error.emailNotFound": "Le courriel n'a pas été trouvé", - "newpassword.sent": "Un nouveau mot de passe vient d'être envoyé", - "footer.doc": "Pollen 2.0", - "footer.download": "Télécharger", - "footer.contact": "Nous contacter", - "footer.participate": "Contribuer au projet", - "footer.license": "Licence", - "header.signin": "Vous connecter", - "header.signup": "Vous inscrire", - "header.signout": "Se déconnecter", - "header.home": "Accueil", - "header.i18n.lang": "Langue", - "header.myProfile": "Mon profile", - "header.myPolls": "Mes sondages", - "header.myFavoriteLists": "Mes listes de favoris", - "home.createTextPoll":"", - "home.createImagePoll":"", - "home.createDatePoll":"", - ".": "", + "signup_title": "Créer un compte", + "signup_email": "Email", + "signup_email_placeholder": "Entrer l'email", + "signup_name": "Nom", + "signup_name_placeholder": "Entrer votre nom d'utilisateur", + "signup_validate": "Valider", + "signup_resendValidation": "Déja inscrit, mais compte non validé ?", + "signup_error": "Impossible d'enregister le compte.", + "signup_error_email": "L'adresse email est déjà utilisé pour un autre compte.", + "createaccount_title": "Votre compte a bien été créé", + "createaccount_description": "Un courriel vous a été envoyé avec vos identifiants ainsi que l'url de validation de votre compte.", + "createaccount_action": "Continuer", + "resendvalidation_title": "Renvoyer un courriel de validation de compte", + "resendvalidation_action": "Envoyer", + "resendvalidation_placeholder": "Entrer votre courriel", + "resendvalidation_sent": "Un nouveau courriel d'invitation a été envoyé", + "resendvalidation_error_emailNotFound": "Le courriel n'a pas été trouvé", + "signin_title": "Déjà membre ?", + "signin_login": "Email", + "signin_login_placeholder": "Entrer l'email", + "signin_password": "Mot de passe", + "signin_password_placeholder": "Entrer le mot de passe", + "signin_lostpassword": "Mot de passe perdu ?", + "signin_connexion": "Se connecter", + "signin_error_signin": "Courriel ou de mot de passe invalide", + "newpassword_title": "Obtenir un nouveau mot de passe", + "newpassword_action": "Envoyer", + "newpassword_placeholder": "Entrer votre courriel", + "newpassword_error_emailNotFound": "Le courriel n'a pas été trouvé", + "newpassword_sent": "Un nouveau mot de passe vient d'être envoyé", + "footer_doc": "Pollen 2.0", + "footer_download": "Télécharger", + "footer_contact": "Nous contacter", + "footer_participate": "Contribuer au projet", + "footer_license": "Licence", + "header_signin": "Vous connecter", + "header_signup": "Vous inscrire", + "header_signout": "Se déconnecter", + "header_home": "Accueil", + "header_i18n_lang": "Langue", + "header_myProfile": "Mon profile", + "header_myPolls": "Mes sondages", + "header_myFavoriteLists": "Mes listes de favoris", + "home_createTextPoll": "Créer un sondage de type text", + "home_createImagePoll": "Créer un sondage de type image", + "home_createDatePoll": "Créer un sondage de type date", "": "" }, "en": { - "signup.title": "Create an account", - "signup.email": "Email", - "signup.email.placeholder": "Enter your email", - "signup.name": "User name", - "signup.name.placeholder": "Entrer your user name", - "signup.validate": "Create", - "signup.resendValidation": "Already member, but account never validated ?", - "signup.error": "Could not register account.", - "signup.error.email": "This email is already used.", - "signup.createAccount.title": "Your account was created", - "signup.createAccount.description": "We sent you an email with the account validation process and your authentication data.", - "signup.createAccount.validate": "Continue", - "resendvalidation.title": "Send another validation email", - "resendvalidation.action": "Send again", - "resendvalidation.sent": "A new invitation email was sent", - "resendvalidation.placeholder": "Fill your email", - "resendvalidation.error.emailNotFound": "Your email was not found", - "signin.title": "Already member?", - "signin.login": "Email", - "signin.login.placeholder": "Entrer your email", - "signin.password": "Password", - "signin.password.placeholder": "Entrer your password", - "signin.lostpassword": "Lost password?", - "signin.connexion": "Connect", - "signin.error.signin": "Email or password invalid", - "newpassword.placeholder": "Fill your email", - "newpassword.title": "Get a new password", - "newpassword.action": "Send password", - "newpassword.error.emailNotFound": "Your email was not found", - "newpassword.sent": "A new password was sent", - "footer.doc": "Pollen 2.0", - "footer.download": "Télécharger", - "footer.contact": "Nous contacter", - "footer.participate": "Contribuer au projet", - "footer.license": "Licence", - "header.signin": "SignIn", - "header.signup": "SignUp", - "header.signout": "Disconnect", - "header.home": "Home", - "header.i18n.lang": "Language", - "header.myProfile": "My profile", - "header.myPolls": "My polls", - "header.myFavoriteLists": "My favorite lists", - "home.createTextPoll":"Create a text poll", - "home.createImagePoll":"Create a image poll", - "home.createDatePoll":"Create a date poll", - ".": "", + "signup_title": "Create an account", + "signup_email": "Email", + "signup_email_placeholder": "Enter your email", + "signup_name": "User name", + "signup_name_placeholder": "Entrer your user name", + "signup_validate": "Create", + "signup_resendValidation": "Already member, but account never validated ?", + "signup_error": "Could not register account.", + "signup_error_email": "This email is already used.", + "createdaccount_title": "Your account was created", + "createdaccount_description": "We sent you an email with the account validation process and your authentication data.", + "createdaccount_action": "Continue", + "resendvalidation_title": "Send another validation email", + "resendvalidation_action": "Send again", + "resendvalidation_sent": "A new invitation email was sent", + "resendvalidation_placeholder": "Fill your email", + "resendvalidation_error_emailNotFound": "Your email was not found", + "signin_title": "Already member?", + "signin_login": "Email", + "signin_login_placeholder": "Entrer your email", + "signin_password": "Password", + "signin_password_placeholder": "Entrer your password", + "signin_lostpassword": "Lost password?", + "signin_connexion": "Connect", + "signin_error_signin": "Email or password invalid", + "newpassword_placeholder": "Fill your email", + "newpassword_title": "Get a new password", + "newpassword_action": "Send password", + "newpassword_error_emailNotFound": "Your email was not found", + "newpassword_sent": "A new password was sent", + "footer_doc": "Pollen 2.0", + "footer_download": "Download", + "footer_contact": "Contact us", + "footer_participate": "Get involved!", + "footer_license": "Licence", + "header_signin": "SignIn", + "header_signup": "SignUp", + "header_signout": "Disconnect", + "header_home": "Home", + "header_i18n_lang": "Language", + "header_myProfile": "My profile", + "header_myPolls": "My polls", + "header_myFavoriteLists": "My favorite lists", + "home_createTextPoll": "Create a text poll", + "home_createImagePoll": "Create a image poll", + "home_createDatePoll": "Create a date poll", "": "" } } \ No newline at end of file diff --git a/pollen-ui-riot-js/src/main/web/index.js b/pollen-ui-riot-js/src/main/web/index.js index 430ec69..d25dda0 100644 --- a/pollen-ui-riot-js/src/main/web/index.js +++ b/pollen-ui-riot-js/src/main/web/index.js @@ -9,5 +9,4 @@ require("./tag/Pollen.tag"); riot.mount("*"); let route = require("riot-route"); -route.base("/"); route.start(true); diff --git a/pollen-ui-riot-js/src/main/web/js/I18nHelper.js b/pollen-ui-riot-js/src/main/web/js/I18nHelper.js index a6de843..6d3143f 100644 --- a/pollen-ui-riot-js/src/main/web/js/I18nHelper.js +++ b/pollen-ui-riot-js/src/main/web/js/I18nHelper.js @@ -4,50 +4,30 @@ module.exports = { this.generateBundle(locale, value); emitter.onLocaleChanged((locale) => { this.generateBundle(locale, value); - this.update(); + try { + this.update(); + } catch (e) { + console.error("Error in generateBundle for " + value, e); + } }); }, generateBundle(locale, value) { - this.prefix = value; - - this.bundle = this.bundles[locale]; - Object.keys(this.bundle).forEach((key) => { - if (key.startsWith(value + ".")) { - - let path = key.split("."); - path.shift(); - let first = path.shift(); - this["__" + first] = this["__" + first] || {}; + let bundle = this.bundles[locale]; + this.__ = {}; + Object.keys(bundle).forEach((key) => { + if (key.startsWith(value + "_")) { - let last = path.pop(); - if (!last) { - let descriptor = Object.getOwnPropertyDescriptor(this, "__" + first + "__"); - if (!descriptor) { - Object.defineProperty(this, "__" + first + "__", {get: () => this.bundle[key]}); - } - - } else { - let v = path.reduce((a, b) => { - a[b] = a[b] || {}; - return a[b]; - }, this["__" + first]); - let descriptor = Object.getOwnPropertyDescriptor(v, last + "__"); - if (!descriptor) { - Object.defineProperty(v, last + "__", {get: () => this.bundle[key]}); - } - } + let realKey = key.substring(value.length + 1); + this.__[realKey] = bundle[key]; + console.info(realKey + " -> " + this.__[realKey]); } }); }, - t(key, ...params) { - return this.l(this.prefix + "." + key, ...params); - }, - - l(key, ...params) { - return this.format(this.bundle[key], params); + __(key, ...params) { + return this.format(__[key], ...params); }, format(value, params) { diff --git a/pollen-ui-riot-js/src/main/web/tag/CreatePoll.tag b/pollen-ui-riot-js/src/main/web/tag/CreatePoll.tag index 9806476..91a4d9a 100644 --- a/pollen-ui-riot-js/src/main/web/tag/CreatePoll.tag +++ b/pollen-ui-riot-js/src/main/web/tag/CreatePoll.tag @@ -40,6 +40,7 @@ require("./PollVoters.tag"); this.update() } catch (e) { //FIXME J'ai une erreur, mais je ne sais pas quoi en faire... + console.error("Could not update on Create poll: ", e); } }); </script> diff --git a/pollen-ui-riot-js/src/main/web/tag/Footer.tag b/pollen-ui-riot-js/src/main/web/tag/Footer.tag index 2a35b86..d514deb 100644 --- a/pollen-ui-riot-js/src/main/web/tag/Footer.tag +++ b/pollen-ui-riot-js/src/main/web/tag/Footer.tag @@ -2,11 +2,11 @@ let session = require("../js/Session"); let emitter = require("../js/EmitterService"); <footer> <div class="links"> - <a href="https://pollen.chorem.org/v/latest/index.html">{__doc__}</a> - <a href="https://forge.chorem.org/projects/pollen/files">{__download__}</a> - <a href="http://list.chorem.org/cgi-bin/mailman/listinfo/pollen-users">{__contact__}</a> - <a href="https://forge.chorem.org/projects/pollen">{__participate__}</a> - <a href="http://www.gnu.org/licenses/agpl.html">{__license__}</a> + <a href="https://pollen.chorem.org/v/latest/index.html">{__.doc}</a> + <a href="https://forge.chorem.org/projects/pollen/files">{__.download}</a> + <a href="http://list.chorem.org/cgi-bin/mailman/listinfo/pollen-users">{__.contact}</a> + <a href="https://forge.chorem.org/projects/pollen">{__.participate}</a> + <a href="http://www.gnu.org/licenses/agpl.html">{__.license}</a> <a href="http://www.codelutin.com/" target="_blank">Code Lutin</a> </div> <script> diff --git a/pollen-ui-riot-js/src/main/web/tag/Header.tag b/pollen-ui-riot-js/src/main/web/tag/Header.tag index 7da95ea..ff258f6 100644 --- a/pollen-ui-riot-js/src/main/web/tag/Header.tag +++ b/pollen-ui-riot-js/src/main/web/tag/Header.tag @@ -6,21 +6,21 @@ require("./HeaderI18n.tag"); <Header> <div class="header-home"> - <a class="header-link" href="/" target="_top">{__home__}</a> + <a class="header-link" href="#home" target="_top">{__.home}</a> </div> <div class="header-separator"></div> <div class="header-space"></div> - <a class="button header-button header-signin" if="{!user}" href="/signin">{__signin__}</a> + <a class="button header-button header-signin" if="{!user}" href="#signin">{__.signin}</a> - <a class="button header-button header-signup" if="{!user}" href="/signup">{__signup__}</a> + <a class="button header-button header-signup" if="{!user}" href="#signup">{__.signup}</a> <div if="{user}" class="dropdown"> <a class="header-link">{user.email}</a> <div class="dropdown-content"> - <a href="/user/profile">{__myProfile__}</a> - <a href="/user/polls">{__myPolls__}</a> - <a href="/user/favoriteLists">{__myFavoriteLists__}</a> + <a href="#user/profile">{__.myProfile}</a> + <a href="#user/polls">{__.myPolls}</a> + <a href="#user/favoriteLists">{__.myFavoriteLists}</a> <span role="separator" class="divider"></span> - <a onclick="{signOut}">{__signout__}</a> + <a onclick="{signOut}">{__.signout}</a> </div> </div> <div class="header-separator"></div> @@ -31,8 +31,7 @@ require("./HeaderI18n.tag"); this.signOut = () => { let callback = () => { this.user = null; - this.update(); - route("/"); + route("home"); }; authService.signOut().then(callback, callback); diff --git a/pollen-ui-riot-js/src/main/web/tag/HeaderI18n.tag b/pollen-ui-riot-js/src/main/web/tag/HeaderI18n.tag index 0a2b145..4c5bec2 100644 --- a/pollen-ui-riot-js/src/main/web/tag/HeaderI18n.tag +++ b/pollen-ui-riot-js/src/main/web/tag/HeaderI18n.tag @@ -15,7 +15,7 @@ let emitter = require("../js/EmitterService"); <script> this.locale = session.locale; //FIXME Le traduction ne se fait pas - this.generateBundle(session.locale, "header.i18n"); + this.generateBundle(session.locale, "header_i18n"); this.toEnglish = () => { if ('en' != session.locale) { session.locale = 'en'; diff --git a/pollen-ui-riot-js/src/main/web/tag/Home.tag b/pollen-ui-riot-js/src/main/web/tag/Home.tag index e007029..4fb2fbd 100644 --- a/pollen-ui-riot-js/src/main/web/tag/Home.tag +++ b/pollen-ui-riot-js/src/main/web/tag/Home.tag @@ -7,9 +7,9 @@ let route = require("riot-route"); <div class="body-container"> <div class="split"> - <div onclick="{createText}"><a href="/poll/new/text">Créer un sondage de type texte</a></div> - <div onclick="{createImage}"><a href="/poll/new/image">Créer un sondage de type image</a></div> - <div onclick="{createDate}"><a href="/poll/new/date">Créer un sondage de type date</a></div> + <div onclick="{createText}"><a href="/poll/new/text">{__.createTextPoll}</a></div> + <div onclick="{createImage}"><a href="/poll/new/image">{__.createImagePoll}</a></div> + <div onclick="{createDate}"><a href="/poll/new/date">{__.createDatePoll}</a></div> </div> </div> diff --git a/pollen-ui-riot-js/src/main/web/tag/PollDescription.tag b/pollen-ui-riot-js/src/main/web/tag/PollDescription.tag index a4d9020..82d5071 100644 --- a/pollen-ui-riot-js/src/main/web/tag/PollDescription.tag +++ b/pollen-ui-riot-js/src/main/web/tag/PollDescription.tag @@ -26,7 +26,7 @@ let route = require("riot-route"); form.nextStep(); }; this.cancel = () => { - route("/", null, true); + route("home", null, true); }; </script> <style> diff --git a/pollen-ui-riot-js/src/main/web/tag/Pollen.tag b/pollen-ui-riot-js/src/main/web/tag/Pollen.tag index e8c2b2a..f9100c5 100644 --- a/pollen-ui-riot-js/src/main/web/tag/Pollen.tag +++ b/pollen-ui-riot-js/src/main/web/tag/Pollen.tag @@ -25,8 +25,11 @@ let emitter = require("../js/EmitterService"); route("/signup", () => { riot.mount(this.refs.content, "signup"); }); + route("/signup/validate", () => { + riot.mount(this.refs.content, "signup", {validate: true}); + }); route("/signcheck/*/*", (id, token) => { - riot.mount(this.refs.content, "signcheck", {id, token}); + riot.mount(this.refs.content, "signcheck", {id: id, token: token}); }); route("/poll", () => { riot.mount(this.refs.content, "polls"); @@ -46,7 +49,7 @@ let emitter = require("../js/EmitterService"); route("/poll/new/*", (type) => { riot.mount(this.refs.content, "createpoll", {type: type}); }); - route(() => { + route( () => { riot.mount(this.refs.content, "home"); }); diff --git a/pollen-ui-riot-js/src/main/web/tag/SignCheck.tag b/pollen-ui-riot-js/src/main/web/tag/SignCheck.tag index 20e0b7a..b0daf05 100644 --- a/pollen-ui-riot-js/src/main/web/tag/SignCheck.tag +++ b/pollen-ui-riot-js/src/main/web/tag/SignCheck.tag @@ -5,13 +5,93 @@ let route = require("riot-route"); <SignCjeck> <div class="body-container"> - <%--TODO--%> + <div class="body-container"> + <form class="signcheck" method="post" onsubmit="{signIn}"> + <div class="split"> + <div class="legend"> + <i class="fa fa-user fa-3x"> </i>{__title__} + </div> + <div>{__message__}</div> + <br/> + <a class="button" href="/signin">{__signin__}</a> + <a class="button" href="/signup/validate">{__resendValidation__}</a> + + <div class="{error ? 'error' : 'info'}">{message}</div> + </div> + </form> + </div> + </div> <script> this.installBundle(session.locale, "signcheck", emitter); + this.message = "Votre compte est en cours de validation..."; + this.error = false; + authService.validateEmail(opts.id, opts.permission) + .then(() => { + this.message = "Votre compte a été validé"; + this.update(); + }) + .catch(() => { + this.error = true; + this.message = "Votre compte n'a pas pu être validé"; + this.update(); + }); + </script> + <style scoped> + + .wide { + width: 320px; + } + + .button { + margin: 5px 0; + } + + .signcheck { + display: flex; + justify-content: space-around; + background: white; + border: solid 2px #c8ccca; + padding: 45px 0; + border-radius: 10px; + text-align: center; + margin: 40px 0; + width: 400px; + } + + .legend { + width: 100%; + height: 70px; + border-bottom: 1px solid #b2c7d3; + display: flex; + justify-content: center; + align-items: center; + margin-bottom: 30px; + font-size: 20px; + } + + .split { + flex-grow: 1; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + } + + .info { + margin: 3px; + color: #13a2ff; + } + + .error { + margin: 3px; + color: red; + } + </style> + </SignCjeck> diff --git a/pollen-ui-riot-js/src/main/web/tag/SignIn.tag b/pollen-ui-riot-js/src/main/web/tag/SignIn.tag index b6f38ca..8460923 100644 --- a/pollen-ui-riot-js/src/main/web/tag/SignIn.tag +++ b/pollen-ui-riot-js/src/main/web/tag/SignIn.tag @@ -9,17 +9,17 @@ require("./popup/NewPassword.tag"); <form class="signin" method="post" onsubmit="{signIn}"> <div class="split"> <div class="legend"> - <i class="fa fa-user fa-3x"> </i>{__title__} + <i class="fa fa-user fa-3x"> </i>{__.title} </div> - <label class="wide" for="login">{__login__}</label> + <label class="wide" for="login">{__.login}</label> <input class="wide" type="text" id="login" name="login" ref="login" required - placeholder="{__login.placeholder__}"> - <label class="wide" for="password">{__password__}</label> + placeholder="{__.login_placeholder}"> + <label class="wide" for="password">{__.password}</label> <input class="wide" type="password" id="password" name="password" ref="password" required - placeholder="{__password.placeholder__}"> - <a onclick="{newPassword}">{__lostpassword__}</a> + placeholder="{__.password_placeholder}"> + <a onclick="{newPassword}">{__.lostpassword}</a> <br/> - <input type="submit" class="button" value="{__connexion__}"> + <input type="submit" class="button" value="{__.connexion}"> <div>{message}</div> </div> </form> @@ -46,7 +46,7 @@ require("./popup/NewPassword.tag"); route(this.opts.link || "/"); }) .catch((code) => { - this.message = this.t("error.signin"); + this.message = this.t("error_signin"); this.update(); }); }; diff --git a/pollen-ui-riot-js/src/main/web/tag/SignUp.tag b/pollen-ui-riot-js/src/main/web/tag/SignUp.tag index 0f88949..c704082 100644 --- a/pollen-ui-riot-js/src/main/web/tag/SignUp.tag +++ b/pollen-ui-riot-js/src/main/web/tag/SignUp.tag @@ -10,16 +10,16 @@ require("./popup/AccountCreated.tag"); <div class="body-container"> <form ref="user" class="signup" method="post" onsubmit="{signUp}"> <div class="split"> - <div class="legend"><i class="fa fa-user-plus fa-2x"> </i>{__title__}</div> - <label class="wide" for="name">{__name__}</label> + <div class="legend"><i class="fa fa-user-plus fa-2x"> </i>{__.title}</div> + <label class="wide" for="name">{__.name}</label> <div if="{errors.name}">{errors.name}</div> - <input class="wide" type="text" name="name" id="name" placeholder="{__name.placeholder__}" required> - <label class="wide" for="email">{__email__}</label> + <input class="wide" type="text" name="name" id="name" placeholder="{__.name_placeholder}" required> + <label class="wide" for="email">{__.email}</label> <div if="{errors.email}">{errors.email}</div> - <input class="wide" type="text" name="email" id="email" placeholder="{__email.placeholder__}" required> - <a onclick="{resendValidation}">{__resendValidation__}</a> + <input class="wide" type="text" name="email" id="email" placeholder="{__.email_placeholder}" required> + <a onclick="{resendValidation}">{__.resendValidation}</a> <br/> - <input type="submit" class="button" value="{__validate__}"> + <input type="submit" class="button" value="{__.validate}"> </div> </form> </div> @@ -53,6 +53,9 @@ require("./popup/AccountCreated.tag"); }); }; + if (opts.validate) { + this.resendValidation(); + } </script> <style scoped> @@ -87,6 +90,7 @@ require("./popup/AccountCreated.tag"); margin-bottom: 30px; font-size: 20px; } + .split { flex-grow: 1; display: flex; diff --git a/pollen-ui-riot-js/src/main/web/tag/popup/AccountCreated.tag b/pollen-ui-riot-js/src/main/web/tag/popup/AccountCreated.tag index 783db23..9a8b5ef 100644 --- a/pollen-ui-riot-js/src/main/web/tag/popup/AccountCreated.tag +++ b/pollen-ui-riot-js/src/main/web/tag/popup/AccountCreated.tag @@ -10,16 +10,16 @@ let route = require("riot-route"); <div class="popup-close" onclick="{close}"> <i class="fa fa-times"></i> </div> - <div class="popup-title">{__title__}</div> + <div class="popup-title">{__.title}</div> <div class="popup-message"> - <div>{__description__}</div> - <a class="button" onclick="{action}">Continuer</a> + <div>{__.description}</div> + <a class="button" onclick="{action}">{__.action}</a> </div> </div> <script> - this.installBundle(session.locale, "signin.createAccount", emitter); + this.installBundle(session.locale, "createdaccount", emitter); this.oldParent = this.parent.root; @@ -36,7 +36,7 @@ let route = require("riot-route"); }; this.action = () => { this.close(); - route("/home", null, true); + route("home", null, true); }; </script> diff --git a/pollen-ui-riot-js/src/main/web/tag/popup/NewPassword.tag b/pollen-ui-riot-js/src/main/web/tag/popup/NewPassword.tag index 6ff1515..af16ac7 100644 --- a/pollen-ui-riot-js/src/main/web/tag/popup/NewPassword.tag +++ b/pollen-ui-riot-js/src/main/web/tag/popup/NewPassword.tag @@ -10,14 +10,14 @@ let authService = require("../../js/AuthService"); <div class="popup-close" onclick="{close}"> <i class="fa fa-times"></i> </div> - <div class="popup-title">{__title__}</div> + <div class="popup-title">{__.title}</div> <form class="popup-message" onsubmit="{action}"> <div class="popup-message-header"> - <div class="send" if="{sent}"><i class="fa fa-envelope"></i> {__sent__}</div> + <div class="send" if="{sent}"><i class="fa fa-envelope"></i> {__.sent}</div> <div if="{error}" class="error">{error}</div> </div> - <input ref="email" type="text" required placeholder="{__placeholder__}"> - <input type="submit" class="button" value="{__action__}"> + <input ref="email" type="text" required placeholder="{__.placeholder}"> + <input type="submit" class="button" value="{__.action}"> </form> </div> @@ -58,7 +58,7 @@ let authService = require("../../js/AuthService"); this.update(); }) .catch(() => { - this.error = this.t("error.emailNotFound"); + this.error = __.error_emailNotFound; this.update(); }); } diff --git a/pollen-ui-riot-js/src/main/web/tag/popup/ResendValidation.tag b/pollen-ui-riot-js/src/main/web/tag/popup/ResendValidation.tag index 5174263..05bfdbf 100644 --- a/pollen-ui-riot-js/src/main/web/tag/popup/ResendValidation.tag +++ b/pollen-ui-riot-js/src/main/web/tag/popup/ResendValidation.tag @@ -10,14 +10,14 @@ let authService = require("../../js/AuthService"); <div class="popup-close" onclick="{close}"> <i class="fa fa-times"></i> </div> - <div class="popup-title">{__title__}</div> + <div class="popup-title">{__.title}</div> <form class="popup-message" onsubmit="{action}"> <div class="popup-message-header"> - <div class="send" if="{sent}"><i class="fa fa-envelope"></i> {__sent__}</div> + <div class="send" if="{sent}"><i class="fa fa-envelope"></i> {__.sent}</div> <div if="{error}" class="error">{error}</div> </div> - <input ref="email" type="text" required placeholder="{__placeholder__}"> - <input type="submit" class="button" value="{__action__}"> + <input ref="email" type="text" required placeholder="{__.placeholder}"> + <input type="submit" class="button" value="{__.action}"> </form> </div> @@ -58,7 +58,7 @@ let authService = require("../../js/AuthService"); this.update(); }) .catch(() => { - this.error = this.t("error.emailNotFound"); + this.error = __.error_emailNotFound; this.update(); }); } -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.