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 02a5af9d37875f16ea1385825a78bf9acbca13f3 Author: Kevin Morin <morin@codelutin.com> Date: Thu Sep 28 11:55:26 2017 +0200 ajout de l'url de voe à partager dans la page de résumé du sondage + warning pour ne pas partager la page de résumé --- pollen-ui-riot-js/src/main/web/i18n/en.json | 2 + pollen-ui-riot-js/src/main/web/i18n/fr.json | 2 + .../src/main/web/tag/poll/Summary.tag.html | 50 ++++++++++++++++++---- 3 files changed, 46 insertions(+), 8 deletions(-) diff --git a/pollen-ui-riot-js/src/main/web/i18n/en.json b/pollen-ui-riot-js/src/main/web/i18n/en.json index fbde0ab4..a7af00cd 100644 --- a/pollen-ui-riot-js/src/main/web/i18n/en.json +++ b/pollen-ui-riot-js/src/main/web/i18n/en.json @@ -15,6 +15,7 @@ "main_emailOrProviderAccountAlreadyUsed": "The email address of the account you are connecting with is already used by another Pollen account.", "pagination_all": "All", "pagination_resultsPerPage": "Results per page", + "summary_doNotSharePageUrl": "Watch out, if you spread the adress of this page, other people will be able to modify the poll.", "summary_choices": "Choices", "summary_voteCountingType": "Poll type", "summary_dates": "Dates", @@ -24,6 +25,7 @@ "summary_toDate": "to", "summary_administrate": "Modérer les votes et les commentaires", "summary_sharing": "Sharing", + "summary_shareLink": "share this link to invite people to vote:", "summary_shareByQR": "Show the QR Code to go to the poll", "summary_shareByEmail": "Send invitations by email", "summary_invitations": "Number of invitations to vote sent by email:", diff --git a/pollen-ui-riot-js/src/main/web/i18n/fr.json b/pollen-ui-riot-js/src/main/web/i18n/fr.json index 47f8b0d8..1f7b12df 100644 --- a/pollen-ui-riot-js/src/main/web/i18n/fr.json +++ b/pollen-ui-riot-js/src/main/web/i18n/fr.json @@ -15,6 +15,7 @@ "main_emailOrProviderAccountAlreadyUsed": "L'adresse email du compte avec lequel vous essayez de vous connecter, est déjà utilisée par un autre compte Pollen.", "pagination_all": "Tous", "pagination_resultsPerPage": "Résultats par page", + "summary_doNotSharePageUrl": "Attention, si vous diffusez l'adresse de cette page, d'autres personnes pourront modifier le sondage.", "summary_choices": "Choix", "summary_voteCountingType": "Type de sondage", "summary_dates": "Dates", @@ -24,6 +25,7 @@ "summary_toDate": "jusqu'au", "summary_administrate": "Modérer les votes et les commentaires", "summary_sharing": "Partage", + "summary_shareLink": "Partagez ce lien pour inviter les participants à voter :", "summary_shareByQR": "Afficher un QR code pour accéder au sondage", "summary_shareByEmail": "Envoyer des invitations par email", "summary_invitations": "Nombre d'invitations à voter envoyées par email:", diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/Summary.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/Summary.tag.html index 614ab079..c2915434 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/Summary.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/Summary.tag.html @@ -26,6 +26,9 @@ require("../components/MultiLineLabel.tag.html"); <Summary> <div if={successMessage} class="c-alert c-alert--success">{successMessage}</div> + <div if={successMessage} class="c-alert c-alert--warning"> + <i class="fa fa-exclamation-triangle"></i> {__.doNotSharePageUrl} <i class="fa fa-exclamation-triangle"></i> + </div> <div class="summary-part"> <h2> @@ -71,12 +74,31 @@ require("../components/MultiLineLabel.tag.html"); {__.invitations} <strong>{opts.form.model.participants.length}</strong> </div> <div> - <QrCodeButton value="{window.location.origin}{window.location.pathname}#poll/{opts.form.model.id}/vote" title="{__.shareByQR}"/> - <a href="mailto:?subject={opts.form.model.title}&body={opts.form.model.title}%0D%0A{opts.form.model.description}%0D%0A{window.location.origin}{window.location.pathname}#poll/{opts.form.model.id}/vote" - title="{__.shareByEmail}" - class="c-button c-button--info"> - <i class="fa fa-paper-plane"></i> - </a> + <label class="c-label" for="voteUrl"> + {__.shareLink} + </label> + <div class="c-input-group"> + <div class="o-field"> + <input id="voteUrl" + ref="voteUrl" + class="c-field" + value={voteUrl} + type="url" + readonly/> + </div> + <button class="c-button c-button--info" + onclick={copy("voteUrl")}> + <i class="fa fa-clipboard" aria-hidden="true"></i> + </button> + </div> + <div class="share-actions"> + <QrCodeButton value="{voteUrl}" title="{__.shareByQR}"/> + <a href="mailto:?subject={opts.form.model.title}&body={opts.form.model.title}%0D%0A{opts.form.model.description}%0D%0A{voteUrl}" + title="{__.shareByEmail}" + class="c-button c-button--info"> + <i class="fa fa-paper-plane"></i> + </a> + </div> </div> </div> @@ -89,12 +111,12 @@ require("../components/MultiLineLabel.tag.html"); <div class="summary-part"> <a if={opts.form.model.pollType === "FREE"} - href="{window.location.origin}{window.location.pathname}#poll/{opts.form.model.id}/vote" + href="{voteUrl}" class="c-button c-button--info"> <i class="link fa fa-envelope-o"/> {__.vote} </a> - <a href="{window.location.origin}{window.location.pathname}#poll/{opts.form.model.id}/vote/{opts.form.model.permission}" + <a href="{voteUrl}/{opts.form.model.permission}" class="c-button c-button--brand"> <i class="link fa fa-wrench"/> {__.administrate} @@ -123,6 +145,9 @@ require("../components/MultiLineLabel.tag.html"); this.installBundle(this.session, "summary"); this.showVoteCountingTypeHelper = false; + this.on("update", () => { + this.voteUrl = window.location.origin + window.location.pathname + "#poll/" + this.opts.form.model.id + "/vote"; + }); this.copyUrl = (refInputUrl) => () => { this.refs[refInputUrl].select(); @@ -150,6 +175,11 @@ require("../components/MultiLineLabel.tag.html"); }); }; + this.copy = (refInput) => () => { + this.refs[refInput].select(); + document.execCommand("copy"); + }; + </script> <style> @@ -163,5 +193,9 @@ require("../components/MultiLineLabel.tag.html"); background-color: #eee; } + .share-actions { + margin-top: 10px; + } + </style> </Summary> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.