aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorr <r@freesoftwareextremist.com>2022-02-11 11:18:02 +0000
committerr <r@freesoftwareextremist.com>2022-02-11 11:49:23 +0000
commitc390a0c32720f6afe852bc7a3a3f64c3afe9e401 (patch)
tree57ac4a30f8fe45edf0369eaa4c5609ffb74315eb /templates
parentc2f237e9019a4fb31cd7d969bf59670c144592c8 (diff)
downloadbloat-c390a0c32720f6afe852bc7a3a3f64c3afe9e401.tar.gz
bloat-c390a0c32720f6afe852bc7a3a3f64c3afe9e401.zip
Add lists
Diffstat (limited to 'templates')
-rw-r--r--templates/about.tmpl4
-rw-r--r--templates/list.tmpl63
-rw-r--r--templates/lists.tmpl35
-rw-r--r--templates/nav.tmpl9
-rw-r--r--templates/userlist.tmpl14
-rw-r--r--templates/userlistitem.tmpl15
6 files changed, 121 insertions, 19 deletions
diff --git a/templates/about.tmpl b/templates/about.tmpl
index 54316cf..0e4d001 100644
--- a/templates/about.tmpl
+++ b/templates/about.tmpl
@@ -46,11 +46,11 @@
<td> <kbd>6</kbd> </td>
</tr>
<tr>
- <td> Settings </td>
+ <td> Lists </td>
<td> <kbd>7</kbd> </td>
</tr>
<tr>
- <td> Signout </td>
+ <td> Settings </td>
<td> <kbd>8</kbd> </td>
</tr>
<tr>
diff --git a/templates/list.tmpl b/templates/list.tmpl
new file mode 100644
index 0000000..1b15278
--- /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 | html}}">
+ </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}}
diff --git a/templates/lists.tmpl b/templates/lists.tmpl
new file mode 100644
index 0000000..27979cb
--- /dev/null
+++ b/templates/lists.tmpl
@@ -0,0 +1,35 @@
+{{with .Data}}
+{{template "header.tmpl" (WithContext .CommonData $.Ctx)}}
+<div class="page-title"> Lists </div>
+
+{{range .Lists}}
+<div>
+ <a href="/timeline/list?list={{.ID}}"> {{.Title}} timeline </a>
+ -
+ <form class="d-inline" action="/list/{{.ID}}" method="GET">
+ <button type="submit" class="btn-link"> edit </button>
+ </form>
+ -
+ <form class="d-inline" action="/list/{{.ID}}/remove" method="POST">
+ <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
+ <input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
+ <button type="submit" class="btn-link"> delete </button>
+ </form>
+</div>
+{{else}}
+<div class="no-data-found">No data found</div>
+{{end}}
+
+<div class="page-title"> Add list </div>
+<form action="/list" 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="title"> Title </label>
+ <input id="title" name="title" required>
+ </span>
+ <button type="submit"> Add </button>
+</form>
+
+{{template "footer.tmpl"}}
+{{end}}
diff --git a/templates/nav.tmpl b/templates/nav.tmpl
index ea18a5f..e7a7981 100644
--- a/templates/nav.tmpl
+++ b/templates/nav.tmpl
@@ -17,16 +17,17 @@
<a class="nav-link" href="/timeline/home" accesskey="1" title="Home timeline (1)">home</a>
<a class="nav-link" href="/timeline/direct" accesskey="2" title="Direct timeline (2)">direct</a>
<a class="nav-link" href="/timeline/local" accesskey="3" title="Local timeline (3)">local</a>
- <a class="nav-link" href="/timeline/twkn" accesskey="5" title="The Whole Known Netwwork (4)">twkn</a>
- <a class="nav-link" href="/timeline/remote" accesskey="4" title="Remote timeline (5)">remote</a>
+ <a class="nav-link" href="/timeline/twkn" accesskey="4" title="The Whole Known Netwwork (4)">twkn</a>
+ <a class="nav-link" href="/timeline/remote" accesskey="5" title="Remote timeline (5)">remote</a>
<a class="nav-link" href="/search" accesskey="6" title="Search (6)">search</a>
</div>
<div>
- <a class="nav-link" href="/settings" target="_top" accesskey="7" title="Settings (7)">settings</a>
+ <a class="nav-link" href="/lists" accesskey="7" title="Lists (7)">lists</a>
+ <a class="nav-link" href="/settings" target="_top" accesskey="8" title="Settings (8)">settings</a>
<form class="signout" action="/signout" method="post" target="_top">
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
<input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
- <input type="submit" value="signout" class="btn-link nav-link" accesskey="8" title="Signout (8)">
+ <input type="submit" value="signout" class="btn-link nav-link" title="Signout">
</form>
<a class="nav-link" href="/about" accesskey="9" title="About (9)">about</a>
</div>
diff --git a/templates/userlist.tmpl b/templates/userlist.tmpl
index b8e0e5d..f206397 100644
--- a/templates/userlist.tmpl
+++ b/templates/userlist.tmpl
@@ -1,19 +1,7 @@
{{with .Data}}
<div>
{{range .}}
- <div class="user-list-item">
- <div class="user-list-profile-img">
- <a class="img-link" href="/user/{{.ID}}">
- <img class="status-profile-img" src="{{.Avatar}}" title="@{{.Acct}}" alt="avatar" height="48" />
- </a>
- </div>
- <div class="user-list-name">
- <div class="status-dname"> {{EmojiFilter (html .DisplayName) .Emojis}} </div>
- <a class="img-link" href="/user/{{.ID}}">
- <div class="status-uname"> @{{.Acct}} </div>
- </a>
- </div>
- </div>
+ {{template "userlistitem.tmpl" (WithContext . $.Ctx)}}
{{else}}
<div class="no-data-found">No data found</div>
{{end}}
diff --git a/templates/userlistitem.tmpl b/templates/userlistitem.tmpl
new file mode 100644
index 0000000..51261c8
--- /dev/null
+++ b/templates/userlistitem.tmpl
@@ -0,0 +1,15 @@
+{{with .Data}}
+<div class="user-list-item">
+ <div class="user-list-profile-img">
+ <a class="img-link" href="/user/{{.ID}}">
+ <img class="status-profile-img" src="{{.Avatar}}" title="@{{.Acct}}" alt="avatar" height="48" />
+ </a>
+ </div>
+ <div class="user-list-name">
+ <div class="status-dname"> {{EmojiFilter (html .DisplayName) .Emojis}} </div>
+ <a class="img-link" href="/user/{{.ID}}">
+ <div class="status-uname"> @{{.Acct}} </div>
+ </a>
+ </div>
+</div>
+{{end}}