all repos — flounder @ b88a3d192ff31664c0b51a1ccadf88897b0e0ad6

A small site builder for the Gemini protocol

Add dropdown menu on admin page
alex wennerberg alex@alexwennerberg.com
Tue, 10 Nov 2020 17:24:37 -0800
commit

b88a3d192ff31664c0b51a1ccadf88897b0e0ad6

parent

cd4229413269e4ea5dc31bec7a4a2c5415c78fba

2 files changed, 15 insertions(+), 12 deletions(-)

jump to
M templates/admin.htmltemplates/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.csstemplates/static/style.css

@@ -58,6 +58,11 @@

.nav { color: blue; } + +.user-admin-details { + margin-left: 1em; + margin-bottom: 1em; +} a:visited { color:blue }