summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
Diffstat (limited to 'client')
-rw-r--r--client/components/cards/cardDetails.jade10
-rw-r--r--client/components/cards/cardDetails.js22
-rw-r--r--client/components/cards/checklists.styl2
-rw-r--r--client/components/cards/minicard.jade4
-rw-r--r--client/components/cards/minicard.styl5
5 files changed, 20 insertions, 23 deletions
diff --git a/client/components/cards/cardDetails.jade b/client/components/cards/cardDetails.jade
index 2aa77627..dda95e3e 100644
--- a/client/components/cards/cardDetails.jade
+++ b/client/components/cards/cardDetails.jade
@@ -220,8 +220,14 @@ template(name="cardDetails")
+viewer
= getVoteQuestion
if showVotingButtons
- button.card-details-green.js-vote.js-vote-positive(class="{{#if voteState}}voted{{/if}}") {{_ 'vote-for-it'}}
- button.card-details-red.js-vote.js-vote-negative(class="{{#if $eq voteState false}}voted{{/if}}") {{_ 'vote-against'}}
+ button.card-details-green.js-vote.js-vote-positive(class="{{#if voteState}}voted{{/if}}")
+ if voteState
+ i.fa.fa-thumbs-up
+ {{_ 'vote-for-it'}}
+ button.card-details-red.js-vote.js-vote-negative(class="{{#if $eq voteState false}}voted{{/if}}")
+ if $eq voteState false
+ i.fa.fa-thumbs-down
+ {{_ 'vote-against'}}
//- XXX We should use "editable" to avoid repetiting ourselves
if canModifyCard
diff --git a/client/components/cards/cardDetails.js b/client/components/cards/cardDetails.js
index 11e010d4..a91d9b6e 100644
--- a/client/components/cards/cardDetails.js
+++ b/client/components/cards/cardDetails.js
@@ -38,22 +38,6 @@ BlazeComponent.extendComponent({
Meteor.subscribe('unsaved-edits');
},
- voteState() {
- const card = this.currentData();
- const userId = Meteor.userId();
- let state;
- if (card.vote) {
- if (card.vote.positive) {
- state = _.contains(card.vote.positive, userId);
- if (state === true) return true;
- }
- if (card.vote.negative) {
- state = _.contains(card.vote.negative, userId);
- if (state === true) return false;
- }
- }
- return null;
- },
isWatching() {
const card = this.currentData();
return card.findWatcher(Meteor.userId());
@@ -412,9 +396,9 @@ BlazeComponent.extendComponent({
const forIt = $(e.target).hasClass('js-vote-positive');
let newState = null;
if (
- this.voteState() === null ||
- (this.voteState() === false && forIt) ||
- (this.voteState() === true && !forIt)
+ this.data().voteState() === null ||
+ (this.data().voteState() === false && forIt) ||
+ (this.data().voteState() === true && !forIt)
) {
newState = forIt;
}
diff --git a/client/components/cards/checklists.styl b/client/components/cards/checklists.styl
index 0f4e7d33..e9b0fcd8 100644
--- a/client/components/cards/checklists.styl
+++ b/client/components/cards/checklists.styl
@@ -112,6 +112,8 @@ textarea.js-add-checklist-item, textarea.js-edit-checklist-item
opacity: 0
height: 0
transition: height 0ms 0ms, opacity 600ms 0ms
+ margin-top: 0
+ margin-bottom: 0
&.placeholder
background: darken(white, 20%)
diff --git a/client/components/cards/minicard.jade b/client/components/cards/minicard.jade
index 8afe1976..03511e0a 100644
--- a/client/components/cards/minicard.jade
+++ b/client/components/cards/minicard.jade
@@ -106,9 +106,9 @@ template(name="minicard")
span.badge-icon.fa.fa-align-left
if getVoteQuestion
.badge.badge-state-image-only(title=getVoteQuestion)
- span.badge-icon.fa.fa-thumbs-up
+ span.badge-icon.fa.fa-thumbs-up(class="{{#if voteState}}text-green{{/if}}")
span.badge-text {{ voteCountPositive }}
- span.badge-icon.fa.fa-thumbs-down
+ span.badge-icon.fa.fa-thumbs-down(class="{{#if $eq voteState false}}text-red{{/if}}")
span.badge-text {{ voteCountNegative }}
if attachments.count
.badge
diff --git a/client/components/cards/minicard.styl b/client/components/cards/minicard.styl
index 1a923a68..1f40e883 100644
--- a/client/components/cards/minicard.styl
+++ b/client/components/cards/minicard.styl
@@ -301,3 +301,8 @@ minicard-color(background, color...)
.minicard-indigo
minicard-color(#4b0082, #ffffff) //White text for better visibility
+
+.text-red
+ color:red
+.text-green
+ color:green