Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Serge Borbit authored and Serge Borbit committed Aug 22, 2015
1 parent 4e88f8e commit 3ff8f09
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion public/pages/admin/admin.ejs
Expand Up @@ -4,6 +4,6 @@
-%>
<% include ../layout_head.ejs %>
<% files.forEach(function(file) { %>
<img src="/img/flags/<%=file%>"/>
<img src="/flags/<%=file%>"/>
<% }) %>
<% include ../layout_foot.ejs %>
4 changes: 2 additions & 2 deletions routes/index.coffee
Expand Up @@ -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
Expand Down

0 comments on commit 3ff8f09

Please sign in to comment.