Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
svera committed Oct 16, 2023
1 parent fb669d7 commit de1036e
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 23 deletions.
2 changes: 1 addition & 1 deletion internal/controller/highlights.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
3 changes: 3 additions & 0 deletions internal/webserver/embedded/translations/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
5 changes: 4 additions & 1 deletion internal/webserver/embedded/translations/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<div class="container">
<h2>{{t .Lang "Highlights"}}</h2>
{{if gt .Total 0}}
<p>{{t .Lang "%d highlighted documents" .Total }}</p>
{{else}}
<p>{{t .Lang "No highlighted documents" }}</p>
{{end}}
<div class="py-5">
<h1>{{t .Lang "Highlights"}}</h1>
{{if gt .Total 0}}
<p>{{t .Lang "%d highlighted documents" .Total }}</p>
{{else}}
<p>{{t .Lang "No highlighted documents" }}</p>
{{end}}
</div>

{{ template "partials/docs-list" dict "Lang" .Lang "EmailSendingConfigured"
.EmailSendingConfigured "Session" .Session "EmailFrom" .EmailFrom "Results" .Results "WordsPerMinute" .WordsPerMinute}}
Expand Down
6 changes: 3 additions & 3 deletions internal/webserver/embedded/views/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ <h5 class="offcanvas-title" id="offcanvasNavbarLabel">Coreander</h5>
</li>
<li>
<a class="dropdown-item" href="/{{.Lang}}/highlights">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-star" viewBox="0 0 16 16">
<path d="M2.866 14.85c-.078.444.36.791.746.593l4.39-2.256 4.389 2.256c.386.198.824-.149.746-.592l-.83-4.73 3.522-3.356c.33-.314.16-.888-.282-.95l-4.898-.696L8.465.792a.513.513 0 0 0-.927 0L5.354 5.12l-4.898.696c-.441.062-.612.636-.283.95l3.523 3.356-.83 4.73zm4.905-2.767-3.686 1.894.694-3.957a.565.565 0 0 0-.163-.505L1.71 6.745l4.052-.576a.525.525 0 0 0 .393-.288L8 2.223l1.847 3.658a.525.525 0 0 0 .393.288l4.052.575-2.906 2.77a.565.565 0 0 0-.163.506l.694 3.957-3.686-1.894a.503.503 0 0 0-.461 0z"/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-star-fill" viewBox="0 0 16 16">
<path d="M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.282.95l-3.522 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z"/>
</svg>
{{t .Lang "Highlights"}}
</a>
</li>
Expand Down
29 changes: 17 additions & 12 deletions internal/webserver/embedded/views/partials/actions.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,27 @@
<li>
<form method="post" action="send" onsubmit='send("{{.Index}}")' id="send-email-{{.Index}}">
<div class="p-3">
<label for="email" class="form-label">{{t .Lang
"Send to email"}}</label>
<input type="email" class="form-control" id="email" name="email"
placeholder="email@example.com" value="{{.Session.SendToEmail}}" required="required">
<small class="text-muted"><em>{{t .Lang "Sent from %s" .EmailFrom}}</em></small>
</div>
<div class="p-3">
<p class="visually-hidden fs-6" id="send-email-message-{{.Index}}"></p>
<input type="hidden" name="slug" value="{{.Book.Slug}}">
<button type="submit" class="btn btn-primary">
<label for="email" class="form-label">
<svg id="envelope-{{.Index}}" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-envelope" viewBox="0 0 16 16">
<path fill="#fff" d="M0 4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V4Zm2-1a1 1 0 0 0-1 1v.217l7 4.2 7-4.2V4a1 1 0 0 0-1-1H2Zm13 2.383-4.708 2.825L15 11.105V5.383Zm-.034 6.876-5.64-3.471L8 9.583l-1.326-.795-5.64 3.47A1 1 0 0 0 2 13h12a1 1 0 0 0 .966-.741ZM1 11.105l4.708-2.897L1 5.383v5.722Z"/>
</svg>
<span id="spinner-{{.Index}}" class="spinner-border spinner-border-sm visually-hidden" aria-hidden="true"></span>
&nbsp;&nbsp;{{t .Lang "Send"}}</button>
&nbsp;&nbsp;{{t .Lang "Send to email"}}
</label>
<div class="input-group">
<input type="email" class="form-control" id="email" name="email"
placeholder="email@example.com" value="{{.Session.SendToEmail}}" required="required">
<button type="submit" class="btn btn-primary">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-send-fill" viewBox="0 0 16 16">
<path d="M15.964.686a.5.5 0 0 0-.65-.65L.767 5.855H.766l-.452.18a.5.5 0 0 0-.082.887l.41.26.001.002 4.995 3.178 3.178 4.995.002.002.26.41a.5.5 0 0 0 .886-.083l6-15Zm-1.833 1.89L6.637 10.07l-.215-.338a.5.5 0 0 0-.154-.154l-.338-.215 7.494-7.494 1.178-.471-.47 1.178Z"/>
</svg>
<span id="spinner-{{.Index}}" class="spinner-border spinner-border-sm visually-hidden" aria-hidden="true"></span>
</button>
</div>
<small class="text-muted"><em>{{t .Lang "Sent from %s" .EmailFrom}}</em></small>
</div>
<div class="p-3 visually-hidden fs-6" id="send-email-message-{{.Index}}">
</div>
<input type="hidden" name="slug" value="{{.Book.Slug}}">
</form>
</li>
{{end}}
Expand Down

0 comments on commit de1036e

Please sign in to comment.