summaryrefslogtreecommitdiffstats
path: root/client/components
diff options
context:
space:
mode:
authorMaxime Quandalle <maxime@quandalle.com>2015-08-22 02:06:49 +0200
committerMaxime Quandalle <maxime@quandalle.com>2015-08-22 02:06:49 +0200
commit04bfbd5bd1f7c20486c0872641506f14336c8d21 (patch)
tree93879ecef6d5b441c3854317d74cd5a283893fa4 /client/components
parent4fc72d64b4e7a41875ef0778597dc3e66741ce8c (diff)
downloadwekan-04bfbd5bd1f7c20486c0872641506f14336c8d21.tar.gz
wekan-04bfbd5bd1f7c20486c0872641506f14336c8d21.tar.bz2
wekan-04bfbd5bd1f7c20486c0872641506f14336c8d21.zip
Implement list restoration
Diffstat (limited to 'client/components')
-rw-r--r--client/components/main/layouts.styl4
-rw-r--r--client/components/sidebar/sidebar.styl14
-rw-r--r--client/components/sidebar/sidebarArchives.jade35
-rw-r--r--client/components/sidebar/sidebarArchives.js23
4 files changed, 61 insertions, 15 deletions
diff --git a/client/components/main/layouts.styl b/client/components/main/layouts.styl
index 5199da0f..5160ee8b 100644
--- a/client/components/main/layouts.styl
+++ b/client/components/main/layouts.styl
@@ -288,6 +288,10 @@ a
list-style-type: initial
padding-left: 20px
+.basicTabs-container .tabs-content-container
+ padding: 0
+ padding-top: 15px
+
@keyframes fadeIn
from
opacity: 0
diff --git a/client/components/sidebar/sidebar.styl b/client/components/sidebar/sidebar.styl
index cda15ba5..f4c4dd01 100644
--- a/client/components/sidebar/sidebar.styl
+++ b/client/components/sidebar/sidebar.styl
@@ -116,3 +116,17 @@
.board-sidebar.is-open &.is-hidden
z-index: 0
left: 5px
+
+.archived-lists .archived-lists-item
+ border-top: 1px solid darken(white, 20%)
+ clear: both
+ padding: 5px 0
+
+ &:first-child
+ border-top: none
+
+ button
+ float: right
+ margin: 0
+ margin-bottom: 5px
+ padding: 0 2px 0 10px
diff --git a/client/components/sidebar/sidebarArchives.jade b/client/components/sidebar/sidebarArchives.jade
index 6911c286..d2bd5d7b 100644
--- a/client/components/sidebar/sidebarArchives.jade
+++ b/client/components/sidebar/sidebarArchives.jade
@@ -1,12 +1,25 @@
template(name="archivesSidebar")
- each archivedCards
- .minicard-wrapper.js-minicard
- +minicard(this)
- p.quiet
- a.js-restore Restore
- | -
- a.js-delete Delete
- if cardIsInArchivedList
- p.quiet.small (warning: this card is in an archived list) <br>
- else
- p.no-items-message No archived cards.
+ +basicTabs(tabs=tabs)
+
+ +tabContent(slug="cards")
+ each archivedCards
+ .minicard-wrapper.js-minicard
+ +minicard(this)
+ p.quiet
+ a.js-restore-card Restore
+ | -
+ a.js-delete-card Delete
+ if cardIsInArchivedList
+ p.quiet.small (warning: this card is in an archived list) <br>
+ else
+ p.no-items-message No archived cards.
+
+ +tabContent(slug="lists")
+ ul.archived-lists
+ each archivedLists
+ li.archived-lists-item
+ button.js-restore-list
+ i.fa.fa-undo
+ = title
+ else
+ li.no-items-message No archived lists.
diff --git a/client/components/sidebar/sidebarArchives.js b/client/components/sidebar/sidebarArchives.js
index d422cb43..dd989ca3 100644
--- a/client/components/sidebar/sidebarArchives.js
+++ b/client/components/sidebar/sidebarArchives.js
@@ -3,8 +3,19 @@ BlazeComponent.extendComponent({
return 'archivesSidebar';
},
+ tabs: function() {
+ return [
+ { name: 'Cards', slug: 'cards' },
+ { name: 'Lists', slug: 'lists' }
+ ]
+ },
+
archivedCards: function() {
- return Cards.find({archived: true});
+ return Cards.find({ archived: true });
+ },
+
+ archivedLists: function() {
+ return Lists.find({ archived: true });
},
cardIsInArchivedList: function() {
@@ -17,15 +28,19 @@ BlazeComponent.extendComponent({
events: function() {
return [{
- 'click .js-restore': function() {
+ 'click .js-restore-card': function() {
var cardId = this.currentData()._id;
Cards.update(cardId, {$set: {archived: false}});
},
- 'click .js-delete': Popup.afterConfirm('cardDelete', function() {
+ 'click .js-delete-card': Popup.afterConfirm('cardDelete', function() {
var cardId = this._id;
Cards.remove(cardId);
Popup.close();
- })
+ }),
+ 'click .js-restore-list': function() {
+ var listId = this.currentData()._id;
+ Lists.update(listId, {$set: {archived: false}});
+ }
}];
}
}).register('archivesSidebar');