This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit 44f306a84021fcccef32d8c34ccf219c735fa32b Author: Kevin Morin <morin@codelutin.com> Date: Tue Apr 25 18:18:02 2017 +0200 fixes #53 Set page titles --- pollen-ui-riot-js/src/main/web/i18n.json | 26 ++++++++++++++++ pollen-ui-riot-js/src/main/web/tag/Pollen.tag.html | 36 ++++++++++++++++++++-- .../src/main/web/tag/poll/Poll.tag.html | 1 + 3 files changed, 61 insertions(+), 2 deletions(-) diff --git a/pollen-ui-riot-js/src/main/web/i18n.json b/pollen-ui-riot-js/src/main/web/i18n.json index e99ce24..d29d150 100644 --- a/pollen-ui-riot-js/src/main/web/i18n.json +++ b/pollen-ui-riot-js/src/main/web/i18n.json @@ -1,5 +1,18 @@ { "fr": { + "main_pollen_title": "Pollen - ", + "main_home" : "Application de sondage", + "main_signup" : "Inscription", + "main_signcheck" : "Validation du compte", + "main_createdPolls" : "Mes sondages", + "main_invitedPolls" : "Mes invitations", + "main_participatedPolls" : "Mes participations", + "main_admin_polls" : "Tous les sondages", + "main_admin_users" : "Les utilisateurs", + "main_newPoll" : "Nouveau sondage", + "main_editPoll" : "Edition du sondage", + "main_userProfile" : "Mon profil", + "main_favoriteLists" : "Listes de favoris", "pagination_all": "Tous", "pagination_resultsPerPage": "Résultats par page", "poll_403": "Erreur : le sondage n'est pas accessible", @@ -377,6 +390,19 @@ "error_manager_500": "Erreur : Service indisponible" }, "en": { + "main_pollen_title": "Pollen - ", + "main_home" : "Poll app", + "main_signup" : "Registration", + "main_signcheck" : "Account validation", + "main_createdPolls" : "My polls", + "main_invitedPolls" : "My invitations", + "main_participatedPolls" : "My participations", + "main_admin_polls" : "All the polls", + "main_admin_users" : "The users", + "main_newPoll" : "New poll", + "main_editPoll" : "Poll edition", + "main_userProfile" : "My profile", + "main_favoriteLists" : "List of favorites", "pagination_all": "All", "pagination_resultsPerPage": "Results per page", "poll_403": "Error : the poll is not available", diff --git a/pollen-ui-riot-js/src/main/web/tag/Pollen.tag.html b/pollen-ui-riot-js/src/main/web/tag/Pollen.tag.html index 86db6ba..659759c 100644 --- a/pollen-ui-riot-js/src/main/web/tag/Pollen.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/Pollen.tag.html @@ -50,6 +50,21 @@ require("./favoriteList/FavoriteList.tag.html"); let session = require("../js/Session"); session.start(); this.installBundle(session, "main"); + this.pageTitle = undefined; + + this.onLocaleChange = (locale) => { + this.updatePageTitle(); + this.showInfoMessages(locale); + }; + + this.updatePageTitle = () => { + document.title = this._l("pollen_title") + this._l(this.pageTitle); + }; + + this.bus.on("pageChanged", (title) => { + this.pageTitle = title; + this.updatePageTitle(); + }); this.showInfoMessages = (locale) => { var infoMessages = session.configuration.infoMessages; @@ -67,25 +82,29 @@ require("./favoriteList/FavoriteList.tag.html"); this.on("mount", () => { this.showInfoMessages(session.locale); - this.bus.on("locale", this.showInfoMessages); + this.bus.on("locale", this.onLocaleChange); }); this.on("before-unmount", () => { - this.bus.off("locale", this.showInfoMessages); + this.bus.off("locale", this.onLocaleChange); }); let route = require("riot-route"); route("/poll/create", () => { + this.bus.trigger("pageChanged", "home"); riot.mount(this.refs.content, "createpoll"); }); route("/signup", () => { + this.bus.trigger("pageChanged", "signup"); riot.mount(this.refs.content, "signup"); }); route("/signup/validate", () => { + this.bus.trigger("pageChanged", "signup"); riot.mount(this.refs.content, "signup", {validate: true}); }); route("/signcheck/*/*", (userId, token) => { + this.bus.trigger("pageChanged", "signcheck"); riot.mount(this.refs.content, "signcheck", {userId: userId, token: token}); }); @@ -93,6 +112,7 @@ require("./favoriteList/FavoriteList.tag.html"); if (!session.isConnected()) { route("/signin?url=/poll/created"); } else { + this.bus.trigger("pageChanged", "createdPolls"); riot.mount(this.refs.content, "polls", {method: "createdPolls", session: session}); } }); @@ -101,6 +121,7 @@ require("./favoriteList/FavoriteList.tag.html"); if (!session.isConnected()) { route("/signin?url=/poll/invited"); } else { + this.bus.trigger("pageChanged", "invitedPolls"); riot.mount(this.refs.content, "polls", {method: "invitedPolls", session: session}); } }); @@ -109,6 +130,7 @@ require("./favoriteList/FavoriteList.tag.html"); if (!session.isConnected()) { route("/signin?url=/poll/participated"); } else { + this.bus.trigger("pageChanged", "participatedPolls"); riot.mount(this.refs.content, "polls", {method: "participatedPolls", session: session}); } }); @@ -117,6 +139,7 @@ require("./favoriteList/FavoriteList.tag.html"); if (!session.isConnected() && !session.getUser.administrator) { route("/signin?url=/poll"); } else { + this.bus.trigger("pageChanged", "admin_polls"); riot.mount(this.refs.content, "polls", {method: "polls", session: session}); } }); @@ -125,6 +148,7 @@ require("./favoriteList/FavoriteList.tag.html"); if (!session.isConnected() && !session.getUser.administrator) { route("/signin?url=/user"); } else { + this.bus.trigger("pageChanged", "admin_users"); riot.mount(this.refs.content, "users", {session: session}); } }); @@ -163,12 +187,15 @@ require("./favoriteList/FavoriteList.tag.html"); riot.mount(this.refs.content, "poll", {pollId: pollId, tabName: "settings", permission: permission}); }); route("/poll/new/*", (choiceType) => { + this.bus.trigger("pageChanged", "newPoll"); riot.mount(this.refs.content, "editpoll", {choiceType: choiceType.toUpperCase()}); }); route("/poll/*/edit/*", (pollId, permission) => { + this.bus.trigger("pageChanged", "editPoll"); riot.mount(this.refs.content, "editpoll", {pollId: pollId, permission: permission}); }); route("/poll/*/clone/*", (pollId, permission) => { + this.bus.trigger("pageChanged", "editPoll"); riot.mount(this.refs.content, "editpoll", {pollId: pollId, permission: permission, clone: true}); }); route("/poll/*", (pollId) => { @@ -180,19 +207,24 @@ require("./favoriteList/FavoriteList.tag.html"); }); route("/user/profile", () => { + this.bus.trigger("pageChanged", "userProfile"); riot.mount(this.refs.content, "userprofile"); }); route("/favoriteLists", () => { + this.bus.trigger("pageChanged", "favoriteLists"); riot.mount(this.refs.content, "favoritelists"); }); route("/favoriteLists/new", () => { + this.bus.trigger("pageChanged", "favoriteLists"); riot.mount(this.refs.content, "favoritelist"); }); route("/favoriteLists/*", (favoriteListId) => { + this.bus.trigger("pageChanged", "favoriteLists"); riot.mount(this.refs.content, "favoritelist", {favoriteListId: favoriteListId}); }); route(() => { + this.bus.trigger("pageChanged", "home"); riot.mount(this.refs.content, "home"); }); diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/Poll.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/Poll.tag.html index c71da08..eae9ce3 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/Poll.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/Poll.tag.html @@ -177,6 +177,7 @@ require("../popup/QrCodeButton.tag.html"); this.onPollChange = poll => { this.poll = poll; this.update(); + this.bus.trigger("pageChanged", poll.title); }; this.bus.on("poll", this.onPollChange); -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.