summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorNico <paetni1@gmail.com>2020-04-26 02:41:26 +0200
committerNico <paetni1@gmail.com>2020-04-26 02:41:26 +0200
commit7bb0aa74884d026bb6a0192bd2c4d0fb43f2953b (patch)
tree7f339bb25c46f856e8f37da9acf4dfb7158c0c4b /client
parentfe7398faef9670ff9a1885c37673beec148faed8 (diff)
downloadwekan-7bb0aa74884d026bb6a0192bd2c4d0fb43f2953b.tar.gz
wekan-7bb0aa74884d026bb6a0192bd2c4d0fb43f2953b.tar.bz2
wekan-7bb0aa74884d026bb6a0192bd2c4d0fb43f2953b.zip
Additional vote features
Diffstat (limited to 'client')
-rw-r--r--client/components/cards/cardDetails.jade14
-rw-r--r--client/components/cards/cardDetails.js23
-rw-r--r--client/components/cards/minicard.jade2
3 files changed, 21 insertions, 18 deletions
diff --git a/client/components/cards/cardDetails.jade b/client/components/cards/cardDetails.jade
index ae97e0e9..85425c59 100644
--- a/client/components/cards/cardDetails.jade
+++ b/client/components/cards/cardDetails.jade
@@ -212,6 +212,8 @@ template(name="cardDetails")
else
.card-label.card-label-green {{ voteCountPositive }}
.card-label.card-label-red {{ voteCountNegative }}
+ unless ($and currentBoard.isPublic voteAllowNonBoardMembers )
+ .card-label.card-label-gray {{ voteCount }} {{_ 'r-of' }} {{ currentBoard.activeMembers.length }}
+viewer
= getVoteQuestion
button.card-details-green.js-vote.js-vote-positive(class="{{#if voteState}}voted{{/if}}") {{_ 'vote-for-it'}}
@@ -572,9 +574,17 @@ template(name="cardStartVotingPopup")
.fields
label(for="vote") {{_ 'vote-question'}}
input.js-vote-field#vote(type="text" name="vote" value="{{card.getVoteQuestion}}" autofocus)
- label(for="vote-public") {{_ 'vote-public'}}
- a.js-toggle-vote-public
+ .check-div
+ a.flex.js-toggle-vote-public
.materialCheckBox#vote-public(name="vote-public")
+ span {{_ 'vote-public'}}
+ .check-div
+ a.flex.js-toggle-vote-allow-non-members
+ .materialCheckBox#vote-allow-non-members(name="vote-allow-non-members")
+ span {{_ 'allowNonBoardMembers'}}
+ //- label(for="vote-public") {{_ 'vote-public'}}
+ //- a.js-toggle-vote-public
+ //- .materialCheckBox#vote-public(name="vote-public")
button.primary.confirm.js-submit {{_ 'save'}}
//- button.js-remove-color.negate.wide.right {{_ 'delete'}}
diff --git a/client/components/cards/cardDetails.js b/client/components/cards/cardDetails.js
index f31c3890..b8c7fa3f 100644
--- a/client/components/cards/cardDetails.js
+++ b/client/components/cards/cardDetails.js
@@ -54,21 +54,7 @@ BlazeComponent.extendComponent({
}
return null;
},
- votePublic() {
- const card = this.currentData();
- if (card.vote) return card.vote.public;
- return null;
- },
- voteCountPositive() {
- const card = this.currentData();
- if (card.vote && card.vote.positive) return card.vote.positive.length;
- return null;
- },
- voteCountNegative() {
- const card = this.currentData();
- if (card.vote && card.vote.negative) return card.vote.negative.length;
- return null;
- },
+
isWatching() {
const card = this.currentData();
return card.findWatcher(Meteor.userId());
@@ -1001,13 +987,18 @@ BlazeComponent.extendComponent({
evt.preventDefault();
const voteQuestion = evt.target.vote.value;
const publicVote = $('#vote-public').hasClass('is-checked');
- this.currentCard.setVoteQuestion(voteQuestion, publicVote);
+ const allowNonBoardMembers = $('#vote-allow-non-members').hasClass('is-checked');
+ this.currentCard.setVoteQuestion(voteQuestion, publicVote,allowNonBoardMembers);
Popup.close();
},
'click a.js-toggle-vote-public'(event) {
event.preventDefault();
$('#vote-public').toggleClass('is-checked');
},
+ 'click a.js-toggle-vote-allow-non-members'(event) {
+ event.preventDefault();
+ $('#vote-allow-non-members').toggleClass('is-checked');
+ },
},
];
},
diff --git a/client/components/cards/minicard.jade b/client/components/cards/minicard.jade
index b6ccd4d7..79dd9127 100644
--- a/client/components/cards/minicard.jade
+++ b/client/components/cards/minicard.jade
@@ -103,7 +103,9 @@ template(name="minicard")
if getVoteQuestion
.badge.badge-state-image-only(title=getVoteQuestion)
span.badge-icon.fa.fa-thumbs-up
+ span.badge-text {{ voteCountPositive }}
span.badge-icon.fa.fa-thumbs-down
+ span.badge-text {{ voteCountNegative }}
if attachments.count
.badge
span.badge-icon.fa.fa-paperclip