all repos — flounder @ 8384e1d60016da0d6ac8033bd81eb9aaa3517328

A small site builder for the Gemini protocol

Cleanup edit file page

Link to file
Allow window resizing
alex wennerberg alex@alexwennerberg.com
Sat, 21 Nov 2020 00:28:32 -0800
commit

8384e1d60016da0d6ac8033bd81eb9aaa3517328

parent

560f8fdad768b809864dff6fce0faca7a8583fe5

3 files changed, 6 insertions(+), 4 deletions(-)

jump to
M http.gohttp.go

@@ -116,7 +116,9 @@ data := struct {

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

@@ -39,7 +39,7 @@ border: 1px solid #999999;

width: 100%; margin: 5px 0; padding: 3px; - resize: none; + resize: vertical; } .button {