all repos — flounder @ eb3dc1e908eec909c858b2fc02836870c4b327ee

A small site builder for the Gemini protocol

Additional style changes, minor fixes
alex wennerberg alex@alexwennerberg.com
Fri, 30 Oct 2020 22:26:08 -0700
commit

eb3dc1e908eec909c858b2fc02836870c4b327ee

parent

7c53875f77af9d5d12db25ab03042cfbbad58fb7

4 files changed, 17 insertions(+), 5 deletions(-)

jump to
M templates/admin.htmltemplates/admin.html

@@ -3,8 +3,14 @@ {{template "header" .}}

<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 @@ value="activate"

/> </form> {{ end }} +</td> +<td> <form action="/admin/user/{{.Username}}/delete" method="POST" class="inline"> <input class="button delete"

@@ -22,7 +30,9 @@ onclick="return confirm('Are you SURE you want to delete this user?');"

value="delete" /> </form> -<br> +</td> +</tr> {{end}} +</table> {{template "footer" .}}
M templates/my_site.htmltemplates/my_site.html

@@ -38,7 +38,7 @@ </table>

<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')
M templates/static/style.csstemplates/static/style.css

@@ -63,10 +63,9 @@ color:blue

} a { - text-decoration: none; } a:hover { background-color: yellow; - text-decoration: underline; + text-decoration: none; }
M utils.goutils.go

@@ -22,6 +22,9 @@ }

/// 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 {