bloat/templates/search.tmpl

40 lines
1.0 KiB
Cheetah
Raw Normal View History

2020-01-14 18:57:16 +02:00
{{with .Data}}
2020-02-19 00:15:37 +02:00
{{template "header.tmpl" (WithContext .CommonData $.Ctx)}}
2019-12-26 21:18:09 +02:00
<div class="page-title"> Search </div>
2020-01-30 17:32:37 +02:00
<form class="search-form" action="/search" method="GET">
2020-07-28 17:01:32 +03:00
<span class="post-form-field">
2020-01-30 17:32:37 +02:00
<label for="query"> Query </label>
2020-10-17 19:25:08 +03:00
<input id="query" name="q" value="{{.Q}}">
2020-01-30 17:32:37 +02:00
</span>
2020-07-28 17:01:32 +03:00
<span class="post-form-field">
2020-01-30 17:32:37 +02:00
<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>
2019-12-26 21:18:09 +02:00
{{if eq .Type "statuses"}}
{{range .Statuses}}
2020-01-14 18:57:16 +02:00
{{template "status.tmpl" (WithContext . $.Ctx)}}
2020-02-26 18:31:49 +02:00
{{else}}
2020-08-22 09:48:13 +03:00
{{if .Q}}<div class="no-data-found">No data found</div>{{end}}
2019-12-26 21:18:09 +02:00
{{end}}
{{end}}
2020-07-28 17:01:32 +03:00
2019-12-26 21:18:09 +02:00
{{if eq .Type "accounts"}}
2020-01-14 18:57:16 +02:00
{{template "userlist.tmpl" (WithContext .Users $.Ctx)}}
2019-12-26 21:18:09 +02:00
{{end}}
<div class="pagination">
2020-01-28 19:51:00 +02:00
{{if .NextLink}}
2020-09-22 19:22:58 +03:00
<a href="{{.NextLink}}">[next]</a>
2019-12-26 21:18:09 +02:00
{{end}}
</div>
2020-01-14 18:57:16 +02:00
2019-12-26 21:18:09 +02:00
{{template "footer.tmpl"}}
2020-01-14 18:57:16 +02:00
{{end}}