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

@ -4,7 +4,8 @@ var defaultView = 'home';
var viewTitles = {
filter: 'filter-cards',
multiselection: 'multi-selection'
multiselection: 'multi-selection',
archives: 'archives'
};
BlazeComponent.extendComponent({

View file

@ -8,7 +8,7 @@
.sidebar-content
padding: 12px
background: white
background: darken(white, 3%)
box-shadow: -10px 0px 5px -10px darken(white, 30%)
z-index: 10
position: absolute
@ -73,7 +73,7 @@
position: absolute
top: 12px
z-index: 15
background: white
background: darken(white, 3%)
border-radius: left 3px
box-shadow: -4px 0px 7px -4px darken(white, 30%)
color: darken(white, 50%)

View file

@ -0,0 +1,10 @@
template(name="archivesSidebar")
each archivedCards
.minicard-wrapper.js-minicard
+minicard(this)
p.quiet
a.js-restore Restore
| -
a.js-delete Delete
else
p.no-items-message No archived cards.

View file

@ -0,0 +1,26 @@
BlazeComponent.extendComponent({
template: function() {
return 'archivesSidebar';
},
archivedCards: function() {
return Cards.find({archived: true});
},
onRendered: function() {
//XXX We should support dragging a card from the sidebar to the board
},
events: function() {
return [{
'click .js-restore': function() {
var cardId = this.currentData()._id;
Cards.update(cardId, {$set: {archived: false}});
},
'click .js-delete': Popup.afterConfirm('cardDelete', function() {
var cardId = this._id;
Cards.remove(cardId);
Popup.close();
})
}];
}
}).register('archivesSidebar');