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 a2b4c1a917ac9852454c5e3eba9242c747184cdf Author: Cécilia Bossard <bossard@codelutin.com> Date: Fri Feb 28 15:03:25 2020 +0100 ref #253 Refonte de la popup de confirmation de la suppression d'un sondage --- pollen-ui-riot-js/src/main/web/i18n/en.json | 1 + pollen-ui-riot-js/src/main/web/i18n/fr.json | 1 + pollen-ui-riot-js/src/main/web/tag/Pollen.tag.html | 2 + .../src/main/web/tag/poll/PollCardReboot.tag.html | 6 +- .../main/web/tag/popup/ConfirmPopupReboot.tag.html | 144 +++++++++++++++++++++ 5 files changed, 153 insertions(+), 1 deletion(-) 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 79bcd1c0..33adbdf2 100644 --- a/pollen-ui-riot-js/src/main/web/i18n/en.json +++ b/pollen-ui-riot-js/src/main/web/i18n/en.json @@ -220,6 +220,7 @@ "polls_oneFound": "{0} found over ", "polls_manyFound": "{0} founds over ", "polls_newPoll": "New poll", + "polls_noPollFound": "No poll found", "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 b97a1372..05d8ef87 100644 --- a/pollen-ui-riot-js/src/main/web/i18n/fr.json +++ b/pollen-ui-riot-js/src/main/web/i18n/fr.json @@ -220,6 +220,7 @@ "polls_oneFound": "{0} trouvé sur ", "polls_manyFound": "{0} trouvés sur ", "polls_newPoll": "Nouveau sondage", + "polls_noPollFound": "Aucun sondage trouvé", "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/Pollen.tag.html b/pollen-ui-riot-js/src/main/web/tag/Pollen.tag.html index 64ae8088..a47b550d 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 @@ -44,6 +44,7 @@ import "./admin/LoginProviders.tag.html"; import "./favoriteList/FavoriteLists.tag.html"; import "./favoriteList/FavoriteList.tag.html"; import "./popup/ConfirmPopup.tag.html"; +import "./popup/ConfirmPopupReboot.tag.html"; import "./popup/InformationPopup.tag.html"; import "./popup/GtuChangeModal.tag.html"; import "./popup/ChoiceDetailModal.tag.html"; @@ -51,6 +52,7 @@ import "./popup/AddReportModal.tag.html"; import "./popup/ShowReportsModal.tag.html"; <Pollen class="body-wrapper colors-default"> <ConfirmPopup/> + <ConfirmPopupReboot/> <InformationPopup/> <GtuChangeModal/> <ChoiceDetailModal/> 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 c415f12c..6bf946e1 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 @@ -109,7 +109,7 @@ import "../components/Avatar.tag.html"; this.deletePoll = (e) => { e.preventDefault(); e.stopPropagation(); - this.confirm(this._t.deletePoll).then((confirm) => { + this.confirmReboot(this._t.deletePoll).then((confirm) => { if (confirm) { pollService.deletePoll(this.opts.poll.id, this.opts.poll.permission).then(() => { this.opts.onPollListChange(); @@ -319,6 +319,10 @@ import "../components/Avatar.tag.html"; background: var(--White-Smoke); } + .icon::before, .icon-vote { + font-size: 20px; + } + </style> </PollCardReboot> \ No newline at end of file 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 new file mode 100644 index 00000000..3c1f864e --- /dev/null +++ b/pollen-ui-riot-js/src/main/web/tag/popup/ConfirmPopupReboot.tag.html @@ -0,0 +1,144 @@ +<!-- + #%L + Pollen :: UI RiotJs + %% + Copyright (C) 2009 - 2017 CodeLutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + #L% + --> + +<ConfirmPopupReboot show={openModal}> + <div class="c-overlay"></div> + <div class="modal"> + <div class="c-card c-card--higher"> + <header class="modal-header"> + <span> + {message} + </span> + </header> + + <div class="modal-footer"> + <PollenButton cancel="true" label={_t.cancel} onclick={cancel} /> + <PollenButton primary="true" label={label} onclick="{confirm}" /> + </div> + </div> + </div> + + <script type="es6"> + import session from "../../js/Session"; + + this.installBundle(session, "confirm"); + this.openModal = false; + this.timeout = null; + this.timer = null; + + this.open = (message, label, type, timeout) => { + this.message = message; + this.label = label || this._t.delete; + this.type = type || "error"; + + this.timeout = timeout; + if (this.timeout) { + this.timer = setInterval(() => { + this.timeout--; + if (this.timeout === 0) { + clearInterval(this.timer); + } + this.update(); + }, 1000); + } + + this.openModal = true; + this.modalPromise = new Promise((resolve, reject) => { + this.modalResolve = resolve; + this.modalReject = reject; + }); + this.update(); + return this.modalPromise; + }; + + this.close = (value) => { + this.timeout = null; + clearInterval(this.timer); + if (this.openModal) { + this.openModal = false; + this.modalResolve(value); + this.update(); + } + }; + + this.confirm = () => { + this.close(true); + }; + + this.cancel = () => { + this.close(false); + }; + + this.listen("escape", this.cancel); + + riot.mixin({confirmReboot: this.open}); + + </script> + + <style> + + .modal { + top: 50%; + left: 50%; + transform: translate(-50%,-50%); + display: block; + width: 300px; + border: 0 solid var(--default); + border-radius: 4px; + background-color: var(--background); + overflow: hidden; + z-index: 50; + position: fixed; + } + + .modal-header { + display: flex; + align-items: center; + + background: var(--White); + /* Link Water */ + border: 1px solid var(--Link-Water); + box-sizing: border-box; + + height: 70px; + font-weight: bold; + font-size: 18px; + line-height: 25px; + + padding-left: 30px; + } + + .modal-footer { + display: flex; + justify-content: space-between; + align-items: center; + + padding-bottom: 50px; + padding-left: 30px; + padding-right: 30px; + height: 70px; + + margin-top: 50px; + } + + </style> + +</ConfirmPopupReboot> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.