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 2b34e6839e66aaa0d02a3a0188919cfc9ac16285 Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Wed Mar 29 14:17:16 2017 +0200 bouton de scroll pour les commentaire, pour les choix autorisé tout type de fichier et un peu de style --- pollen-ui-riot-js/src/main/web/css/main.css | 16 ++++---- pollen-ui-riot-js/src/main/web/i18n.json | 5 ++- .../src/main/web/tag/UserCard.tag.html | 4 +- .../src/main/web/tag/poll/Choice.tag.html | 33 +++++++++------- .../src/main/web/tag/poll/Choices.tag.html | 1 + .../src/main/web/tag/poll/Comments.tag.html | 44 +++++++++++++-------- .../src/main/web/tag/poll/Description.tag.html | 1 - .../src/main/web/tag/poll/Results.tag.html | 46 ++++++++++++++++------ 8 files changed, 94 insertions(+), 56 deletions(-) diff --git a/pollen-ui-riot-js/src/main/web/css/main.css b/pollen-ui-riot-js/src/main/web/css/main.css index 020b9cc..a21ac65 100644 --- a/pollen-ui-riot-js/src/main/web/css/main.css +++ b/pollen-ui-riot-js/src/main/web/css/main.css @@ -97,34 +97,34 @@ a { } } -form .actions { +.actions { padding: 5px 0; display: flex; justify-content: space-between; } -form .actions .c-button, -form .actions-left .c-button, -form .actions-right .c-button { +.actions .c-button, +.actions-left .c-button, +.actions-right .c-button { margin: 2px; } -form .actions-left { +.actions-left { padding: 5px 0; display: flex; justify-content: flex-start; flex-wrap: wrap-reverse; } -form .actions-right { +.actions-right { padding: 5px 0; display: flex; justify-content: flex-end; flex-wrap: wrap; } -form .actions .actions-left, -form .actions .actions-right { +.actions .actions-left, +.actions .actions-right { padding: 0; } diff --git a/pollen-ui-riot-js/src/main/web/i18n.json b/pollen-ui-riot-js/src/main/web/i18n.json index 5d371d2..a000711 100644 --- a/pollen-ui-riot-js/src/main/web/i18n.json +++ b/pollen-ui-riot-js/src/main/web/i18n.json @@ -208,6 +208,7 @@ "poll_settings_freePoll": "Tout le monde peut voter (Sondage public)", "poll_settings_restrictedPoll": "Seul les invités peuvent voter (Sondage privé)", "poll_settings_restrictedPoll_withMe": "Je participe au sondage", + "poll_choices_title": "Liste des choix", "poll_choices_label": "Choix", "poll_choices_description": "Description", "poll_previous": "Précédent", @@ -274,8 +275,9 @@ "choice_description_placeholder": "Vous pouvez saisir une description", "date-picker_today": "Aujourd'hui", "choice_text": "Renseignez un text", + "choice_text_placeholder": "Renseignez un text ou sélectionnez un autre type", "choice_ressource": "Utiliser une image", - "choice_addFile": "Ajouter une image", + "choice_addFile": "Ajouter un fichier", "choice_date": "Renseignez une date", "choice_time": "Ajouter une heure à la date", "choice_description": "Ajouter un descriptif du choix" @@ -481,6 +483,7 @@ "poll_settings_freePoll": "Everybody can vote (Public poll)", "poll_settings_restrictedPoll": "Only invited people can vote (Private poll)", "poll_settings_restrictedPoll_withMe": "I also want to participate", + "poll_choices_title": "Choices List", "poll_choices_label": "Choice", "poll_choices_description": "Description", "poll_choices_previous": "Previous", diff --git a/pollen-ui-riot-js/src/main/web/tag/UserCard.tag.html b/pollen-ui-riot-js/src/main/web/tag/UserCard.tag.html index 6931865..41a8e30 100644 --- a/pollen-ui-riot-js/src/main/web/tag/UserCard.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/UserCard.tag.html @@ -2,10 +2,10 @@ <div class="user-card-view" if={!editing}> <div class="login"> <span> - <i class="fa fa-ban" if={user.isBanned} title={__.banned}></i> - <i class="fa fa-cog" if={user.administrator} title={__.administrator}></i> {opts.user.name} - {opts.user.email} <i class="fa fa-refresh" if={!user.emailIsValidate} title={__.emailValidate}></i> + <i class="fa fa-ban" if={user.isBanned} title={__.banned}></i> + <i class="fa fa-cog" if={user.administrator} title={__.administrator}></i> </span> </div> diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/Choice.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/Choice.tag.html index 6061303..e92b6f6 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/Choice.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/Choice.tag.html @@ -13,6 +13,7 @@ require("../components/time-picker.tag.html"); <input type="text" ref="choiceText" class={opts.choice.choiceType === 'TEXT' ? 'selected' : 'hidden'} + placeholder="{__.text_placeholder}" disabled={opts.disabled} value={valueText} onchange={onTextChange}/> @@ -37,19 +38,18 @@ require("../components/time-picker.tag.html"); </div> <div if="{!originalFile}" class="add-file {opts.choice.choiceType === 'RESOURCE' ? 'selected' : 'hidden'}"> - <img if={hasNewFile} ref="imagePreview"/> + <img if={newFile && newFile.image} ref="imagePreview"/> <div> - <span if={!opts.disabled && !hasNewFile} + <span if={!opts.disabled && !newFile} onclick="{addFile}"> <i class="fa fa-plus"/> {__.addFile} </span> - <span if={!opts.disabled && hasNewFile} - onclick="{deleteFile}"> - <i class="fa fa-remove"/> + <span if={!opts.disabled && newFile}> + {newFile.name} + <i class="fa fa-remove" onclick={deleteFile}/> </span> <input type="file" - accept="image/*" ref="choiceResource" onchange={onRessourceChange} disabled={opts.disabled}/> @@ -157,14 +157,17 @@ require("../components/time-picker.tag.html"); }; this.onRessourceChange = () => { - this.hasNewFile = true; - let reader = new FileReader(); - reader.onload = (e) => { - // get loaded data and render thumbnail. - this.refs.imagePreview.src = e.target.result; - }; - // read the image file as a data URL. - reader.readAsDataURL(this.refs.choiceResource.files[0]); + this.newFile = this.refs.choiceResource.files[0]; + if (this.newFile.type.startsWith("image/")) { + this.newFile.image = true; + let reader = new FileReader(); + reader.onload = (e) => { + // get loaded data and render thumbnail. + this.refs.imagePreview.src = e.target.result; + }; + // read the image file as a data URL. + reader.readAsDataURL(this.refs.choiceResource.files[0]); + } }; this.deleteFile = () => { @@ -173,7 +176,7 @@ require("../components/time-picker.tag.html"); } else { this.refs.choiceResource.value = ""; this.refs.imagePreview.src = ""; - this.hasNewFile = false; + delete this.newFile; } }; diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/Choices.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/Choices.tag.html index 0358247..f884c69 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/Choices.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/Choices.tag.html @@ -1,5 +1,6 @@ require("./Choice.tag.html"); <Choices> + <h4>{__.title}</h4> <div each={choice, index in form.choices} class="o-form-element"> <div class="c-input-group"> diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/Comments.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/Comments.tag.html index 3d60870..8cd17f3 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/Comments.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/Comments.tag.html @@ -3,17 +3,6 @@ require("./CommentPopup.tag.html"); <Comments> <form show="{loaded}" onsubmit="{addComment}" class="comment-form"> - <div class="actions"> - <div class="actions-left"> - </div> - <div class="actions-right"> - <button type="submit" - class="c-button c-button--info pull-right"> - <i class="fa fa-paper-plane"/> - {__.sendComment} - </button> - </div> - </div> <div class="comment"> <div class="comment-user"> <div class="o-form-element"> @@ -59,12 +48,18 @@ require("./CommentPopup.tag.html"); <div show="{loaded}" > <div show="{poll.comments && poll.comments.length === 0}">{__.noComment}</div> - <button type="button" - show="{poll.comments && poll.comments.length > 0}" - class="c-button c-button--info" - onclick="{toggleSort}"> - <i class="fa fa-sort-amount-{desc : orderDesc, asc : !orderDesc}"/> - </button> + <div class="actions" show="{poll.comments && poll.comments.length > 0}"> + <button type="button" + class="c-button c-button--info" + onclick="{toggleSort}"> + <i class="fa fa-sort-amount-{desc : orderDesc, asc : !orderDesc}"/> + </button> + <button type="button" + class="c-button c-button--info" + onclick="{scrollBottom}"> + <i class="fa fa-arrow-down"/> + </button> + </div> <div class="comments {inverse : orderDesc}"> <div each="{comment, index in poll.comments}"> @@ -152,6 +147,13 @@ require("./CommentPopup.tag.html"); </form> </div> </div> + <div class="actions-right" show="{poll.comments && poll.comments.length > 0}"> + <button type="button" + class="c-button c-button--info" + onclick="{scrollTop}"> + <i class="fa fa-arrow-up"/> + </button> + </div> </div> <script type="es6"> @@ -215,6 +217,14 @@ require("./CommentPopup.tag.html"); } }; + this.scrollTop = () => { + window.scrollTo(0, 0); + }; + + this.scrollBottom = () => { + window.scrollTo(0, document.body.scrollHeight); + }; + this.on("before-unmount", () => { this.bus.off("poll", this.onPollChange); }); diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/Description.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/Description.tag.html index e08025a..438aca2 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/Description.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/Description.tag.html @@ -43,7 +43,6 @@ <input ref="email" type="email" class="c-field" - required name="email" value="{form.model.creatorEmail}" placeholder="{__.emailPlaceHolder}"> diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/Results.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/Results.tag.html index cdb6f07..43ef305 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/Results.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/Results.tag.html @@ -8,12 +8,16 @@ require("./Podium.tag.html"); </div> <div if="{poll.resultIsVisible && poll.results}" class="result-body" > <Podium/> - <div class="result-content" each="{result in poll.results.scores}"> - <div class="result"> - {result.scoreOrder + 1} ({result.scoreValue} {result.scoreValue > 1 ? parent.__.votes : parent.__.vote}) : - <ChoiceView choice={poll.getChoice(result.choiceId)}/> - </div> - </div> + <table class="table-results"> + <tr each="{result in poll.results.scores}"> + <td class="score">{result.scoreOrder + 1}</td> + <td class="votes">{result.scoreValue} {result.scoreValue > 1 ? parent.__.votes : parent.__.vote}</td> + <td class="choice"> + <ChoiceView choice={poll.getChoice(result.choiceId)}/> + </td> + </tr> + </table> + </div> </div> @@ -40,18 +44,36 @@ require("./Podium.tag.html"); </script> <style> - .result-content { + .result-body { display: flex; flex-direction: column; - align-items : center; + align-items: center; } - .result { - display: flex; - justify-content: space-between; - align-items: baseline; + .result-body podium { + align-self: stretch; + } + .table-results td { + text-align: center; + padding: 2px 5px } + /*.table-results td.score { + min-width: 50px; + } + + + .table-results td.votes { + min-width: 50px; + }*/ + + + /*.table-results td.choice { + min-width: 50px; + }*/ + + + </style> </Results> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.