all repos — searchix @ 920764211064521930441b96ed914034302a7470

Search engine for NixOS, nix-darwin, home-manager and NUR users

feat: offer to show all results on one page (if < 10000) Implements: https://todo.sr.ht/~alanpearce/searchix/5

Alan Pearce
commit

920764211064521930441b96ed914034302a7470

parent

d289e54af28de6b21cbe49cebc262c4e3ca9f6d2

1 file changed, 5 insertions(+), 2 deletions(-)

changed files
M internal/components/results.templinternal/components/results.templ
@@ -1,9 +1,9 @@
package components import ( - "strconv" - "go.alanpearce.eu/searchix/internal/nix" "go.alanpearce.eu/searchix/internal/config" + "go.alanpearce.eu/searchix/internal/nix" + "strconv" ) func convertMatch[I nix.Importable](m nix.Importable) *I {
@@ -37,6 +37,9 @@ <a class="button" href={ templ.SafeURL(r.Next) } rel="next">Next</a>
} </nav> <span role="status">{ strconv.FormatUint(r.Results.Total, 10) } results</span> + if r.Next != r.Prev && r.Results.Total < config.MaxResultsShowAll { + <a href={ templ.SafeURL(r.All) }>Show All</a> + } </footer> } else { <span role="status">Nothing found</span>