Add a UI to restore archived cards

This commit is contained in:
Maxime Quandalle 2015-06-07 18:55:26 +02:00
parent 915a7e5c68
commit 98d7278d08
17 changed files with 137 additions and 84 deletions

View file

@ -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'}}

View file

@ -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({

View file

@ -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

View file

@ -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');

View file

@ -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'}}">