This is an automated email from the git hooks/post-receive script. New commit to branch feature/pollen-riot-js in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit ef56fe04c827ef43c5067aeb4837deca0fd85761 Author: Tony CHEMIT <dev@tchemit.fr> Date: Wed Feb 1 17:27:21 2017 +0100 ajout menu de création de sondage + amélioration rendu des choix dans les résultats --- pollen-ui-riot-js/src/main/web/i18n.json | 7 ++++++ pollen-ui-riot-js/src/main/web/tag/Header.tag | 20 ++++++++++------ pollen-ui-riot-js/src/main/web/tag/poll/Poll.tag | 2 +- .../src/main/web/tag/poll/PollChoiceDate.tag | 27 +++++++++++----------- .../src/main/web/tag/poll/PollResults.tag | 19 ++++++++++++--- .../src/main/web/tag/poll/PollSettings.tag | 2 +- .../src/main/web/tag/poll/PollVotes.tag | 5 +--- 7 files changed, 52 insertions(+), 30 deletions(-) diff --git a/pollen-ui-riot-js/src/main/web/i18n.json b/pollen-ui-riot-js/src/main/web/i18n.json index e437cc5..957e890 100644 --- a/pollen-ui-riot-js/src/main/web/i18n.json +++ b/pollen-ui-riot-js/src/main/web/i18n.json @@ -93,6 +93,9 @@ "header_polls": "Sondages", "header_users": "Utilisateurs", "header_myFavoriteLists": "Mes listes de favoris", + "header_createTextPoll": "Créer un sondage de type text", + "header_createImagePoll": "Créer un sondage de type image", + "header_createDatePoll": "Créer un sondage de type date", "home_createTextPoll": "Créer un sondage de type text", "home_createImagePoll": "Créer un sondage de type image", "home_createDatePoll": "Créer un sondage de type date", @@ -127,6 +130,7 @@ "poll_settings_voteVisibility_everybody": "Tout le monde", "poll_settings_voteVisibility_voter": "Les participants", "poll_settings_nav_poll": "Sondage", + "poll_settings_nav_result": "Résultats", "poll_settings_nav_votePeriod": "Période de vote", "poll_settings_nav_resultVisibility": "Visibilité des résultats", "poll_settings_nav_continuousResult": "Résultats continus", @@ -286,6 +290,9 @@ "header_polls": "Polls", "header_users": "Users", "header_myFavoriteLists": "My favorite lists", + "header_createTextPoll": "Create a text poll", + "header_createImagePoll": "Create a image poll", + "header_createDatePoll": "Create a date poll", "home_createTextPoll": "Create a text poll", "home_createImagePoll": "Create a image poll", "home_createDatePoll": "Create a date poll", diff --git a/pollen-ui-riot-js/src/main/web/tag/Header.tag b/pollen-ui-riot-js/src/main/web/tag/Header.tag index 54b3fa0..81979dc 100644 --- a/pollen-ui-riot-js/src/main/web/tag/Header.tag +++ b/pollen-ui-riot-js/src/main/web/tag/Header.tag @@ -24,9 +24,18 @@ require("./HeaderI18n.tag"); <a class="header-link" href="#home" target="_top">{__.home}</a> </div> <div class="header-separator"></div> + <div class="create dropdown"> + <a class="header-link"><i class="fa fa-plus-circle fa-2x"/></a> + <div class="dropdown-content"> + <a href="#poll/new/text/0">{__.createTextPoll}</a> + <a href="#poll/new/date/0">{__.createDatePoll}</a> + <a href="#poll/new/image/0">{__.createImagePoll}</a> + </div> + </div> + <div class="header-space"></div> <div if="{admin}" class="dropdown"> - <a class="header-link"><i class="fa fa-gear fa-15x"/></a> + <a class="header-link"><i class="fa fa-gear fa-2x"/></a> <div class="dropdown-content"> <a href="#user">{__.users}</a> <a href="#poll">{__.polls}</a> @@ -46,7 +55,7 @@ require("./HeaderI18n.tag"); </div> </div> <div class="header-separator"></div> - <HeaderI18n></HeaderI18n> + <HeaderI18n/> <script> let route = require("riot-route"); let authService = require("../js/AuthService"); @@ -95,10 +104,6 @@ require("./HeaderI18n.tag"); <style> - .fa-15x { - font-size: 1.5em; - } - header { display: flex; align-items: center; @@ -177,12 +182,13 @@ require("./HeaderI18n.tag"); /* Change color of dropdown links on hover */ .dropdown-content a:hover { - background-color: #f1f1f1 + background-color: #f1f1f1; } /* Show the dropdown menu on hover */ .dropdown:hover .dropdown-content { display: block; + z-index: 1; } </style> diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/Poll.tag b/pollen-ui-riot-js/src/main/web/tag/poll/Poll.tag index c8698ee..bfd4cba 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/Poll.tag +++ b/pollen-ui-riot-js/src/main/web/tag/poll/Poll.tag @@ -93,7 +93,7 @@ require('./PollSettings.tag'); }); this.refresh = () => { - this.withResults = this.poll.continuousResult || this.poll.isClosed; + this.withResults = this.poll.continuousResults || this.poll.isClosed; let tags = riot.mount(this.refs.content, "poll" + this.selectedTab, { pollId: this.pollId, poll: this.poll, diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/PollChoiceDate.tag b/pollen-ui-riot-js/src/main/web/tag/poll/PollChoiceDate.tag index 69e5137..73136a7 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/PollChoiceDate.tag +++ b/pollen-ui-riot-js/src/main/web/tag/poll/PollChoiceDate.tag @@ -48,20 +48,19 @@ <div class="choice-wide choice-date"> <input type="hidden" ref="choice" name="choice{number}" id="choice{number}" value="{choice.choiceValue}"> - <input type="date" ref="date" name="date{number}" id="date{number}" - value="{choice.date}" - disabled="{edit && !editing && choice.choiceValue?'disabled':''}" - class="choice-wide {edit && !editing && choice.choiceValue?'choice-disabled':''}"> + <input type="date" ref="date" name="date{number}" id="date{number}" value="{choice.date}" + class="choice-wide" + disabled="{!edit || (mode==='edit' && !editing && choice.choiceValue)?'disabled':''}"> <i class="fa fa-clock-o fa-15x"/> <input type="checkbox" ref="timed" checked="{timed?'checked':''}" onclick="{toggleTimed}" - disabled="{edit && !editing && choice.choiceValue?'disabled':''}"> + disabled="{!edit || (mode==='edit' && !editing)?'disabled':''}"> <input type="time" ref="time" name="time{number}" id="time{number}" value="{choice.time}" - disabled="{edit && !editing && choice.time || !timed?'disabled':''}" + disabled="{!edit || (mode==='edit' && !editing) || !timed?'disabled':''}" required="{timed?'required':''}"> </div> <input type="text" ref="description" name="description{number}" value="{choice.description}" - disabled="{edit && !editing && choice.choiceValue?'disabled':''}" - class="choice-wider {edit && !editing && choice.choiceValue?'choice-disabled':''}"> + disabled="{!edit || (mode==='edit' && !editing && choice.choiceValue)?'disabled':''}" + class="choice-wider"> </div> </div> </div> @@ -71,7 +70,8 @@ this.installBundle(opts.session, "poll_choices"); this.number = parseInt(opts.number); this.mode = opts.mode; - this.edit = opts.mode == 'add' || opts.mode == 'edit'; + console.info('modeeeeee: ' + this.mode) + this.edit = opts.mode == 'create' || opts.mode == 'edit'; this.choice = opts.choice; opts.emitter.on('prepareSave', () => { @@ -220,10 +220,6 @@ padding-top: 5px; } - .choice-disabled { - cursor: not-allowed; - } - .choice-edit { border: 2px solid #13a2ff; } @@ -234,7 +230,6 @@ input[type=date] { width: 165px; - /*margin-right: 10px;*/ } input[type=time] { @@ -245,5 +240,9 @@ width: 20px; } + input[disabled=disabled] { + cursor: not-allowed; + } + </style> </PollChoiceDate> diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/PollResults.tag b/pollen-ui-riot-js/src/main/web/tag/poll/PollResults.tag index ef7de4b..feb0406 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/PollResults.tag +++ b/pollen-ui-riot-js/src/main/web/tag/poll/PollResults.tag @@ -4,10 +4,10 @@ {__.title} </div> <div> - <div if="{!poll.continuousResult && !poll.isClosed}"> + <div if="{!poll.continuousResults && !poll.isClosed}"> {__.noResult} </div> - <div if="{poll.continuousResult || poll.isClosed}" class="result-body" > + <div if="{poll.continuousResults || poll.isClosed}" class="result-body" > <div if="{results.nbVotants==1}">1 {__.voter}</div> <div if="{results.nbVotants>1}">{results.nbVotants} {__.voters}</div> <br/> @@ -26,6 +26,7 @@ this.installBundle(session, "poll_results"); let resultService = require("../../js/ResultService"); let choiceService = require("../../js/ChoiceService"); + let moment = require("moment"); this.pollId = opts.pollId; this.poll = opts.poll; @@ -43,6 +44,18 @@ console.info(result); this.choices = result; + this.choices.forEach(c => { + if (c.choiceType==='DATE') { + if (c.choiceValue.indexOf('T')>-1) { + c.choiceValueStr = moment(c.choiceValue).format('LLL'); + }else { + c.choiceValueStr = moment(c.choiceValue).format('LL'); + } + } else { + c.choiceValueStr =c.choiceValue; + } + }); + resultService.getResults(this.pollId, this.permission).then((result) => { console.info("get results"); console.info(result); @@ -50,7 +63,7 @@ this.results.scores.forEach(s => { this.choices.forEach(c => { if (c.id == s.choiceId) { - s.choice = c.choiceValue; + s.choice = c.choiceValueStr; } }); }); diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/PollSettings.tag b/pollen-ui-riot-js/src/main/web/tag/poll/PollSettings.tag index dc16600..b1a50d3 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/PollSettings.tag +++ b/pollen-ui-riot-js/src/main/web/tag/poll/PollSettings.tag @@ -104,7 +104,7 @@ </div> <div class="contentAndHelp"> <div ref="content" class="content" onsubmit="{action}"> - <div class="config-group" id="Poll"> + <div if="{mode==='edit'}" class="config-group" id="Poll"> <div class="config-header">{__.poll_configuration}</div> <div id="Poll_title"> <div class="config-subheader">{__.nav_pollTitle} diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/PollVotes.tag b/pollen-ui-riot-js/src/main/web/tag/poll/PollVotes.tag index 40c754e..de25c1a 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/PollVotes.tag +++ b/pollen-ui-riot-js/src/main/web/tag/poll/PollVotes.tag @@ -337,11 +337,8 @@ color: red; } - div.voter { - width: 100%; - } - input.voter { + min-width: 200px; width: 100%; } -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.