2014-06-23 11:05:06 +09:00
|
|
|
adminNav.push({
|
|
|
|
route: 'searchLogs',
|
|
|
|
label: 'Search Logs'
|
|
|
|
});
|
|
|
|
|
2014-08-28 11:10:31 +09:00
|
|
|
|
2014-06-23 11:05:06 +09:00
|
|
|
Meteor.startup(function () {
|
|
|
|
|
2014-08-28 11:10:31 +09:00
|
|
|
PostsSearchController = PostsListController.extend({
|
2014-10-03 15:48:32 -06:00
|
|
|
view: 'search',
|
|
|
|
onBeforeAction: function() {
|
|
|
|
if ("q" in this.params) {
|
|
|
|
Session.set("searchQuery", this.params.q);
|
|
|
|
}
|
|
|
|
}
|
2014-08-28 11:10:31 +09:00
|
|
|
});
|
|
|
|
|
2014-06-23 11:05:06 +09:00
|
|
|
Router.onBeforeAction(Router._filters.isAdmin, {only: ['logs']});
|
|
|
|
|
2014-11-17 14:53:42 +09:00
|
|
|
// Search
|
2014-06-23 11:05:06 +09:00
|
|
|
|
2014-11-17 14:53:42 +09:00
|
|
|
Router.route('/search/:limit?', {
|
|
|
|
name: 'search',
|
|
|
|
controller: PostsSearchController
|
|
|
|
});
|
|
|
|
|
|
|
|
// Search Logs
|
|
|
|
|
|
|
|
Router.route('/logs/:limit?', {
|
|
|
|
name: 'searchLogs',
|
|
|
|
waitOn: function () {
|
|
|
|
var limit = this.params.limit || 100;
|
|
|
|
if(Meteor.isClient) {
|
|
|
|
Session.set('logsLimit', limit);
|
|
|
|
}
|
|
|
|
return Meteor.subscribe('searches', limit);
|
|
|
|
},
|
|
|
|
data: function () {
|
|
|
|
return Searches.find({}, {sort: {timestamp: -1}});
|
|
|
|
},
|
|
|
|
fastRender: true
|
2014-06-23 11:05:06 +09:00
|
|
|
});
|
|
|
|
|
2014-10-03 15:48:32 -06:00
|
|
|
});
|