summaryrefslogtreecommitdiffstats
path: root/client/components/boards/router.js
diff options
context:
space:
mode:
Diffstat (limited to 'client/components/boards/router.js')
-rw-r--r--client/components/boards/router.js34
1 files changed, 34 insertions, 0 deletions
diff --git a/client/components/boards/router.js b/client/components/boards/router.js
new file mode 100644
index 00000000..6845b7f2
--- /dev/null
+++ b/client/components/boards/router.js
@@ -0,0 +1,34 @@
+Meteor.subscribe('boards');
+
+BoardSubsManager = new SubsManager();
+
+Router.route('/boards', {
+ name: 'Boards',
+ template: 'boards',
+ authenticated: true,
+ onBeforeAction: function() {
+ Session.set('currentBoard', '');
+ Filter.reset();
+ this.next();
+ }
+});
+
+Router.route('/boards/:_id/:slug', {
+ name: 'Board',
+ template: 'board',
+ onAfterAction: function() {
+ Session.set('sidebarIsOpen', true);
+ Session.set('currentWidget', 'home');
+ Session.set('menuWidgetIsOpen', false);
+ },
+ waitOn: function() {
+ var params = this.params;
+ Session.set('currentBoard', params._id);
+ Session.set('currentCard', null);
+
+ return BoardSubsManager.subscribe('board', params._id, params.slug);
+ },
+ data: function() {
+ return Boards.findOne(this.params._id);
+ }
+});