Add dropdown menu on admin page
alex wennerberg alex@alexwennerberg.com
Tue, 10 Nov 2020 17:24:37 -0800
2 files changed,
15 insertions(+),
12 deletions(-)
M
templates/admin.html
→
templates/admin.html
@@ -3,15 +3,14 @@ {{template "header" .}}
<h1>{{.PageTitle}}</h1> {{template "nav.html" .}} <br> -<table> {{ range .Users }} -<tr> - <td> -<a href="//{{.Username}}.{{$domain}}">{{.Username}}</a> -<td><a href=mailto:{{.Email}}>{{.Email}}</a> -</td> -<td> +<details> + <summary><b>{{.Username}}</b> {{if not .Active}}<em>(inactive)</em>{{end}}</summary> + <div class="user-admin-details"> + <p>Home: <a href="//{{.Username}}.{{$domain}}">{{.Username}}</a> </p> + <p>Email: <a href=mailto:{{.Email}}>{{.Email}}</a></p> {{ if not .Active }} +<p> <form action="/admin/user/{{.Username}}/activate" method="POST" class="inline"> <input class="button"@@ -19,9 +18,9 @@ type="submit"
value="activate" /> </form> +</p> {{ end }} -</td> -<td> + <p> <form action="/admin/user/{{.Username}}/delete" method="POST" class="inline"> <input class="button delete"@@ -30,9 +29,8 @@ onclick="return confirm('Are you SURE you want to delete this user?');"
value="delete" /> </form> -</td> -</tr> +</div> +</details> {{end}} -</table> {{template "footer" .}}
M
templates/static/style.css
→
templates/static/style.css
@@ -58,6 +58,11 @@
.nav { color: blue; } + +.user-admin-details { + margin-left: 1em; + margin-bottom: 1em; +} a:visited { color:blue }