From de1036ee97323dc81bd5a5b3a1b6697dc0091fd4 Mon Sep 17 00:00:00 2001 From: Sergio Vera Date: Mon, 16 Oct 2023 20:17:47 +0200 Subject: [PATCH] WIP --- internal/controller/highlights.go | 2 +- .../webserver/embedded/translations/es.yml | 3 ++ .../webserver/embedded/translations/fr.yml | 5 +++- ...ults-no-searchbox.html => highlights.html} | 14 +++++---- internal/webserver/embedded/views/layout.html | 6 ++-- .../embedded/views/partials/actions.html | 29 +++++++++++-------- 6 files changed, 36 insertions(+), 23 deletions(-) rename internal/webserver/embedded/views/{results-no-searchbox.html => highlights.html} (64%) diff --git a/internal/controller/highlights.go b/internal/controller/highlights.go index ca3d5c8..6d96fad 100644 --- a/internal/controller/highlights.go +++ b/internal/controller/highlights.go @@ -63,7 +63,7 @@ func (h *Highlights) Highlights(c *fiber.Ctx) error { highlights.Hits[i].Highlighted = true } - return c.Render("results-no-searchbox", fiber.Map{ + return c.Render("highlights", fiber.Map{ "Results": highlights.Hits, "Total": highlights.TotalHits, "Paginator": pagination(model.MaxPagesNavigator, highlights.TotalPages, page, nil), diff --git a/internal/webserver/embedded/translations/es.yml b/internal/webserver/embedded/translations/es.yml index 3cc240b..f16db20 100644 --- a/internal/webserver/embedded/translations/es.yml +++ b/internal/webserver/embedded/translations/es.yml @@ -105,3 +105,6 @@ "Toggle theme": "Cambiar tema" "Toggle theme (light)": "Cambiar tema (claro)" "Highlight": "Destacar" +"Highlights": "Destacados" +"Remove from highlights": "Eliminar de destacados" +"%d highlighted documents": "%d documentos destacados" diff --git a/internal/webserver/embedded/translations/fr.yml b/internal/webserver/embedded/translations/fr.yml index 67efef5..8b785de 100644 --- a/internal/webserver/embedded/translations/fr.yml +++ b/internal/webserver/embedded/translations/fr.yml @@ -104,4 +104,7 @@ "Auto": "Auto" "Toggle theme": "Changer thème" "Toggle theme (light)": "Changer thème (clair)" -"Highlight": "Surligner" +"Highlight": "Ajouter aux favoris" +"Highlights": "Favoris" +"Remove from highlights": "Retirer des favoris" +"%d highlighted documents": "%d documents favoris" diff --git a/internal/webserver/embedded/views/results-no-searchbox.html b/internal/webserver/embedded/views/highlights.html similarity index 64% rename from internal/webserver/embedded/views/results-no-searchbox.html rename to internal/webserver/embedded/views/highlights.html index ab69ad5..752d0f8 100644 --- a/internal/webserver/embedded/views/results-no-searchbox.html +++ b/internal/webserver/embedded/views/highlights.html @@ -1,10 +1,12 @@
-

{{t .Lang "Highlights"}}

- {{if gt .Total 0}} -

{{t .Lang "%d highlighted documents" .Total }}

- {{else}} -

{{t .Lang "No highlighted documents" }}

- {{end}} +
+

{{t .Lang "Highlights"}}

+ {{if gt .Total 0}} +

{{t .Lang "%d highlighted documents" .Total }}

+ {{else}} +

{{t .Lang "No highlighted documents" }}

+ {{end}} +
{{ template "partials/docs-list" dict "Lang" .Lang "EmailSendingConfigured" .EmailSendingConfigured "Session" .Session "EmailFrom" .EmailFrom "Results" .Results "WordsPerMinute" .WordsPerMinute}} diff --git a/internal/webserver/embedded/views/layout.html b/internal/webserver/embedded/views/layout.html index ff01cc8..d121901 100644 --- a/internal/webserver/embedded/views/layout.html +++ b/internal/webserver/embedded/views/layout.html @@ -74,9 +74,9 @@
Coreander
  • - - - + + + {{t .Lang "Highlights"}}
  • diff --git a/internal/webserver/embedded/views/partials/actions.html b/internal/webserver/embedded/views/partials/actions.html index 29f1696..e734a39 100644 --- a/internal/webserver/embedded/views/partials/actions.html +++ b/internal/webserver/embedded/views/partials/actions.html @@ -50,22 +50,27 @@
  • - - - {{t .Lang "Sent from %s" .EmailFrom}} -
    -
    -

    - - +   {{t .Lang "Send to email"}} + +
    + + +
    + {{t .Lang "Sent from %s" .EmailFrom}} +
    +
    +
  • {{end}}