mirror of https://github.com/wekan/wekan
The Open Source kanban (built with Meteor). Keep variable/table/field names camelCase. For translations, only add Pull Request changes to wekan/i18n/en.i18n.json , other translations are done at https://transifex.com/wekan/wekan only.
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
1.4 KiB
58 lines
1.4 KiB
Meteor.subscribe('boards');
|
|
|
|
var 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() {
|
|
// XXX We probably shouldn't rely on Session
|
|
Session.set('sidebarIsOpen', true);
|
|
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);
|
|
}
|
|
});
|
|
|
|
Router.route('/boards/:boardId/:slug/:cardId', {
|
|
name: 'Card',
|
|
template: 'board',
|
|
noEscapeActions: true,
|
|
onAfterAction: function() {
|
|
Tracker.nonreactive(function() {
|
|
if (! Session.get('currentCard') && Sidebar) {
|
|
Sidebar.hide();
|
|
}
|
|
});
|
|
EscapeActions.executeUpTo('popup');
|
|
var params = this.params;
|
|
Session.set('currentBoard', params.boardId);
|
|
Session.set('currentCard', params.cardId);
|
|
},
|
|
waitOn: function() {
|
|
var params = this.params;
|
|
return boardSubsManager.subscribe('board', params.boardId, params.slug);
|
|
},
|
|
data: function() {
|
|
return Boards.findOne(this.params.boardId);
|
|
}
|
|
});
|
|
|