Files
spyda/internal/templates/_partials.html
Aoi Koizumi (古泉 あおい) 7001f3bf51 Move from pico.css to mirageCSS (#1)
UI/UX changes: PicoCSS -> mirageCSS, rice-box.go removed and placed on .gitignore (since it is generated anyway), update templates.

Signed-off-by: Aoi K <koizumi.aoi@kyoko-project.wer.ee>

Co-authored-by: Aoi K <koizumi.aoi@kyoko-project.wer.ee>
Reviewed-on: https://git.mills.io/prologic/spyda/pulls/1
Co-authored-by: Aoi Koizumi (古泉 あおい) <novaburst@noreply@mills.io>
Co-committed-by: Aoi Koizumi (古泉 あおい) <novaburst@noreply@mills.io>
2022-10-05 00:16:24 +00:00

43 lines
1.3 KiB
HTML

{{ define "pager" }}
{{ if $.Pager.HasPages }}
<nav class="nova-menu-list">
{{ if $.Pager.HasPrev }}
<a href="?q={{ $.SearchQuery }}&p={{ $.Pager.PrevPage }}">Prev</a>
{{ else }}
<a href="#" data-tooltip="No more results">Prev</a>
{{ end }}
<small>Page {{ $.Pager.Page }} of {{ $.Pager.PageNums }} matching {{ $.Pager.Nums }} results in {{ $.SearchTook }}</small>
{{ if $.Pager.HasNext }}
<a href="?q={{ $.SearchQuery }}&p={{ $.Pager.NextPage }}">Next</a>
{{ else }}
<a href="#" data-tooltip="No more results">Next</a>
{{ end }}
</nav>
{{ end }}
{{ end }}
{{ define "item" }}
<article>
<hgroup>
<h2><a href="{{ $.URL }}">{{ $.Title }}</a></h2>
<h3>Updated {{ $.UpdatedAt | time }}</h3>
</hgroup>
<p{{ if $.Summary }}>{{ .Summary }}{{ else }} class="placeholder">No summary available{{ end }}</p>
<p class="small"><a href="{{ $.URL }}">{{ $.URL }}</a> {{ .Length }} <a href="/cache/{{ .ID }}">View cached</a></p>
</article>
{{ end }}
{{ define "results" }}
<div class="grid">
<div>
{{ template "pager" $.Pager }}
{{ range $idx, $item := $.Results }}
{{ template "item" (dict "Item" $item) }}
{{ else }}
<small><i>No search results found.</i></small>
{{ end }}
{{ template "pager" $.Pager }}
</div>
</div>
{{ end }}