aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorr <r@freesoftwareextremist.com>2021-01-30 16:51:09 +0000
committerr <r@freesoftwareextremist.com>2021-01-30 16:53:57 +0000
commit4f1425febf6efb45eaf91aff19b215b8c7e77bec (patch)
treeb6b72093906cac8c98ef9d593eed62214c3b5ceb /templates
parent3ac95ab3b117ee8867a30c8e4b30ab37411e5ccf (diff)
downloadbloat-4f1425febf6efb45eaf91aff19b215b8c7e77bec.tar.gz
bloat-4f1425febf6efb45eaf91aff19b215b8c7e77bec.zip
Add filters
Diffstat (limited to 'templates')
-rw-r--r--templates/filters.tmpl40
-rw-r--r--templates/user.tmpl1
2 files changed, 41 insertions, 0 deletions
diff --git a/templates/filters.tmpl b/templates/filters.tmpl
new file mode 100644
index 0000000..ef7c024
--- /dev/null
+++ b/templates/filters.tmpl
@@ -0,0 +1,40 @@
+{{with .Data}}
+{{template "header.tmpl" (WithContext .CommonData $.Ctx)}}
+<div class="page-title"> Filters </div>
+
+{{if .Filters}}
+<table class="filters">
+ {{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}}
+ <div class="filters"> No filters added </div>
+{{end}}
+
+<div class="page-title"> Add filter </div>
+<form action="/filter" method="POST">
+ <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
+ <input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
+ <span class="settings-form-field">
+ <label for="phrase"> Phrase </label>
+ <input id="phrase" name="phrase" required>
+ </span>
+ <span class="settings-form-field">
+ <input id="whole-word" name="whole_word" type="checkbox" value="true" checked>
+ <label for="whole-word"> Whole word </label>
+ </span>
+ <button type="submit"> Add </button>
+</form>
+
+{{template "footer.tmpl"}}
+{{end}}
diff --git a/templates/user.tmpl b/templates/user.tmpl
index af6a8d1..7aaefa7 100644
--- a/templates/user.tmpl
+++ b/templates/user.tmpl
@@ -119,6 +119,7 @@
{{end}}
<div>
<a href="/usersearch/{{.User.ID}}"> search statuses </a>
+ {{if .IsCurrent}} - <a href="/filters"> filters </a> {{end}}
</div>
</div>
<div class="user-profile-decription">