summaryrefslogtreecommitdiffstats
path: root/client/components/sidebar
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/sidebar
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/sidebar')
-rw-r--r--client/components/sidebar/sidebar.js3
-rw-r--r--client/components/sidebar/sidebar.styl4
-rw-r--r--client/components/sidebar/sidebarArchives.jade10
-rw-r--r--client/components/sidebar/sidebarArchives.js26
4 files changed, 40 insertions, 3 deletions
diff --git a/client/components/sidebar/sidebar.js b/client/components/sidebar/sidebar.js
index cfd38c89..7da67476 100644
--- a/client/components/sidebar/sidebar.js
+++ b/client/components/sidebar/sidebar.js
@@ -4,7 +4,8 @@ var defaultView = 'home';
var viewTitles = {
filter: 'filter-cards',
- multiselection: 'multi-selection'
+ multiselection: 'multi-selection',
+ archives: 'archives'
};
BlazeComponent.extendComponent({
diff --git a/client/components/sidebar/sidebar.styl b/client/components/sidebar/sidebar.styl
index 57cc85fd..813e263a 100644
--- a/client/components/sidebar/sidebar.styl
+++ b/client/components/sidebar/sidebar.styl
@@ -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%)
diff --git a/client/components/sidebar/sidebarArchives.jade b/client/components/sidebar/sidebarArchives.jade
new file mode 100644
index 00000000..efd70fd4
--- /dev/null
+++ b/client/components/sidebar/sidebarArchives.jade
@@ -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.
diff --git a/client/components/sidebar/sidebarArchives.js b/client/components/sidebar/sidebarArchives.js
new file mode 100644
index 00000000..b106f705
--- /dev/null
+++ b/client/components/sidebar/sidebarArchives.js
@@ -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');