Cleanup previous/next page buttons (#134)

Use noteq to simplify code, add current page to previous/next page bar

Reviewed-on: https://codeberg.org/rimgo/rimgo/pulls/134
Reviewed-by: orangix <orangix@noreply.codeberg.org>
Co-authored-by: video-prize-ranch <cb.8a3w5@simplelogin.co>
Co-committed-by: video-prize-ranch <cb.8a3w5@simplelogin.co>
This commit is contained in:
video-prize-ranch
2023-08-30 17:24:54 +00:00
committed by video-prize-ranch
parent 0fea1e46a3
commit fc88bfbca5
6 changed files with 10 additions and 27 deletions

View File

@@ -22,10 +22,10 @@
</div>
<div class="flex justify-between mt-4 font-bold">
{{#if displayPrev}}
{{#noteq page "0"}}
<a href="/search?q={{query}}&page={{prevPage}}">Previous page</a>
{{/if}}
<p>Page {{page}}</p>
{{/noteq}}
<p>Page {{nextPage}}</p>
<a href="/search?q={{query}}&page={{nextPage}}">Next page</a>
</div>
</main>

View File

@@ -45,10 +45,11 @@
{{/each}}
</div>
<div class="mt-4 font-bold">
{{#if displayPrev}}
<div class="flex justify-between mt-4 font-bold">
{{#noteq page "1"}}
<a href="{{channel.RelUrl}}?page={{prevPage}}">Previous page</a>
{{/if}}
{{/noteq}}
<p>Page {{nextPage}}</p>
<a href="{{channel.RelUrl}}?page={{nextPage}}">Next page</a>
</div>
</main>

View File

@@ -65,9 +65,9 @@
</div>
<div class="flex justify-between mt-4 font-bold">
{{#if displayPrev}}
{{#noteq page "1"}}
<a href="/trending?section={{section}}&sort={{sort}}&page={{prevPage}}">Previous page</a>
{{/if}}
{{/noteq}}
<p>Page {{page}}</p>
<a href="/trending?section={{section}}&sort={{sort}}&page={{nextPage}}">Next page</a>
</div>