summaryrefslogtreecommitdiffstats
path: root/client/components/cards
diff options
context:
space:
mode:
authorMaxime Quandalle <maxime@quandalle.com>2015-06-07 18:55:26 +0200
committerMaxime Quandalle <maxime@quandalle.com>2015-06-07 18:55:26 +0200
commit98d7278d08dabc9e1da5dcd9a9bb968ab369520e (patch)
treefcb2d6e8459a65596b611bf833ab5e458524c2bb /client/components/cards
parent915a7e5c6865548ee3664ec67f328f815480a761 (diff)
downloadwekan-98d7278d08dabc9e1da5dcd9a9bb968ab369520e.tar.gz
wekan-98d7278d08dabc9e1da5dcd9a9bb968ab369520e.tar.bz2
wekan-98d7278d08dabc9e1da5dcd9a9bb968ab369520e.zip
Add a UI to restore archived cards
Diffstat (limited to 'client/components/cards')
-rw-r--r--client/components/cards/details.jade9
-rw-r--r--client/components/cards/details.js7
-rw-r--r--client/components/cards/minicard.jade54
-rw-r--r--client/components/cards/minicard.js36
-rw-r--r--client/components/cards/templates.html5
5 files changed, 38 insertions, 73 deletions
diff --git a/client/components/cards/details.jade b/client/components/cards/details.jade
index 46929f56..5ee962cd 100644
--- a/client/components/cards/details.jade
+++ b/client/components/cards/details.jade
@@ -74,8 +74,9 @@ template(name="cardDetailsActionsPopup")
li: a.js-attachments Edit Attachments…
hr
ul.pop-over-list
- li: a.js-copy Copy card
+ li: a.js-copy Copy Card
li: a.js-archive Archive Card
+ li: a.js-delete Delete Card
template(name="moveCardPopup")
+boardLists
@@ -103,3 +104,9 @@ template(name="cardLabelsPopup")
if currentUser.isBoardAdmin
span.card-label-selectable-icon.fa.fa-check
a.quiet-button.full.js-add-label {{_ 'label-create'}}
+
+template(name="cardDeletePopup")
+ p {{_ "card-delete-pop"}}
+ unless archived
+ p {{_ "card-delete-suggest-archive"}}
+ button.js-confirm.negate.full(type="submit") {{_ 'delete'}}
diff --git a/client/components/cards/details.js b/client/components/cards/details.js
index 3f141622..f3d03793 100644
--- a/client/components/cards/details.js
+++ b/client/components/cards/details.js
@@ -77,7 +77,12 @@ Template.cardDetailsActionsPopup.events({
}
});
Popup.close();
- }
+ },
+ 'click .js-delete': Popup.afterConfirm('cardDelete', function() {
+ var cardId = this._id;
+ Cards.remove(cardId);
+ Popup.close();
+ })
});
Template.moveCardPopup.events({
diff --git a/client/components/cards/minicard.jade b/client/components/cards/minicard.jade
index ad51ce22..efca9673 100644
--- a/client/components/cards/minicard.jade
+++ b/client/components/cards/minicard.jade
@@ -1,31 +1,25 @@
template(name="minicard")
- a.minicard-wrapper.js-minicard(href=absoluteUrl
- class="{{#if isSelected}}is-selected{{/if}}"
- class="{{#if MultiSelection.isSelected _id}}is-checked{{/if}}")
- if MultiSelection.isActive
- .materialCheckBox.multi-selection-checkbox.js-toggle-multi-selection(
- class="{{#if MultiSelection.isSelected _id}}is-checked{{/if}}")
- .minicard
- if cover
- .minicard-cover.js-card-cover(style="background-image: url({{cover.url}});")
- if labels
- .minicard-labels
- each labels
- .minicard-label(class="card-label-{{color}}" title="{{name}}")
- .minicard-title= title
- if members
- .minicard-members.js-minicard-members
- each members
- +userAvatar(userId=this size="small" cardId="{{../_id}}")
- .badges
- if comments.count
- .badge(title="{{_ 'card-comments-title' comments.count }}")
- span.badge-icon.fa.fa-comment-o
- .badge-text= comments.count
- if description
- .badge.badge-state-image-only(title=description)
- span.badge-icon.fa.fa-align-left
- if attachments.count
- .badge
- span.badge-icon.fa.fa-paperclip
- span.badge-text= attachments.count
+ .minicard
+ if cover
+ .minicard-cover(style="background-image: url({{cover.url}});")
+ if labels
+ .minicard-labels
+ each labels
+ .minicard-label(class="card-label-{{color}}" title="{{name}}")
+ .minicard-title= title
+ if members
+ .minicard-members.js-minicard-members
+ each members
+ +userAvatar(userId=this size="small" cardId="{{../_id}}")
+ .badges
+ if comments.count
+ .badge(title="{{_ 'card-comments-title' comments.count }}")
+ span.badge-icon.fa.fa-comment-o
+ .badge-text= comments.count
+ if description
+ .badge.badge-state-image-only(title=description)
+ span.badge-icon.fa.fa-align-left
+ if attachments.count
+ .badge
+ span.badge-icon.fa.fa-paperclip
+ span.badge-text= attachments.count
diff --git a/client/components/cards/minicard.js b/client/components/cards/minicard.js
index 8f229be8..70751152 100644
--- a/client/components/cards/minicard.js
+++ b/client/components/cards/minicard.js
@@ -5,41 +5,5 @@
BlazeComponent.extendComponent({
template: function() {
return 'minicard';
- },
-
- isSelected: function() {
- return Session.equals('currentCard', this.currentData()._id);
- },
-
- toggleMultiSelection: function(evt) {
- evt.stopPropagation();
- evt.preventDefault();
- MultiSelection.toogle(this.currentData()._id);
- },
-
- clickOnMiniCard: function(evt) {
- if (MultiSelection.isActive() || evt.shiftKey) {
- evt.stopImmediatePropagation();
- evt.preventDefault();
- var methodName = evt.shiftKey ? 'toogleRange' : 'toogle';
- MultiSelection[methodName](this.currentData()._id);
-
- // If the card is already selected, we want to de-select it.
- // XXX We should probably modify the minicard href attribute instead of
- // overwriting the event in case the card is already selected.
- } else if (Session.equals('currentCard', this.currentData()._id)) {
- evt.stopImmediatePropagation();
- evt.preventDefault();
- Utils.goBoardId(Session.get('currentBoard'));
- }
- },
-
- events: function() {
- return [{
- submit: this.addCard,
- 'click .js-toggle-multi-selection': this.toggleMultiSelection,
- 'click .js-minicard': this.clickOnMiniCard,
- 'click .open-minicard-composer': this.scrollToBottom
- }];
}
}).register('minicard');
diff --git a/client/components/cards/templates.html b/client/components/cards/templates.html
index 94d54b6b..d003f051 100644
--- a/client/components/cards/templates.html
+++ b/client/components/cards/templates.html
@@ -79,11 +79,6 @@
<input type="submit" class="js-confirm negate full" value="{{_ 'delete'}}">
</template>
-<template name="cardDeletePopup">
- <p>{{_ "card-delete-pop"}}</p>
- <input type="submit" class="js-confirm negate full" value="{{_ 'delete'}}">
-</template>
-
<template name="attachmentDeletePopup">
<p>{{_ "attachment-delete-pop"}}</p>
<input type="submit" class="js-confirm negate full" value="{{_ 'delete'}}">