aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorr <r@freesoftwareextremist.com>2019-12-26 19:18:09 +0000
committerr <r@freesoftwareextremist.com>2019-12-26 19:18:09 +0000
commit14bb18fbc7e6cdea57f27a44093d645d97bacb64 (patch)
tree79cde4763d978b30bc5aa404e7f761d9cada7a1d /templates
parent591360f2a8727e3b1f9e5f28ed3f6d983d6464b8 (diff)
downloadbloat-14bb18fbc7e6cdea57f27a44093d645d97bacb64.tar.gz
bloat-14bb18fbc7e6cdea57f27a44093d645d97bacb64.zip
Add search page
Diffstat (limited to 'templates')
-rw-r--r--templates/navigation.tmpl1
-rw-r--r--templates/search.tmpl37
2 files changed, 38 insertions, 0 deletions
diff --git a/templates/navigation.tmpl b/templates/navigation.tmpl
index bd97d2d..b82c7f5 100644
--- a/templates/navigation.tmpl
+++ b/templates/navigation.tmpl
@@ -16,6 +16,7 @@
<a class="nav-link" href="/notifications">notifications{{if gt .NotificationCount 0}}({{.NotificationCount}}){{end}}</a>
<a class="nav-link" href="/timeline/local">local</a>
<a class="nav-link" href="/timeline/twkn">twkn</a>
+ <a class="nav-link" href="/search">search</a>
<a class="nav-link" href="/about">about</a>
</div>
<div>
diff --git a/templates/search.tmpl b/templates/search.tmpl
new file mode 100644
index 0000000..de80fac
--- /dev/null
+++ b/templates/search.tmpl
@@ -0,0 +1,37 @@
+{{template "header.tmpl" .HeaderData}}
+{{template "navigation.tmpl" .NavbarData}}
+<div class="page-title"> Search </div>
+
+<div>
+ <form action="/search" method="GET">
+ <span class="post-form-field>
+ <label for="query"> Query </label>
+ <input id="query" name="q" value="{{.Q}}">
+ </span>
+ <span class="post-form-field>
+ <label for="type"> Type </label>
+ <select id="type" name="type">
+ <option value="statuses" {{if eq .Type "statuses"}}selected{{end}}>Statuses</option>
+ <option value="accounts" {{if eq .Type "accounts"}}selected{{end}}>Accounts</option>
+ </select>
+ </span>
+ <button type="submit"> Search </button>
+ </form>
+</div>
+
+{{if eq .Type "statuses"}}
+{{range .Statuses}}
+{{template "status.tmpl" .}}
+{{end}}
+
+{{end}}
+{{if eq .Type "accounts"}}
+{{template "userlist.tmpl" .Users}}
+{{end}}
+
+<div class="pagination">
+ {{if .HasNext}}
+ <a href="{{.NextLink}}">next</a>
+ {{end}}
+</div>
+{{template "footer.tmpl"}}