diff options
author | navanchauhan <navanchauhan@gmail.com> | 2023-01-18 02:41:10 -0700 |
---|---|---|
committer | navanchauhan <navanchauhan@gmail.com> | 2023-01-18 02:41:10 -0700 |
commit | 790ca38644b8c37c9feb7c433143a6b49b4f137e (patch) | |
tree | f809dc4ef486090648686a4c4769a08034a462d0 /templates/search_results.html | |
parent | 46f32a7dc26dad46ffa974de56bf1541b8578e12 (diff) |
added pagination and results per page
Diffstat (limited to 'templates/search_results.html')
-rw-r--r-- | templates/search_results.html | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/templates/search_results.html b/templates/search_results.html index 4c053ab..4e9b9a4 100644 --- a/templates/search_results.html +++ b/templates/search_results.html @@ -73,25 +73,28 @@ {{ end }} </section> - {{ if .MoreResults }} + <section class="section"> <div class="container"> <div class="columns"> + {{if .ShowPrev }} <div class="column"> <div class="field has-addons"> - <button class="button is-primary is-light is-medium is-fullwidth" href="/search?query={{.OriginalQuery.Query}}&offset={{.LastOffset}}" title="Previous Page"> + <a class="button is-primary is-light is-medium is-fullwidth" href="/search?query={{.OriginalQuery.Query}}&page={{.PrevPage}}&maxHits={{.MaxResults}}" title="Previous Page"> <span class="icon is-small"> <i class="fa-solid fa-left-long"></i> </span> <span>Previous Page</span> - </button> + </a> </div> </div> + {{ end }} + {{ if .MoreResults }} <div class="column"> <div class="field has-addons"> - <a class="button is-primary is-medium is-fullwidth" href="/search?query={{.OriginalQuery.Query}}&offset={{.Offset}}" title="Next Page"> + <a class="button is-primary is-medium is-fullwidth" href="/search?query={{.OriginalQuery.Query}}&page={{.NextPage}}&maxHits={{.MaxResults}}" title="Next Page"> <span> Next Page </span> @@ -100,10 +103,11 @@ </span> </a></div> </div> + {{ end }} </div></div> </section> - {{ end }} + <script> if (typeof navigator.serviceWorker !== 'undefined') { navigator.serviceWorker.register('/static/pwabuilder-sw.js') |