From 3ff8f09c68795faf73e4c79c56cae7f0636bd51e Mon Sep 17 00:00:00 2001 From: Serge Borbit Date: Sat, 22 Aug 2015 23:55:09 +0300 Subject: [PATCH] wip --- public/pages/admin/admin.ejs | 2 +- routes/index.coffee | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/public/pages/admin/admin.ejs b/public/pages/admin/admin.ejs index 46e1388..aba748b 100644 --- a/public/pages/admin/admin.ejs +++ b/public/pages/admin/admin.ejs @@ -4,6 +4,6 @@ -%> <% include ../layout_head.ejs %> <% files.forEach(function(file) { %> - + <% }) %> <% include ../layout_foot.ejs %> \ No newline at end of file diff --git a/routes/index.coffee b/routes/index.coffee index 9a84d8d..fea25a4 100644 --- a/routes/index.coffee +++ b/routes/index.coffee @@ -49,8 +49,8 @@ module.exports = (app) -> app.get '/admin', auth, (req, res) -> fs.readdir config.flags_dir_path, (err, files) -> - page_count = req.query.page_count or 100 - page_num = req.query.page_num or 0 + page_count = +req.query.page_count or 100 + page_num = +req.query.page_num or 0 files = files.filter (file) -> ~file.indexOf('.png') files = files.slice page_num * page_count, (page_num+1) * page_count