aboutsummaryrefslogtreecommitdiff
path: root/templates/images.html
diff options
context:
space:
mode:
authorfrosty <gabriel@bwaaa.monster>2026-04-01 05:49:18 +0300
committerfrosty <gabriel@bwaaa.monster>2026-04-01 05:49:18 +0300
commit614bd26cb34b9b340e327d4b80927353bb5a5d0a (patch)
tree8d03df6a3f65eb13fa8d9ce8cb16cc27f46faaf2 /templates/images.html
parentc6bdeecb2a8869fd7684fc56ed0047611d327cfc (diff)
downloadomnisearch-614bd26cb34b9b340e327d4b80927353bb5a5d0a.tar.gz
refactor: internationalise pagination and clean up related code
Diffstat (limited to 'templates/images.html')
-rw-r--r--templates/images.html53
1 files changed, 10 insertions, 43 deletions
diff --git a/templates/images.html b/templates/images.html
index f4522aa..9fd0584 100644
--- a/templates/images.html
+++ b/templates/images.html
@@ -65,49 +65,16 @@
</div>
{{endfor}}
</div>
- <nav class="pagination">
- <a class="pagination-btn prev" href="/images?q={{query}}&p={{prev_page}}">
- &larr;
- </a>
-
- {{if two_prev_page != 0}}
- <a class="pagination-btn prev" href="/images?q={{query}}&p={{two_prev_page}}">
- {{two_prev_page}}
- </a>
- {{endif}}
-
- {{if prev_page != 0}}
- <a class="pagination-btn prev" href="/images?q={{query}}&p={{prev_page}}">
- {{prev_page}}
- </a>
- {{endif}}
-
- <a class="pagination-btn pagination-current" href="/images?q={{query}}&p={{page}}">
- {{page}}
- </a>
- <a class="pagination-btn next" href="/images?q={{query}}&p={{next_page}}">
- {{next_page}}
- </a>
- <a class="pagination-btn next" href="/images?q={{query}}&p={{two_next_page}}">
- {{two_next_page}}
- </a>
-
- {{if prev_page == 0}}
- <a class="pagination-btn prev" href="/images?q={{query}}&p=4">
- 4
- </a>
- {{endif}}
-
- {{if two_prev_page == 0}}
- <a class="pagination-btn prev" href="/images?q={{query}}&p=5">
- 5
- </a>
- {{endif}}
- <a class="pagination-btn next" href="/images?q={{query}}&p={{next_page}}">
- &rarr;
- </a>
- </nav>
+ {{if exists pagination_links}}
+ <nav class="pagination">
+ {{for link in pagination_links}}
+ <a class="{{link[2]}}" href="{{link[0]}}">
+ {{link[1]}}
+ </a>
+ {{endfor}}
+ </nav>
+ {{endif}}
</main>
</body>
-</html>
+</html> \ No newline at end of file