routes.js 911 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. Router.configure({
  2. layoutTemplate: 'layout' //can be any template name
  3. });
  4. Router.map(function () {
  5. this.route('home', {
  6. path: '/',
  7. });
  8. this.route('projects', {
  9. waitOn: function() {
  10. return Meteor.subscribe('projects');
  11. },
  12. action: function() {
  13. if (this.ready()) {
  14. this.render();
  15. } else {
  16. this.render('Loading');
  17. }
  18. }
  19. });
  20. this.route('project_details', {
  21. path: '/project/:_id',
  22. waitOn: function() {
  23. return [Meteor.subscribe('projects', this.params._id), Meteor.subscribe('deployments', this.params._id)];
  24. },
  25. data: function () {
  26. return ProjectService.get(this.params._id);
  27. },
  28. action: function() {
  29. if (this.ready()) {
  30. this.render();
  31. } else {
  32. this.render('Loading');
  33. }
  34. }
  35. });
  36. });