This repository has been archived by the owner on Aug 26, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
routes.js
54 lines (43 loc) · 1.55 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
53
54
// Global router config
Router.configure({
loadingTemplate: 'loading'
});
// Router.route('/add');
Router.route('/', function () {
this.render('home');
});
Router.route('/addtask/:featureid', function(){
this.render('insertTaskForm');
Session.set('featureid', this.params.featureid );
});
Router.route('/edittask/:taskid', function(){
this.render('editTaskForm');
Session.set('taskid', this.params.taskid ); //this works just because there's a helper function listening to the session variable and returning it to the template
var taskid = params.taskid; //this doesn't seem to do anything, but I think there's supposed to be a way to pass variables into the template wtihout a helper
});
Router.route('/addfeature', function(){
this.render('insertFeatureForm');
});
// Router.route('/editfeature/:featureid', function(){
// this.render('editFeature', {
// notFoundTemplate: "featureNotFound"
// // waitOn: function() {
// // return Meteor.subscribe("Features");
// // },
// // data: function() {
// // templateData = {features: Features.find({_id: "86t6WerrwxPoTyyNn"}) };
// // return templateData;
// // }
// });
// });
// Data context from a collection
Router.route('editFeature', { //first line points to the template name (binding)
path: 'authors/:featureid',
data: function() {
templateData = { features: Features.find({_id: this.params.featureid}) }; //features in this case points to the EACH statement
return templateData;
}
});
Router.route('/showfeatures', function(){
this.render('showFeatures');
});