branch feature/pollen-riot-js updated (b89351e -> 69819a2)
This is an automated email from the git hooks/post-receive script. New change to branch feature/pollen-riot-js in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git from b89351e gestion des utilisateurs bannis new 69819a2 Renommage de tags + gestion des participants à un sondage The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit 69819a275bb7a32cadf7a47a6cc3b442d0b26a9b Author: Tony CHEMIT <dev@tchemit.fr> Date: Thu Feb 2 10:14:58 2017 +0100 Renommage de tags + gestion des participants à un sondage Summary of changes: pollen-persistence/src/main/xmi/pollen.zargo | Bin 21259 -> 21327 bytes .../org/chorem/pollen/services/bean/PollBean.java | 16 +++ .../pollen/services/service/PollService.java | 5 + pollen-ui-riot-js/src/main/web/i18n.json | 15 ++- pollen-ui-riot-js/src/main/web/js/PollForm.js | 11 ++ .../poll/{PollChoiceDate.tag => ChoiceDate.tag} | 4 +- .../poll/{PollChoiceText.tag => ChoiceText.tag} | 4 +- .../web/tag/poll/{PollChoices.tag => Choices.tag} | 10 +- .../tag/poll/{PollComments.tag => Comments.tag} | 4 +- .../src/main/web/tag/poll/CreatePoll.tag | 20 +-- .../web/tag/poll/{PollCreated.tag => Created.tag} | 4 +- .../poll/{PollDescription.tag => Description.tag} | 4 +- pollen-ui-riot-js/src/main/web/tag/poll/Poll.tag | 12 +- .../web/tag/poll/{PollResults.tag => Results.tag} | 4 +- .../tag/poll/{PollSettings.tag => Settings.tag} | 134 ++++++++++++++------- .../web/tag/poll/{PollVoters.tag => Voters.tag} | 4 +- .../main/web/tag/poll/{PollVotes.tag => Votes.tag} | 4 +- 17 files changed, 173 insertions(+), 82 deletions(-) rename pollen-ui-riot-js/src/main/web/tag/poll/{PollChoiceDate.tag => ChoiceDate.tag} (99%) rename pollen-ui-riot-js/src/main/web/tag/poll/{PollChoiceText.tag => ChoiceText.tag} (99%) rename pollen-ui-riot-js/src/main/web/tag/poll/{PollChoices.tag => Choices.tag} (98%) rename pollen-ui-riot-js/src/main/web/tag/poll/{PollComments.tag => Comments.tag} (99%) rename pollen-ui-riot-js/src/main/web/tag/poll/{PollCreated.tag => Created.tag} (98%) rename pollen-ui-riot-js/src/main/web/tag/poll/{PollDescription.tag => Description.tag} (98%) rename pollen-ui-riot-js/src/main/web/tag/poll/{PollResults.tag => Results.tag} (99%) rename pollen-ui-riot-js/src/main/web/tag/poll/{PollSettings.tag => Settings.tag} (87%) rename pollen-ui-riot-js/src/main/web/tag/poll/{PollVoters.tag => Voters.tag} (99%) rename pollen-ui-riot-js/src/main/web/tag/poll/{PollVotes.tag => Votes.tag} (99%) -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
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 69819a275bb7a32cadf7a47a6cc3b442d0b26a9b Author: Tony CHEMIT <dev@tchemit.fr> Date: Thu Feb 2 10:14:58 2017 +0100 Renommage de tags + gestion des participants à un sondage --- pollen-persistence/src/main/xmi/pollen.zargo | Bin 21259 -> 21327 bytes .../org/chorem/pollen/services/bean/PollBean.java | 16 +++ .../pollen/services/service/PollService.java | 5 + pollen-ui-riot-js/src/main/web/i18n.json | 15 ++- pollen-ui-riot-js/src/main/web/js/PollForm.js | 11 ++ .../poll/{PollChoiceDate.tag => ChoiceDate.tag} | 4 +- .../poll/{PollChoiceText.tag => ChoiceText.tag} | 4 +- .../web/tag/poll/{PollChoices.tag => Choices.tag} | 10 +- .../tag/poll/{PollComments.tag => Comments.tag} | 4 +- .../src/main/web/tag/poll/CreatePoll.tag | 20 +-- .../web/tag/poll/{PollCreated.tag => Created.tag} | 4 +- .../poll/{PollDescription.tag => Description.tag} | 4 +- pollen-ui-riot-js/src/main/web/tag/poll/Poll.tag | 12 +- .../web/tag/poll/{PollResults.tag => Results.tag} | 4 +- .../tag/poll/{PollSettings.tag => Settings.tag} | 134 ++++++++++++++------- .../web/tag/poll/{PollVoters.tag => Voters.tag} | 4 +- .../main/web/tag/poll/{PollVotes.tag => Votes.tag} | 4 +- 17 files changed, 173 insertions(+), 82 deletions(-) diff --git a/pollen-persistence/src/main/xmi/pollen.zargo b/pollen-persistence/src/main/xmi/pollen.zargo index 60e8e66..a5d88ed 100644 Binary files a/pollen-persistence/src/main/xmi/pollen.zargo and b/pollen-persistence/src/main/xmi/pollen.zargo differ diff --git a/pollen-services/src/main/java/org/chorem/pollen/services/bean/PollBean.java b/pollen-services/src/main/java/org/chorem/pollen/services/bean/PollBean.java index d0bcddf..c21198c 100644 --- a/pollen-services/src/main/java/org/chorem/pollen/services/bean/PollBean.java +++ b/pollen-services/src/main/java/org/chorem/pollen/services/bean/PollBean.java @@ -22,6 +22,7 @@ package org.chorem.pollen.services.bean; */ import com.google.common.base.Joiner; +import org.apache.commons.collections.CollectionUtils; import org.chorem.pollen.persistence.entity.ChoiceType; import org.chorem.pollen.persistence.entity.CommentVisibility; import org.chorem.pollen.persistence.entity.Poll; @@ -130,6 +131,8 @@ public class PollBean extends PollenBean<Poll> { protected ChoiceType choiceType; + protected boolean withMe; + @Override public void fromEntity(Poll entity) { @@ -170,6 +173,7 @@ public class PollBean extends PollenBean<Poll> { setResultVisibility(entity.getResultVisibility()); setClosed(entity.isClosed()); setParticipants(new LinkedHashSet<>(entity.getParticipants() == null ? Collections.emptyList() : Arrays.asList(entity.getParticipants().split("\\s")))); + setWithMe(entity.isWithMe()); setChoiceType(entity.getChoiceType()); if (entity.isClosed()) { @@ -226,6 +230,7 @@ public class PollBean extends PollenBean<Poll> { entity.setClosed(isClosed()); entity.setParticipants(Joiner.on(' ').join(getParticipants())); entity.setChoiceType(getChoiceType()); + entity.setWithMe(isWithMe()); return entity; } @@ -422,6 +427,9 @@ public class PollBean extends PollenBean<Poll> { this.commentCount = commentCount; } + public boolean withParticipants() { + return CollectionUtils.isNotEmpty(participants); + } public Set<String> getParticipants() { return participants; } @@ -469,4 +477,12 @@ public class PollBean extends PollenBean<Poll> { public void setChoiceCount(long choiceCount) { this.choiceCount = choiceCount; } + + public boolean isWithMe() { + return withMe; + } + + public void setWithMe(boolean withMe) { + this.withMe = withMe; + } } diff --git a/pollen-services/src/main/java/org/chorem/pollen/services/service/PollService.java b/pollen-services/src/main/java/org/chorem/pollen/services/service/PollService.java index 7da57f8..c56e175 100644 --- a/pollen-services/src/main/java/org/chorem/pollen/services/service/PollService.java +++ b/pollen-services/src/main/java/org/chorem/pollen/services/service/PollService.java @@ -21,6 +21,7 @@ package org.chorem.pollen.services.service; * #L% */ +import com.google.common.base.Joiner; import org.apache.commons.collections4.CollectionUtils; import org.chorem.pollen.persistence.entity.Choice; import org.chorem.pollen.persistence.entity.ChoiceType; @@ -382,6 +383,10 @@ public class PollService extends PollenServiceSupport { toSave.setMaxChoiceNumber(poll.getMaxChoiceNumber()); toSave.setTitle(poll.getTitle()); toSave.setChoiceType(poll.getChoiceType()); + toSave.setWithMe(poll.isWithMe()); + if (poll.withParticipants()) { + toSave.setParticipants(Joiner.on(' ').join(poll.getParticipants())); + } toSave.setBeginDate(poll.getBeginDate()); toSave.setEndDate(poll.getEndDate()); diff --git a/pollen-ui-riot-js/src/main/web/i18n.json b/pollen-ui-riot-js/src/main/web/i18n.json index 46bfa32..245084e 100644 --- a/pollen-ui-riot-js/src/main/web/i18n.json +++ b/pollen-ui-riot-js/src/main/web/i18n.json @@ -131,6 +131,7 @@ "poll_settings_voteVisibility_voter": "Les participants", "poll_settings_nav_poll": "Sondage", "poll_settings_nav_result": "Résultats", + "poll_settings_nav_voters": "Participants", "poll_settings_nav_votePeriod": "Période de vote", "poll_settings_nav_resultVisibility": "Visibilité des résultats", "poll_settings_nav_continuousResult": "Résultats continus", @@ -146,6 +147,8 @@ "poll_settings_poll_configuration": "Configuration du sondage", "poll_settings_continuousResult": "Voir les résultats en continue", "poll_settings_choicesConfiguration": "Configuration des choix", + "poll_settings_votersConfiguration": "Configuration des participants", + "poll_settings_voters": "Renseigner la liste des participants", "poll_settings_addChoices": "Est-ce que les participants peuvent ajouter des choix ?", "poll_settings_limitChoices": "Limiter le nombre de choix par vote", "poll_settings_votesConfiguration": "Configuration des votes", @@ -165,6 +168,10 @@ "poll_settings_maxChoiceNumber": "Nombre maximum de choix", "poll_settings_nav_pollTitle": "Titre", "poll_settings_nav_pollDescription": "Description", + "poll_settings_nav_votersPrivacy": "Qui peut voter ?", + "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_label": "Choix", "poll_choices_description": "Description", "poll_choices_previous": "Précédent", @@ -344,6 +351,7 @@ "poll_settings_nav_poll": "Poll", "poll_settings_nav_votePeriod": "Vote period", "poll_settings_nav_result": "Results", + "poll_settings_nav_voters": "Voters", "poll_settings_nav_resultVisibility": "Visibility", "poll_settings_nav_continuousResult": "Continuous", "poll_settings_nav_choices": "Choices", @@ -358,7 +366,9 @@ "poll_settings_poll_configuration": "Poll configuration", "poll_settings_nav_pollTitle": "Title", "poll_settings_nav_pollDescription": "Description", - + "poll_settings_votersConfiguration": "Voters configuration", + "poll_settings_voters": "Fill voters separated by space", + "poll_settings_nav_votersPrivacy": "Who can vote?", "poll_settings_resultsConfiguration": "Results configuration", "poll_settings_continuousResult": "Use continuous results", "poll_settings_choicesConfiguration": "Choices configuration", @@ -378,6 +388,9 @@ "poll_settings_beginChoiceDate": "Begin choice date", "poll_settings_endChoiceDate": "End choice date", "poll_settings_maxChoiceNumber": "Maximum number of choices", + "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_label": "Choice", "poll_choices_description": "Description", "poll_choices_previous": "Previous", diff --git a/pollen-ui-riot-js/src/main/web/js/PollForm.js b/pollen-ui-riot-js/src/main/web/js/PollForm.js index 6644259..3525e7a 100644 --- a/pollen-ui-riot-js/src/main/web/js/PollForm.js +++ b/pollen-ui-riot-js/src/main/web/js/PollForm.js @@ -111,6 +111,10 @@ class PollForm { fromDom(form) { let map = this.FormHelper.formToMap(form); + let voters = form.participants.value; + if (voters) { + map.participants = voters.split('/s'); + } Object.assign(this.model, map); console.info('dom to model'); console.info(map); @@ -129,6 +133,13 @@ class PollForm { console.info('fill form from model'); console.info(this.model); this.FormHelper.fillForm(form, this.model); + if (this.model.participants && this.model.participants.length) { + let participants = ''; + this.model.participants.forEach(p=> { + participants+=' '+p; + }); + form.participants.value =participants.trim(); + } } fromDomToChoices(form) { diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/PollChoiceDate.tag b/pollen-ui-riot-js/src/main/web/tag/poll/ChoiceDate.tag similarity index 99% rename from pollen-ui-riot-js/src/main/web/tag/poll/PollChoiceDate.tag rename to pollen-ui-riot-js/src/main/web/tag/poll/ChoiceDate.tag index 9faa89e..0d20d23 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/PollChoiceDate.tag +++ b/pollen-ui-riot-js/src/main/web/tag/poll/ChoiceDate.tag @@ -18,7 +18,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * #L% */ -<PollChoiceDate> +<ChoiceDate> <div class="choice-body"> @@ -244,4 +244,4 @@ } </style> -</PollChoiceDate> +</ChoiceDate> diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/PollChoiceText.tag b/pollen-ui-riot-js/src/main/web/tag/poll/ChoiceText.tag similarity index 99% rename from pollen-ui-riot-js/src/main/web/tag/poll/PollChoiceText.tag rename to pollen-ui-riot-js/src/main/web/tag/poll/ChoiceText.tag index 695faad..7359bd1 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/PollChoiceText.tag +++ b/pollen-ui-riot-js/src/main/web/tag/poll/ChoiceText.tag @@ -18,7 +18,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * #L% */ -<PollChoiceText> +<ChoiceText> <div class="choice-body"> @@ -173,4 +173,4 @@ } </style> -</PollChoiceText> +</ChoiceText> diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/PollChoices.tag b/pollen-ui-riot-js/src/main/web/tag/poll/Choices.tag similarity index 98% rename from pollen-ui-riot-js/src/main/web/tag/poll/PollChoices.tag rename to pollen-ui-riot-js/src/main/web/tag/poll/Choices.tag index 5980894..f1d6fec 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/PollChoices.tag +++ b/pollen-ui-riot-js/src/main/web/tag/poll/Choices.tag @@ -1,6 +1,6 @@ -require('./PollChoiceText.tag'); -require('./PollChoiceDate.tag'); -<PollChoices> +require('./ChoiceText.tag'); +require('./ChoiceDate.tag'); +<Choices> <div if="{choicePeriod}" class="legend"> {__.choicePeriod} {choicePeriod} </div> @@ -141,7 +141,7 @@ require('./PollChoiceDate.tag'); choiceDom.id = 'choice_' + choiceNumber; this.refs.choicesContainer.appendChild(choiceDom); - let tag = riot.mount(choiceDom, 'pollchoice' + this.form.choiceType, { + let tag = riot.mount(choiceDom, 'choice' + this.form.choiceType, { number: choiceNumber, choice: this.form.choices[choiceNumber] || {choiceValue: '', description: ''}, mode: this.form.mode, @@ -301,4 +301,4 @@ require('./PollChoiceDate.tag'); margin: 5px; } </style> -</PollChoices> \ No newline at end of file +</Choices> \ No newline at end of file diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/PollComments.tag b/pollen-ui-riot-js/src/main/web/tag/poll/Comments.tag similarity index 99% rename from pollen-ui-riot-js/src/main/web/tag/poll/PollComments.tag rename to pollen-ui-riot-js/src/main/web/tag/poll/Comments.tag index ba77c32..f71dfeb 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/PollComments.tag +++ b/pollen-ui-riot-js/src/main/web/tag/poll/Comments.tag @@ -1,7 +1,7 @@ require('../Pagination.tag'); require('./CommentPopup.tag'); -<PollComments> +<Comments> <div class="comment-container"> <div class="actions"> <a class="button mainColorBackground" onclick="{openAddComment}"><i class="fa fa-plus"/> {__.addComment}</a> @@ -240,4 +240,4 @@ require('./CommentPopup.tag'); } </style> -</PollComments> \ No newline at end of file +</Comments> \ No newline at end of file diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/CreatePoll.tag b/pollen-ui-riot-js/src/main/web/tag/poll/CreatePoll.tag index af39329..d6fb2a4 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/CreatePoll.tag +++ b/pollen-ui-riot-js/src/main/web/tag/poll/CreatePoll.tag @@ -18,11 +18,11 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * #L% */ -require("./PollDescription.tag"); -require("./PollChoices.tag"); -require("./PollSettings.tag"); -require("./PollVoters.tag"); -require("./PollCreated.tag"); +require("./Description.tag"); +require("./Choices.tag"); +require("./Settings.tag"); +require("./Voters.tag"); +require("./Created.tag"); <CreatePoll> <div> @@ -128,11 +128,11 @@ require("./PollCreated.tag"); this.session = require("../../js/Session"); this.form.choiceType = opts.choiceType; this.steps = { - 0: 'polldescription', - 1: 'pollchoices', - 2: 'pollsettings', - 3: 'pollvoters', - 4: 'pollcreated' + 0: 'description', + 1: 'choices', + 2: 'settings', + 3: 'voters', + 4: 'created' }; this.installBundle(this.session, "poll"); diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/PollCreated.tag b/pollen-ui-riot-js/src/main/web/tag/poll/Created.tag similarity index 98% rename from pollen-ui-riot-js/src/main/web/tag/poll/PollCreated.tag rename to pollen-ui-riot-js/src/main/web/tag/poll/Created.tag index 2097d33..7cb86b5 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/PollCreated.tag +++ b/pollen-ui-riot-js/src/main/web/tag/poll/Created.tag @@ -18,7 +18,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * #L% */ -<PollCreated> +<Created> <div class="container"> @@ -61,4 +61,4 @@ } </style> -</PollCreated> +</Created> diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/PollDescription.tag b/pollen-ui-riot-js/src/main/web/tag/poll/Description.tag similarity index 98% rename from pollen-ui-riot-js/src/main/web/tag/poll/PollDescription.tag rename to pollen-ui-riot-js/src/main/web/tag/poll/Description.tag index e8af01f..4e3f599 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/PollDescription.tag +++ b/pollen-ui-riot-js/src/main/web/tag/poll/Description.tag @@ -18,7 +18,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * #L% */ -<PollDescription> +<Description> <form onsubmit="{nextStep}"> <label for="title">{__.title}</label> <input ref="title" type="text" required name="title" value="{model.title}" placeholder="{__.titlePlaceHolder}"> @@ -76,4 +76,4 @@ margin: 5px; } </style> -</PollDescription> +</Description> 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 e318032..414c398 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 @@ -1,8 +1,8 @@ -require('./PollVotes.tag'); -require('./PollComments.tag'); -require('./PollResults.tag'); -require('./PollChoices.tag'); -require('./PollSettings.tag'); +require('./Votes.tag'); +require('./Comments.tag'); +require('./Results.tag'); +require('./Choices.tag'); +require('./Settings.tag'); <Poll> @@ -94,7 +94,7 @@ require('./PollSettings.tag'); this.refresh = () => { this.withResults = this.poll.continuousResults || this.poll.isClosed; - let tags = riot.mount(this.refs.content, "poll" + this.selectedTab, { + let tags = riot.mount(this.refs.content, this.selectedTab, { pollId: this.pollId, poll: this.poll, session: session, diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/PollResults.tag b/pollen-ui-riot-js/src/main/web/tag/poll/Results.tag similarity index 99% rename from pollen-ui-riot-js/src/main/web/tag/poll/PollResults.tag rename to pollen-ui-riot-js/src/main/web/tag/poll/Results.tag index feb0406..e5442c1 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/PollResults.tag +++ b/pollen-ui-riot-js/src/main/web/tag/poll/Results.tag @@ -1,4 +1,4 @@ -<PollResults> +<Results> <div class="result-container"> <div class="legend"> {__.title} @@ -105,4 +105,4 @@ } </style> -</PollResults> \ No newline at end of file +</Results> \ No newline at end of file diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/PollSettings.tag b/pollen-ui-riot-js/src/main/web/tag/poll/Settings.tag similarity index 87% rename from pollen-ui-riot-js/src/main/web/tag/poll/PollSettings.tag rename to pollen-ui-riot-js/src/main/web/tag/poll/Settings.tag index 4b5bc0e..158a328 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/PollSettings.tag +++ b/pollen-ui-riot-js/src/main/web/tag/poll/Settings.tag @@ -18,7 +18,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * #L% */ -<PollSettings> +<Settings> <div if="{mode==='create'}" class="legend"> {__.basic_usage} @@ -42,62 +42,24 @@ <ul id="sidebar" class="nav nav-stacked"> <li if="{mode==='edit'}"> <a onclick="{scrollTo}" href="#Poll">{__.nav_poll}</a> - <ul class="nav nav-stacked"> - <li> - <a onclick="{scrollTo}" href="#Poll_title">{__.nav_pollTitle}</a> - </li> - <li> - <a onclick="{scrollTo}" href="#Poll_description">{__.nav_pollDescription}</a> - </li> - </ul> </li> <li> <a onclick="{scrollTo}" href="#Choice">{__.nav_choices}</a> - <ul class="nav nav-stacked"> - <li> - <a onclick="{scrollTo}" href="#Choice_addChoices">{__.nav_addChoices}</a> - </li> - <li> - <a onclick="{scrollTo}" href="#Choice_limitChoices">{__.nav_limitChoices}</a> - </li> - </ul> </li> <li> <a onclick="{scrollTo}" href="#VoteCountingType">{__.nav_voteCountingType}</a> </li> <li> <a onclick="{scrollTo}" href="#Vote">{__.nav_votes}</a> - <ul class="nav nav-stacked"> - <li> - <a onclick="{scrollTo}" href="#Vote_period">{__.nav_votePeriod}</a> - </li> - <li> - <a onclick="{scrollTo}" href="#Vote_visibility">{__.nav_voteVisibility}</a> - </li> - <li> - <a onclick="{scrollTo}" href="#Vote_anonymous">{__.nav_anonymousVote}</a> - </li> - </ul> </li> <li> <a onclick="{scrollTo}" href="#Result">{__.nav_result}</a> - <ul class="nav nav-stacked"> - <li> - <a onclick="{scrollTo}" href="#Result_visibility">{__.nav_resultVisibility}</a> - </li> - <li> - <a onclick="{scrollTo}" - href="#Result_continuous">{__.nav_continuousResult}</a> - </li> - </ul> </li> <li> <a onclick="{scrollTo}" href="#Comment">{__.nav_comments}</a> - <ul class="nav nav-stacked"> - <li> - <a onclick="{scrollTo}" href="#Comment_visibility">{__.nav_commentVisibility}</a> - </li> - </ul> + </li> + <li if="{mode==='edit'}"> + <a onclick="{scrollTo}" href="#Voter">{__.nav_voters}</a> </li> </ul> </nav> @@ -264,7 +226,6 @@ <div class="config-form checkbox {session.locale}"> <input type="checkbox" name="continuousResults" id="continuousResults"> <label for="continuousResults"></label> - </div> </div> </div> @@ -292,6 +253,44 @@ </div> </div> </div> + <div id="Voter" class="config-group"> + <div class="config-header">{__.votersConfiguration}</div> + <div id="Voter_privacy"> + <div class="config-subheader">{__.nav_votersPrivacy}<i class="fa fa-info-circle" + onclick="{help}"></i></div> + <div class="config-form"> + <div class="mainOptionsDiv"> + <input type="radio" name="pollType" ref="publicType" value='FREE' + onclick="{publicPoll}"> + {__.freePoll} + </div> + <div> + <div class="mainOptionsDiv"> + <input type="radio" ref="privateType" name="pollType" value='RESTRICTED' + onclick="{privatePoll}"> + {__.restrictedPoll} + </div> + <div show="{$private}" class="privateOptions"> + <div> + {__.restrictedPoll_withMe} + </div> + <div class="checkbox {session.locale}"> + <input type="checkbox" name="withMe" id="withMe"> + <label for="withMe"></label> + </div> + </div> + </div> + </div> + </div> + <div id="Voter_members"> + <div class="config-subheader">{__.nav_voters}<i class="fa fa-info-circle" + onclick="{help}"></i></div> + <div class="config-description">{__.voters}</div> + <div class="config-form"> + <textarea refs="participants" name="participants"/> + </div> + </div> + </div> </div> <div show="{showHelp}" ref="help" class="help"> <div class="config-header">{__.help} @@ -326,6 +325,8 @@ this.showOptions = true; } + this.$private = this.form.model.pollType != 'FREE'; + this.installBundle(opts.session, "poll_settings"); this.showHelp = false; @@ -348,6 +349,26 @@ this.refs.voteCountingTypeHelp.innerHTML = e.target.getAttribute('help'); }; + this.publicPoll = () => { + if (this.form.model.pollType != 'FREE') { + this.form.model.pollType = 'FREE'; + this.form.model.withMe = false; + this.$private = false; + this.update(); + } + }; + this.privatePoll = () => { + if (this.form.model.pollType != 'RESTRICTED') { + this.form.model.pollType = 'RESTRICTED'; + this.$private = true; + this.update(); + } + }; + + this.withMe = (e) => { + this.form.model.withMe = !this.form.model.withMe; + }; + this.help = e => { let target = e.target; let helpId = 'Help_' + target.parentNode.parentNode.id; @@ -432,6 +453,31 @@ width: 800px; } + textarea { + width: 95%; + height: 150px; + } + + .mainOptionsDiv > input, .privateOptions > div > input { + display: inline; + width: 30px; + margin: 0; + padding: 0; + height: 16px; + } + + .privateOptions { + display: flex; + flex-direction: row; + justify-content: flex-start; + padding-left: 30px; + } + + .privateOptions > div { + align-self: center; + margin: 0; + } + .text { width: 95%; } @@ -717,4 +763,4 @@ /*justify-content: space-around;*/ } </style> -</PollSettings> +</Settings> diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/PollVoters.tag b/pollen-ui-riot-js/src/main/web/tag/poll/Voters.tag similarity index 99% rename from pollen-ui-riot-js/src/main/web/tag/poll/PollVoters.tag rename to pollen-ui-riot-js/src/main/web/tag/poll/Voters.tag index 2db58a6..f45c772 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/PollVoters.tag +++ b/pollen-ui-riot-js/src/main/web/tag/poll/Voters.tag @@ -18,7 +18,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * #L% */ -<PollVoters> +<Voters> <form onsubmit="{action}"> <div class="legend"> @@ -202,4 +202,4 @@ } </style> -</PollVoters> +</Voters> diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/PollVotes.tag b/pollen-ui-riot-js/src/main/web/tag/poll/Votes.tag similarity index 99% rename from pollen-ui-riot-js/src/main/web/tag/poll/PollVotes.tag rename to pollen-ui-riot-js/src/main/web/tag/poll/Votes.tag index de25c1a..56e17a7 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/PollVotes.tag +++ b/pollen-ui-riot-js/src/main/web/tag/poll/Votes.tag @@ -1,4 +1,4 @@ -<PollVotes> +<Votes> <div class="vote-container"> <div class="legend"> {__.title} {votePeriod} @@ -463,4 +463,4 @@ margin-top: 10px; } </style> -</PollVotes> \ No newline at end of file +</Votes> \ No newline at end of file -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm