flounder

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

commit 8384e1d60016da0d6ac8033bd81eb9aaa3517328
parent 560f8fdad768b809864dff6fce0faca7a8583fe5
Author: alex wennerberg <alex@alexwennerberg.com>
Date:   Sat, 21 Nov 2020 00:28:32 -0800

Cleanup edit file page

Link to file
Allow window resizing

Diffstat:
Mhttp.go | 4+++-
Mtemplates/edit_file.html | 4++--
Mtemplates/static/style.css | 2+-
3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/http.go b/http.go @@ -116,7 +116,9 @@ func editFileHandler(w http.ResponseWriter, r *http.Request) { FileName string FileText string PageTitle string - }{fileName, string(fileBytes), c.SiteTitle} + AuthUser string + Host string + }{fileName, string(fileBytes), c.SiteTitle, authUser, c.Host} err = t.ExecuteTemplate(w, "edit_file.html", data) if err != nil { log.Println(err) diff --git a/templates/edit_file.html b/templates/edit_file.html @@ -1,9 +1,9 @@ {{template "header" .}} -<h2>Editing {{.FileName}}</h2> +<h2>Editing <a href="//{{.AuthUser}}.{{.Host}}/{{.FileName}}">{{.FileName}}</a></h2> <form id="edit-form" action="/edit/{{.FileName}}" method="POST"> <label for="rename">Rename:</label> <input type="text" value="{{.FileName}}" id="rename" name="rename"> - <textarea rows="20" name="file_text" id="editor">{{.FileText}}</textarea> + <textarea rows="25" name="file_text" id="editor">{{.FileText}}</textarea> <br> <input type="submit" value="Save file" class="button"> </form> diff --git a/templates/static/style.css b/templates/static/style.css @@ -39,7 +39,7 @@ img { width: 100%; margin: 5px 0; padding: 3px; - resize: none; + resize: vertical; } .button {