diff options
| author | frosty <gabriel@bwaaa.monster> | 2026-04-01 05:49:18 +0300 |
|---|---|---|
| committer | frosty <gabriel@bwaaa.monster> | 2026-04-01 05:49:18 +0300 |
| commit | 614bd26cb34b9b340e327d4b80927353bb5a5d0a (patch) | |
| tree | 8d03df6a3f65eb13fa8d9ce8cb16cc27f46faaf2 /templates | |
| parent | c6bdeecb2a8869fd7684fc56ed0047611d327cfc (diff) | |
| download | omnisearch-614bd26cb34b9b340e327d4b80927353bb5a5d0a.tar.gz | |
refactor: internationalise pagination and clean up related code
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/images.html | 53 | ||||
| -rw-r--r-- | templates/results.html | 6 |
2 files changed, 13 insertions, 46 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}}"> - ← - </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}}"> - → - </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 diff --git a/templates/results.html b/templates/results.html index 4ce7496..54ac195 100644 --- a/templates/results.html +++ b/templates/results.html @@ -118,8 +118,8 @@ {{info[2]|safe}} </p> <a class="read-more" href="{{info[3]}}"> - {{l("read_more")}} - </a> + {{l("read_more")}} + </a> </div> </div> </section> @@ -129,4 +129,4 @@ </div> </body> -</html> +</html>
\ No newline at end of file |
