From 15ffbfae4d2ddc8edd9757910599404e3cb460fc Mon Sep 17 00:00:00 2001 From: ngn Date: Sat, 5 Apr 2025 10:30:59 +0300 Subject: [PATCH] save the provided dictionary accross translations Signed-off-by: ngn --- routes/translate.go | 1 + views/search.html | 6 +++++- views/translate.html | 6 ++---- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/routes/translate.go b/routes/translate.go index 24d9cef..344460b 100644 --- a/routes/translate.go +++ b/routes/translate.go @@ -39,6 +39,7 @@ func POST_translate(c *fiber.Ctx) error { return util.Render(c, "translate", fiber.Map{ "term": form.Term, + "dictionary": form.Dictionary, "fields": trans.Fields, "entries": trans.Entries, "suggestions": trans.Suggestions, diff --git a/views/search.html b/views/search.html index 686054d..5afd3dc 100644 --- a/views/search.html +++ b/views/search.html @@ -6,7 +6,11 @@ {{end}} diff --git a/views/translate.html b/views/translate.html index 6f96220..1c799bc 100644 --- a/views/translate.html +++ b/views/translate.html @@ -8,10 +8,8 @@
{{template "search" .}} - {{if not .suggestions}} - {{if not .fields}} -

No results :(

- {{end}} + {{if and (not .suggestions) (not .fields)}} +

No results :(

{{end}} {{if .suggestions}}