2015-09-17 14:51:14 +09:00
|
|
|
FlowRouter.route('/', {
|
|
|
|
name: "postsDefault",
|
|
|
|
action: function(params, queryParams) {
|
|
|
|
BlazeLayout.render("layout", {main: "main_posts_list"});
|
2015-07-08 16:00:27 +09:00
|
|
|
}
|
2014-11-17 14:45:23 +09:00
|
|
|
});
|
|
|
|
|
2015-09-17 14:51:14 +09:00
|
|
|
FlowRouter.route('/posts/:_id/edit', {
|
|
|
|
name: "postEdit",
|
|
|
|
action: function(params, queryParams) {
|
|
|
|
BlazeLayout.render("layout", {main: "post_edit"});
|
2015-05-19 18:29:54 +09:00
|
|
|
}
|
2014-11-17 14:45:23 +09:00
|
|
|
});
|
|
|
|
|
2015-09-17 14:51:14 +09:00
|
|
|
FlowRouter.route('/posts/:_id/:slug?', {
|
|
|
|
name: "postPage",
|
2015-09-18 17:24:04 +09:00
|
|
|
triggersEnter: [trackRouteEntry],
|
2015-09-17 14:51:14 +09:00
|
|
|
action: function(params, queryParams) {
|
|
|
|
BlazeLayout.render("layout", {main: "post_page"});
|
|
|
|
}
|
2015-09-06 11:37:48 +09:00
|
|
|
});
|
|
|
|
|
2015-09-18 17:24:04 +09:00
|
|
|
var trackRouteEntry = function (context) {
|
|
|
|
var sessionId = Meteor.default_connection && Meteor.default_connection._lastSessionId ? Meteor.default_connection._lastSessionId : null;
|
|
|
|
Meteor.call('increasePostViews', context.params._id, sessionId);
|
|
|
|
}
|
|
|
|
|
2015-09-17 14:51:14 +09:00
|
|
|
FlowRouter.route('/submit', {
|
|
|
|
name: "postSubmit",
|
|
|
|
action: function(params, queryParams) {
|
|
|
|
BlazeLayout.render("layout", {main: "post_submit"});
|
|
|
|
}
|
2015-09-18 17:24:04 +09:00
|
|
|
});
|