aboutsummaryrefslogtreecommitdiff
path: root/templates/filters.tmpl
blob: 383a0ade2cebccb36cb2cc31f2a89c3b16093158 (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
{{with .Data}}
{{template "header.tmpl" (WithContext .CommonData $.Ctx)}}
<h1>Filters</h1>

{{if .Filters}}
<table>
	{{range .Filters}}
	<tr>
		<td> {{.Phrase}}{{if not .WholeWord}}*{{end}} </td>
		<td> 
			<form action="/unfilter/{{.ID}}" method="POST">
				<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
				<input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
				<button type="submit">Delete</button>
			</form>
		</td>
	</tr>
	{{end}}
</table>
{{else}}
	<p> No filters added </p>
{{end}}

<h1>Add Filter</h1>
<form action="/filter" method="POST">
	<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
	<input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
	<label>Phrase <input type="text" name="phrase" required></label>
	<label><input name="whole_word" type="checkbox" value="true" checked> Whole word</label>
	<button type="submit">Add</button>
</form>

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