flounder

A simple gemini site builder
Log | Files | Refs | README | LICENSE

commit eb3dc1e908eec909c858b2fc02836870c4b327ee
parent 7c53875f77af9d5d12db25ab03042cfbbad58fb7
Author: alex wennerberg <alex@alexwennerberg.com>
Date:   Fri, 30 Oct 2020 22:26:08 -0700

Additional style changes, minor fixes

Diffstat:
Mtemplates/admin.html | 14++++++++++++--
Mtemplates/my_site.html | 2+-
Mtemplates/static/style.css | 3+--
Mutils.go | 3+++
4 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/templates/admin.html b/templates/admin.html @@ -3,8 +3,14 @@ <h1>{{.PageTitle}}</h1> {{template "nav.html" .}} <br> +<table> {{ range .Users }} -<a href="//{{.Username}}.{{$domain}}">{{.Username}}</a> <a href=mailto:{{.Email}}>{{.Email}}</a> +<tr> + <td> +<a href="//{{.Username}}.{{$domain}}">{{.Username}}</a> +<td><a href=mailto:{{.Email}}>{{.Email}}</a> +</td> +<td> {{ if not .Active }} <form action="/admin/user/{{.Username}}/activate" method="POST" class="inline"> <input @@ -14,6 +20,8 @@ /> </form> {{ end }} +</td> +<td> <form action="/admin/user/{{.Username}}/delete" method="POST" class="inline"> <input class="button delete" @@ -22,7 +30,9 @@ value="delete" /> </form> -<br> +</td> +</tr> {{end}} +</table> {{template "footer" .}} diff --git a/templates/my_site.html b/templates/my_site.html @@ -38,7 +38,7 @@ <h3>Create file by name:</h3> <noscript>Create a new page by going to /edit/[filename]</noscript> <input id="edit_new" size=32 placeholder="New filename, e.g. newfile.gmi" /> -<a href="#" id="create_new">Edit new page</a><br> +<a href="#" id="create_new">Edit new file</a><br> <script> var input = document.getElementById('edit_new') var create = document.getElementById('create_new') diff --git a/templates/static/style.css b/templates/static/style.css @@ -63,10 +63,9 @@ a:visited { } a { - text-decoration: none; } a:hover { background-color: yellow; - text-decoration: underline; + text-decoration: none; } diff --git a/utils.go b/utils.go @@ -22,6 +22,9 @@ func timeago(t *time.Time) string { /// Perform some checks to make sure the file is OK func checkIfValidFile(filename string, fileBytes []byte) error { + if len(filename) == 0 { + return fmt.Errorf("Please enter a filename") + } ext := strings.ToLower(path.Ext(filename)) found := false for _, mimetype := range c.OkExtensions {