mirror of
https://github.com/rr-/szurubooru.git
synced 2025-07-17 08:26:24 +00:00
server: use index-based paging (#123)
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
<div class='global-comment-list'>
|
||||
<ul><!--
|
||||
--><% for (let post of ctx.results) { %><!--
|
||||
--><% for (let post of ctx.response.results) { %><!--
|
||||
--><li><!--
|
||||
--><div class='post-thumbnail'><!--
|
||||
--><% if (ctx.canViewPosts) { %><!--
|
||||
|
@ -1,8 +1,8 @@
|
||||
<nav class='buttons'>
|
||||
<ul>
|
||||
<li>
|
||||
<% if (ctx.prevLinkActive) { %>
|
||||
<a class='prev' href='<%- ctx.prevLink %>'>
|
||||
<% if (ctx.prevPage !== ctx.currentPage) { %>
|
||||
<a class='prev' href='<%- ctx.getClientUrlForPage(ctx.pages.get(ctx.prevPage).offset, ctx.pages.get(ctx.prevPage).limit) %>'>
|
||||
<% } else { %>
|
||||
<a class='prev disabled'>
|
||||
<% } %>
|
||||
@ -11,7 +11,7 @@
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<% for (let page of ctx.pages) { %>
|
||||
<% for (let page of ctx.pages.values()) { %>
|
||||
<% if (page.ellipsis) { %>
|
||||
<li>…</li>
|
||||
<% } else { %>
|
||||
@ -20,14 +20,14 @@
|
||||
<% } else { %>
|
||||
<li>
|
||||
<% } %>
|
||||
<a href='<%- page.link %>'><%- page.number %></a>
|
||||
<a href='<%- ctx.getClientUrlForPage(page.offset, page.limit) %>'><%- page.number %></a>
|
||||
</li>
|
||||
<% } %>
|
||||
<% } %>
|
||||
|
||||
<li>
|
||||
<% if (ctx.nextLinkActive) { %>
|
||||
<a class='next' href='<%- ctx.nextLink %>'>
|
||||
<% if (ctx.nextPage !== ctx.currentPage) { %>
|
||||
<a class='next' href='<%- ctx.getClientUrlForPage(ctx.pages.get(ctx.nextPage).offset, ctx.pages.get(ctx.nextPage).limit) %>'>
|
||||
<% } else { %>
|
||||
<a class='next disabled'>
|
||||
<% } %>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<div class='post-list'>
|
||||
<% if (ctx.results.length) { %>
|
||||
<% if (ctx.response.results.length) { %>
|
||||
<ul>
|
||||
<% for (let post of ctx.results) { %>
|
||||
<% for (let post of ctx.response.results) { %>
|
||||
<li>
|
||||
<a class='thumbnail-wrapper <%= post.tags.length > 0 ? "tags" : "no-tags" %>'
|
||||
title='@<%- post.id %> (<%- post.type %>) Tags: <%- post.tags.map(tag => '#' + tag).join(' ') || 'none' %>'
|
||||
|
@ -1,7 +1,7 @@
|
||||
<div class='snapshot-list'>
|
||||
<% if (ctx.results.length) { %>
|
||||
<% if (ctx.response.results.length) { %>
|
||||
<ul>
|
||||
<% for (let item of ctx.results) { %>
|
||||
<% for (let item of ctx.response.results) { %>
|
||||
<li>
|
||||
<div class='header operation-<%= item.operation %>'>
|
||||
<span class='time'>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<div class='tag-list'>
|
||||
<% if (ctx.results.length) { %>
|
||||
<% if (ctx.response.results.length) { %>
|
||||
<table>
|
||||
<thead>
|
||||
<th class='names'>
|
||||
@ -39,7 +39,7 @@
|
||||
</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% for (let tag of ctx.results) { %>
|
||||
<% for (let tag of ctx.response.results) { %>
|
||||
<tr>
|
||||
<td class='names'>
|
||||
<ul>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<div class='user-list'>
|
||||
<ul><!--
|
||||
--><% for (let user of ctx.results) { %><!--
|
||||
--><% for (let user of ctx.response.results) { %><!--
|
||||
--><li>
|
||||
<div class='wrapper'>
|
||||
<% if (ctx.canViewUsers) { %>
|
||||
|
Reference in New Issue
Block a user