summaryrefslogtreecommitdiffstats
path: root/client/components/cards
diff options
context:
space:
mode:
authorUnknown <unknown@example.com>2020-07-21 16:11:51 +0200
committerUnknown <unknown@example.com>2020-07-21 16:11:51 +0200
commitca8f2a70a4469c961e39354b14d41841a19ad6d7 (patch)
treea24489d015d1860fa5b6c757706d0b3aecff26f7 /client/components/cards
parent232bc746f4b2d09945fdfe68e3aa14ff6f4e79f6 (diff)
parentf6e9f5a5e8423fed9eaadaf196b46273eca241d0 (diff)
downloadwekan-ca8f2a70a4469c961e39354b14d41841a19ad6d7.tar.gz
wekan-ca8f2a70a4469c961e39354b14d41841a19ad6d7.tar.bz2
wekan-ca8f2a70a4469c961e39354b14d41841a19ad6d7.zip
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'client/components/cards')
-rw-r--r--client/components/cards/cardDetails.jade10
-rw-r--r--client/components/cards/cardDetails.js22
-rw-r--r--client/components/cards/checklists.jade18
-rw-r--r--client/components/cards/checklists.js16
-rw-r--r--client/components/cards/checklists.styl16
-rw-r--r--client/components/cards/minicard.jade4
-rw-r--r--client/components/cards/minicard.styl9
7 files changed, 67 insertions, 28 deletions
diff --git a/client/components/cards/cardDetails.jade b/client/components/cards/cardDetails.jade
index 2aa77627..dabee971 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.jade b/client/components/cards/checklists.jade
index 1b1e088a..25aa11b9 100644
--- a/client/components/cards/checklists.jade
+++ b/client/components/cards/checklists.jade
@@ -1,7 +1,17 @@
template(name="checklists")
- h3
- i.fa.fa-check
- | {{_ 'checklists'}}
+ .checklists-title
+ h3
+ i.fa.fa-check
+ | {{_ 'checklists'}}
+ if currentUser.isBoardMember
+ .material-toggle-switch
+ span.toggle-switch-title {{_ 'hide-checked-items'}}
+ if hideCheckedItems
+ input.toggle-switch(type="checkbox" id="toggleHideCheckedItemsButton" checked="checked")
+ else
+ input.toggle-switch(type="checkbox" id="toggleHideCheckedItemsButton")
+ label.toggle-label(for="toggleHideCheckedItemsButton")
+
if toggleDeleteDialog.get
.board-overlay#card-details-overlay
+checklistDeleteDialog(checklist = checklistToDelete)
@@ -86,7 +96,7 @@ template(name="checklistItems")
| {{_ 'add-checklist-item'}}...
template(name='checklistItemDetail')
- .js-checklist-item.checklist-item
+ .js-checklist-item.checklist-item(class="{{#if item.isFinished }}is-checked{{#if hideCheckedItems}} invisible{{/if}}{{/if}}")
if canModifyCard
.check-box-container
.check-box.materialCheckBox(class="{{#if item.isFinished }}is-checked{{/if}}")
diff --git a/client/components/cards/checklists.js b/client/components/cards/checklists.js
index 29573d2b..17faa773 100644
--- a/client/components/cards/checklists.js
+++ b/client/components/cards/checklists.js
@@ -193,6 +193,9 @@ BlazeComponent.extendComponent({
}
this.toggleDeleteDialog.set(!this.toggleDeleteDialog.get());
},
+ 'click #toggleHideCheckedItemsButton'() {
+ Meteor.call('toggleHideCheckedItems');
+ },
};
return [
@@ -211,6 +214,14 @@ BlazeComponent.extendComponent({
},
}).register('checklists');
+Template.checklists.helpers({
+ hideCheckedItems() {
+ const currentUser = Meteor.user();
+ if (currentUser) return currentUser.hasHideCheckedItems();
+ return false;
+ },
+});
+
Template.checklistDeleteDialog.onCreated(() => {
const $cardDetails = this.$('.card-details');
this.scrollState = {
@@ -246,6 +257,11 @@ Template.checklistItemDetail.helpers({
!Meteor.user().isWorker()
);
},
+ hideCheckedItems() {
+ const user = Meteor.user();
+ if (user) return user.hasHideCheckedItems();
+ return false;
+ },
});
BlazeComponent.extendComponent({
diff --git a/client/components/cards/checklists.styl b/client/components/cards/checklists.styl
index 0a6d688b..e9b0fcd8 100644
--- a/client/components/cards/checklists.styl
+++ b/client/components/cards/checklists.styl
@@ -16,6 +16,10 @@ textarea.js-add-checklist-item, textarea.js-edit-checklist-item
&:hover
color: inherit
+.checklists-title
+ display: flex
+ justify-content: space-between
+
.checklist-title
.checkbox
float: left
@@ -99,6 +103,17 @@ textarea.js-add-checklist-item, textarea.js-edit-checklist-item
margin-top: 3px
display: flex
background: darken(white, 3%)
+ opacity: 1
+ transition: height 0ms 400ms, opacity 400ms 0ms
+ height: auto
+ overflow: hidden
+
+ &.is-checked.invisible
+ opacity: 0
+ height: 0
+ transition: height 0ms 0ms, opacity 600ms 0ms
+ margin-top: 0
+ margin-bottom: 0
&.placeholder
background: darken(white, 20%)
@@ -128,6 +143,7 @@ textarea.js-add-checklist-item, textarea.js-edit-checklist-item
&.is-checked
color: #8c8c8c
font-style: italic
+ text-decoration: line-through
& .viewer
p
margin-bottom: 2px
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 7d72a588..1f40e883 100644
--- a/client/components/cards/minicard.styl
+++ b/client/components/cards/minicard.styl
@@ -87,7 +87,9 @@
width: 11px
height: @width
border-radius: 2px
- margin-left: 3px
+ margin-right: 3px
+ margin-bottom: 3px
+
.minicard-custom-fields
display:block;
.minicard-custom-field
@@ -299,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