From 94706221251d65718717fd8271bb3195c61da461 Mon Sep 17 00:00:00 2001 From: Thomas Miceli Date: Fri, 23 Jun 2023 13:59:07 +0200 Subject: [PATCH] Search page more explicit --- internal/web/gist.go | 3 ++- templates/base/base_header.html | 6 +++--- templates/pages/all.html | 14 +++++++++----- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/internal/web/gist.go b/internal/web/gist.go index 9c60430..c108dcc 100644 --- a/internal/web/gist.go +++ b/internal/web/gist.go @@ -121,7 +121,8 @@ func allGists(ctx echo.Context) error { if strings.HasSuffix(urlctx, "search") { setData(ctx, "htmlTitle", "Search results") setData(ctx, "mode", "search") - setData(ctx, "searchQuery", template.URL("&q="+ctx.QueryParam("q"))) + setData(ctx, "searchQuery", ctx.QueryParam("q")) + setData(ctx, "searchQueryUrl", template.URL("&q="+ctx.QueryParam("q"))) urlPage = "search" gists, err = models.GetAllGistsFromSearch(currentUserId, ctx.QueryParam("q"), pageInt-1, sort, order) } else if strings.HasSuffix(urlctx, "all") { diff --git a/templates/base/base_header.html b/templates/base/base_header.html index a04cf42..1a46465 100644 --- a/templates/base/base_header.html +++ b/templates/base/base_header.html @@ -73,7 +73,7 @@
- +
@@ -191,7 +191,7 @@ {{ else }} -

All gists

+ {{ if eq .mode "all" }} +

All gists

+ {{ else if eq .mode "search" }} +

Search results

+ {{ end }} {{ end }}
@@ -29,22 +33,22 @@