This is an automated email from the git hooks/post-receive script. New commit to branch feature/253-tuiles in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit 9a1c61a6cc70d31102c06814c8aa8f9ba88eb349 Author: Cécilia Bossard <bossard@codelutin.com> Date: Mon Mar 2 16:06:11 2020 +0100 ref #253 Suppression en masse + lien pour dupliquer un sondage --- pollen-ui-riot-js/src/main/web/i18n/en.json | 3 +- pollen-ui-riot-js/src/main/web/i18n/fr.json | 1 + .../src/main/web/tag/poll/MyPollsHeader.tag.html | 34 ++++++++++++++++++++-- .../src/main/web/tag/poll/PollCardReboot.tag.html | 3 +- .../src/main/web/tag/poll/Polls.tag.html | 1 + .../main/web/tag/popup/ConfirmPopupReboot.tag.html | 2 +- 6 files changed, 39 insertions(+), 5 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 33adbdf2..11d793d1 100644 --- a/pollen-ui-riot-js/src/main/web/i18n/en.json +++ b/pollen-ui-riot-js/src/main/web/i18n/en.json @@ -202,7 +202,7 @@ "polls_assignPollToMe_title": "Link a poll", "polls_assignPollToMe_desc": "If you created a poll without being connected, you can link it to your account by fillin the form below with the administration url of the poll.", "polls_assignSuccessMessage": "The poll \"{0}\" has successfully been linked to your account:", - "polls_alreadyAssignMessage": "Th poll is already linked to your account", + "polls_alreadyAssignMessage": "The poll is already linked to your account", "polls_allPolls": "All", "polls_myPolls": "My polls", "polls_invitedPolls": "Invited", @@ -221,6 +221,7 @@ "polls_manyFound": "{0} founds over ", "polls_newPoll": "New poll", "polls_noPollFound": "No poll found", + "polls_deletePolls": "Delete selected polls", "signup_title": "Create an account", "signup_email": "Email", "signup_email_placeholder": "Enter your 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 05d8ef87..5c837a3d 100644 --- a/pollen-ui-riot-js/src/main/web/i18n/fr.json +++ b/pollen-ui-riot-js/src/main/web/i18n/fr.json @@ -221,6 +221,7 @@ "polls_manyFound": "{0} trouvés sur ", "polls_newPoll": "Nouveau sondage", "polls_noPollFound": "Aucun sondage trouvé", + "polls_deletePolls": "Supprimer les sondages sélectionnés", "signup_title": "Créer un compte", "signup_email": "Email", "signup_email_placeholder": "Entrez votre adresse email", diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/MyPollsHeader.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/MyPollsHeader.tag.html index 8998cc02..0dc6f11e 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/MyPollsHeader.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/MyPollsHeader.tag.html @@ -34,7 +34,7 @@ import "../popup/ModalReboot.tag.html"; <div class="header"> <div class="leftHeader"> <span>{_t.createdPolls}</span> - <PollenButton primary="true" label={_t.newPoll} icon="icon-new" url="#poll/new/text"/> + <PollenButton primary="true" label={_t.newPoll} icon="icon-plus" url="#poll/new/text"/> <PollenButton secondary="true" label={_t.assignPollToMe_title} url="" onclick={this.assignPoll} /> </div> <div> @@ -56,7 +56,7 @@ import "../popup/ModalReboot.tag.html"; </div> <div class="rightSubMenu"> <MenuItem href="#" label="Duplicate" ref="duplicatePolls" method="" mainclassname="hidden"/> - <MenuItem href="#" label="Delete" ref="deletePolls" method="" mainclassname="hidden"/> + <MenuItem href="#" label="Delete" ref="deletePolls" method="" mainclassname="hidden" onclick="{this.deletePolls}"/> <Separator isvisible="hidden" ref="rightSubMenuSeparator"/> <IconButton icon="icon-List" /> <IconButton href="#" icon="icon-Mosaic" active="true"/> @@ -124,6 +124,36 @@ import "../popup/ModalReboot.tag.html"; this.update(); }; + this.hideMenus = () => { + this.refs.duplicatePolls.display(false); + this.refs.deletePolls.display(false); + this.refs.rightSubMenuSeparator.display(false); + + this.update(); + } + + this.deletePolls = (e) => { + + e.preventDefault(); + e.stopPropagation(); + + this.confirmReboot(this._t.deletePolls).then((confirm) => { + if (confirm) { + + var pollsToDelete = this.parent.boxChecked; + + var pollDeletionRequests = pollsToDelete.map(poll => { + return pollService.deletePoll(poll.opts.poll.id, poll.opts.poll.permission); + }); + + Promise.all(pollDeletionRequests).then(() => { + this.hideMenus(); + this.opts.onPollListChange(); + }); + } + }); + }; + </script> <style> diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/PollCardReboot.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/PollCardReboot.tag.html index 6bf946e1..d1f55611 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/PollCardReboot.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/PollCardReboot.tag.html @@ -42,7 +42,7 @@ import "../components/Avatar.tag.html"; onclick={parent.deletePoll} href="#"> <li>{parent._t.deletePoll} </li></a> <a if="{parent.opts.poll.permission}" title={parent._t.duplicatePoll} - onclick={parent.duplicatePoll}><li>{parent._t.duplicatePoll} (TODO) + onclick={parent.duplicatePoll} href="#poll/{parent.opts.poll.id}/clone/{parent.opts.poll.permission}"><li>{parent._t.duplicatePoll} </li></a> <a if="{parent.opts.poll.permission}" title={parent._t.invitePoll} onclick={parent.invitePoll}><li>{parent._t.invitePoll} (TODO) @@ -252,6 +252,7 @@ import "../components/Avatar.tag.html"; width : 30px; height : 30px; border-radius:15px; + font-size: 20px; } .menu { diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/Polls.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/Polls.tag.html index f54a8dea..d8a86edb 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/Polls.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/Polls.tag.html @@ -94,6 +94,7 @@ import "./NoPoll.tag.html"; }; this.refresh = () => { + this.boxChecked = []; this.refs.lazyLoad.reload(); }; diff --git a/pollen-ui-riot-js/src/main/web/tag/popup/ConfirmPopupReboot.tag.html b/pollen-ui-riot-js/src/main/web/tag/popup/ConfirmPopupReboot.tag.html index 3c1f864e..482fe076 100644 --- a/pollen-ui-riot-js/src/main/web/tag/popup/ConfirmPopupReboot.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/popup/ConfirmPopupReboot.tag.html @@ -100,7 +100,7 @@ left: 50%; transform: translate(-50%,-50%); display: block; - width: 300px; + width: 320px; border: 0 solid var(--default); border-radius: 4px; background-color: var(--background); -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.