From 1d3a22387fe2fa786c29b58104728c1cc942b51b Mon Sep 17 00:00:00 2001 From: t123yh Date: Sat, 26 Aug 2017 22:35:38 +0800 Subject: [PATCH] Fix page bug again. --- views/page.ejs | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/views/page.ejs b/views/page.ejs index 9bc485d..2edfdfa 100644 --- a/views/page.ejs +++ b/views/page.ejs @@ -18,26 +18,33 @@ omitLeft = omitRight = true; } } %> + + <% if (paginate.currPage !== 1) { %> <%= 1 %> + <% } %> + <% if (omitLeft) { %>
...
- <% - } - for (let i = paginate.currPage - leftCnt; i < paginate.currPage; i++) { %> + <% } %> + + <% for (let i = paginate.currPage - leftCnt; i < paginate.currPage; i++) { %> <%= i %> - <% - } - %> + <% } %> + <%= paginate.currPage %> + <% for (let i = paginate.currPage + 1; i <= paginate.currPage + rightCnt; i++) { %> <%= i %> - <% - } - if (omitRight) { - %> + <% } %> + + <% if (omitRight) { %>
...
<% } %> + + <% if (paginate.currPage !== paginate.pageCnt) { %> <%= paginate.pageCnt %> + <% } %> + href="<%= syzoj.utils.makeUrl(req, Object.assign(req.query, { page: paginate.currPage + 1 })) %>" <% } %>id="page_next">