sidebarArchives.js 1004 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. BlazeComponent.extendComponent({
  2. template() {
  3. return 'archivesSidebar';
  4. },
  5. tabs() {
  6. return [
  7. { name: TAPi18n.__('cards'), slug: 'cards' },
  8. { name: TAPi18n.__('lists'), slug: 'lists' },
  9. ];
  10. },
  11. archivedCards() {
  12. return Cards.find({ archived: true });
  13. },
  14. archivedLists() {
  15. return Lists.find({ archived: true });
  16. },
  17. cardIsInArchivedList() {
  18. return this.currentData().list().archived;
  19. },
  20. onRendered() {
  21. // XXX We should support dragging a card from the sidebar to the board
  22. },
  23. events() {
  24. return [{
  25. 'click .js-restore-card'() {
  26. const card = this.currentData();
  27. card.restore();
  28. },
  29. 'click .js-delete-card': Popup.afterConfirm('cardDelete', function() {
  30. const cardId = this._id;
  31. Cards.remove(cardId);
  32. Popup.close();
  33. }),
  34. 'click .js-restore-list'() {
  35. const list = this.currentData();
  36. list.restore();
  37. },
  38. }];
  39. },
  40. }).register('archivesSidebar');