From 9ae2a31cfa6171c80439080b96a0b56f3b81cb72 Mon Sep 17 00:00:00 2001 From: James Mills Date: Sat, 30 Jan 2021 23:13:06 +1000 Subject: [PATCH] Flresh out search template --- internal/templates/_partials.html | 96 +++++++++++++++++++++++++++++++ internal/templates/search.html | 41 +++++-------- 2 files changed, 109 insertions(+), 28 deletions(-) diff --git a/internal/templates/_partials.html b/internal/templates/_partials.html index 965a5cd..5140f3e 100644 --- a/internal/templates/_partials.html +++ b/internal/templates/_partials.html @@ -25,3 +25,99 @@ {{ end }} {{ end }} + +{{ define "item" }} +
+
+
+ {{ if $.User.Is $.Twt.Twter.URL }} + + + + {{ else }} + {{ if isLocalURL $.Twt.Twter.URL }} + + + {{ else }} + + {{ if $.Twt.Twter.Avatar }} + + {{ else }} + + {{ end }} + {{ end }} + + {{ end }} +
+
+ {{ if $.User.Is $.Twt.Twter.URL }} + me + {{ else }} + {{ if isLocalURL $.Twt.Twter.URL }} + {{ $.Twt.Twter.Nick }} + {{ else }} + + {{ $.Twt.Twter.Nick }} + @{{ $.Twt.Twter.URL | hostnameFromURL }} + + {{ end }} + {{ end }} +
+ + + +  ({{ $.Twt.Created | time }}) + {{ if $.Authenticated }} +   + + + + + {{ end }} +
+
+
+
+ {{ $.Twt.Text | formatTwt }} +
+
+ +
+{{ end }} + +{{ define "results" }} +
+
+ {{ template "pager" $.Pager }} + {{ range $idx, $item := $.Results }} + {{ template "item" (dict "Item" $item) }} + {{ else }} + No search results found. + {{ end }} + {{ template "pager" $.Pager }} +
+
+{{ end }} diff --git a/internal/templates/search.html b/internal/templates/search.html index 91e9093..3eb76e7 100644 --- a/internal/templates/search.html +++ b/internal/templates/search.html @@ -1,29 +1,14 @@ - - - -veri - - - - -
-

veri

-
-
-
-

- -
-

These results are not ranked, they are just in alphabetical order of URL (this will change)

-
    - {{ if not . }}

    No search results

    {{ end }} - {{ range . }} -
  1. {{ .Title }}

    {{ .Summary }}{{ else }} class="placeholder">No summary available{{ end }}

    {{ .URL }} {{ .Length }} View cached

    +{{define "content"}} +
    + {{ with $.Results }} +
      + {{ range . }} +
    1. {{ .Title }}

      {{ .Summary }}{{ else }} class="placeholder">No summary available{{ end }}

      {{ .URL }} {{ .Length }} View cached

      + {{ end }} +
    +

    If your page appears here and you do not want it to, please contact Support.

    + {{ else }} +

    No search results

    {{ end }} -
-

If your page appears here and you do not want it to, please contact ~ols/indexing@lists.sr.ht. Contact the same email if you want your page considered for indexing. Be aware this is a public mailing list.

- - - + +{{end}}