router.js 795 B

12345678910111213141516171819202122232425262728293031323334
  1. Meteor.subscribe('boards');
  2. BoardSubsManager = new SubsManager();
  3. Router.route('/boards', {
  4. name: 'Boards',
  5. template: 'boards',
  6. authenticated: true,
  7. onBeforeAction: function() {
  8. Session.set('currentBoard', '');
  9. Filter.reset();
  10. this.next();
  11. }
  12. });
  13. Router.route('/boards/:_id/:slug', {
  14. name: 'Board',
  15. template: 'board',
  16. onAfterAction: function() {
  17. Session.set('sidebarIsOpen', true);
  18. Session.set('currentWidget', 'home');
  19. Session.set('menuWidgetIsOpen', false);
  20. },
  21. waitOn: function() {
  22. var params = this.params;
  23. Session.set('currentBoard', params._id);
  24. Session.set('currentCard', null);
  25. return BoardSubsManager.subscribe('board', params._id, params.slug);
  26. },
  27. data: function() {
  28. return Boards.findOne(this.params._id);
  29. }
  30. });