-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathroutes.js
52 lines (43 loc) · 1.19 KB
/
routes.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
Router.configure({
layoutTemplate: 'ApplicationLayout'
});
Router.route('/', {
waitOn: function() {
return [Meteor.subscribe("userData"), Meteor.subscribe("ideas")];
},
action: function () {
this.render('IndexPage', {data: {}});
}
});
Router.route('/suggestions/:_id', {
waitOn: function() {
return [Meteor.subscribe("userData"), Meteor.subscribe("ideas")];
},
action: function () {
this.render('IdeaShowPage', {data: {_id: this.params._id}});
}
});
Router.route('/suggestions/:_id/edit', function () {
this.render('IdeaEditPage', {data: {_id: this.params._id}});
});
suggestionUrl = function(idea) {
return "/suggestions/"+idea._id;
}
Router.route('/admin', {
waitOn: function() {
return Meteor.subscribe("userData");
},
before: function() {
if (isAdmin()) this.next();
},
action: function () {
this.render('AdminPage', {data: {}});
}
});
suggestionEditUrl = function(idea) {
return suggestionUrl(idea) + "/edit"
}
// console.log("...", Meteor.settings.facebook.appId, Meteor.settings.facebook.secret, !!(Meteor.settings &&
// Meteor.settings.facebook &&
// Meteor.settings.facebook.appId &&
// Meteor.settings.facebook.secret))