aboutsummaryrefslogtreecommitdiff
path: root/templates/search.tmpl
blob: 076858e465ae7a0f937abb0f72eeeddfcbaa481a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{{with .Data}}
{{template "header.tmpl" (WithContext .CommonData $.Ctx)}}
<h1>Search</h1>

<form action="/search" method="GET">
	<p>
		<label>
			Query <input type="text" name="q" value="{{.Q}}">
		</label>
		<label>
			Type
			<select  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>
		</label>
		<button type="submit"> Search </button>
	</p>
</form>

{{if eq .Type "statuses"}}
{{range .Statuses}}
{{template "status.tmpl" (WithContext . $.Ctx)}}
{{else}}
{{if .Q}}<p>No data found</p>{{end}}
{{end}}
{{end}}

{{if eq .Type "accounts"}}
{{template "userlist.tmpl" (WithContext .Users $.Ctx)}}
{{end}}

<nav class="pagination">
	{{if .NextLink}}
		<a href="{{.NextLink}}">[next]</a>
	{{end}}
</nav>

{{template "footer.tmpl"}}
{{end}}