|
|
@ -1,6 +1,7 @@
|
|
|
|
'use strict';
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
|
|
|
|
var qs = require('querystring');
|
|
|
|
var qs = require('querystring');
|
|
|
|
|
|
|
|
var _ = require('underscore');
|
|
|
|
|
|
|
|
|
|
|
|
var pagination = {};
|
|
|
|
var pagination = {};
|
|
|
|
|
|
|
|
|
|
|
@ -37,10 +38,10 @@ pagination.create = function (currentPage, pageCount, queryObj) {
|
|
|
|
return a - b;
|
|
|
|
return a - b;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
queryObj = queryObj || {};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
delete queryObj._;
|
|
|
|
delete queryObj._;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
queryObj = _.clone(queryObj || {});
|
|
|
|
|
|
|
|
|
|
|
|
var pages = pagesToShow.map(function (page) {
|
|
|
|
var pages = pagesToShow.map(function (page) {
|
|
|
|
queryObj.page = page;
|
|
|
|
queryObj.page = page;
|
|
|
|
return { page: page, active: page === currentPage, qs: qs.stringify(queryObj) };
|
|
|
|
return { page: page, active: page === currentPage, qs: qs.stringify(queryObj) };
|
|
|
|