aboutsummaryrefslogtreecommitdiff
path: root/templates/list.tmpl
diff options
context:
space:
mode:
authorr <r@freesoftwareextremist.com>2022-09-23 17:22:54 +0000
committerr <r@freesoftwareextremist.com>2022-09-23 17:22:54 +0000
commitf55595ddb63bd8afb4c85945b82aa1f174050e6b (patch)
tree3e9f909097c026b065365846ca8143295097a09f /templates/list.tmpl
parentb8c0133bcd5e7f1d4063ad992949cc19d18e7aad (diff)
parent68698a9e1afce43ef807d6b5f892ca1c0f905b8a (diff)
downloadbloat-f55595ddb63bd8afb4c85945b82aa1f174050e6b.tar.gz
bloat-f55595ddb63bd8afb4c85945b82aa1f174050e6b.zip
Merge branch 'master' into absolute_fluorideabsolute_fluoride
Diffstat (limited to 'templates/list.tmpl')
-rw-r--r--templates/list.tmpl63
1 files changed, 63 insertions, 0 deletions
diff --git a/templates/list.tmpl b/templates/list.tmpl
new file mode 100644
index 0000000..dcc6ee8
--- /dev/null
+++ b/templates/list.tmpl
@@ -0,0 +1,63 @@
+{{with .Data}}
+{{template "header.tmpl" (WithContext .CommonData $.Ctx)}}
+<div class="page-title"> List {{.List.Title}} </div>
+
+<form action="/list/{{.List.ID}}/rename" method="POST">
+ <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
+ <input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
+ <input id="title" name="title" value="{{.List.Title}}">
+ <button type="submit"> Rename </button>
+</form>
+
+<div class="page-title"> Users </div>
+{{if .Accounts}}
+<table>
+{{range .Accounts}}
+ <tr>
+ <td class="p-0"> {{template "userlistitem.tmpl" (WithContext . $.Ctx)}} </td>
+ <td class="p-0">
+ <form class="user-list-action" action="/list/{{$.Data.List.ID}}/removeuser?uid={{.ID}}" method="POST">
+ <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
+ <input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
+ <button type="submit"> Remove </button>
+ </form>
+ </td>
+ </tr>
+{{end}}
+</table>
+{{else}}
+<div class="no-data-found">No data found</div>
+{{end}}
+
+<div class="page-title"> Add user </div>
+<form class="search-form" action="/list/{{.List.ID}}" method="GET">
+ <span class="post-form-field">
+ <label for="query"> Query </label>
+ <input id="query" name="q" value="{{.Q}}">
+ </span>
+ <button type="submit"> Search </button>
+</form>
+
+{{if .Q}}
+{{if .SearchAccounts}}
+<table>
+{{range .SearchAccounts}}
+ <tr>
+ <td> {{template "userlistitem.tmpl" (WithContext . $.Ctx)}} </td>
+ <td>
+ <form class="user-list-action" action="/list/{{$.Data.List.ID}}/adduser?uid={{.ID}}" method="POST">
+ <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
+ <input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
+ <button type="submit"> Add </button>
+ </form>
+ </td>
+ </tr>
+{{end}}
+</table>
+{{else}}
+<div class="no-data-found">No data found</div>
+{{end}}
+{{end}}
+
+{{template "footer.tmpl"}}
+{{end}}