diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-11-01 14:46:15 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-11-01 14:46:15 -0400 |
commit | c7eea383aeaf6748daf994e9e28e4d0c25350736 (patch) | |
tree | a0979cbd4e6be06385fd0340e050147fdacd6e35 /got |
initial commit
Diffstat (limited to 'got')
-rw-r--r-- | got/edit.got | 16 | ||||
-rw-r--r-- | got/login.got | 10 | ||||
-rw-r--r-- | got/template.html.got | 31 | ||||
-rw-r--r-- | got/upload.got | 11 |
4 files changed, 68 insertions, 0 deletions
diff --git a/got/edit.got b/got/edit.got new file mode 100644 index 0000000..3fcdd23 --- /dev/null +++ b/got/edit.got @@ -0,0 +1,16 @@ +<!-- -*- Mode: HTML -*- --> +<h1>{{.path | html}}</h1> +<p>Content-Type: {{.ctype | html}}</p> +<form method="POST" enctype="multipart/form-data"> + <input type="hidden" name="_method" value="PUT"> + <input type="hidden" name="_xsrf_token" value="{{.xsrf_token | html}}"> + <textarea name="_body">{{.content | html }}</textarea> + <input type="submit" value="Save"> +</form> +<form method="POST" enctype="multipart/form-data"> + <input type="hidden" name="_method" value="PUT"> + <input type="hidden" name="_xsrf_token" value="{{.xsrf_token | html}}"> + <p>Instead of editing this in your browser, you can just upload a new copy.</p> + <input type="file" name="_body" required=required> + <input type="submit" value="Upload"> +</form> diff --git a/got/login.got b/got/login.got new file mode 100644 index 0000000..546d2e3 --- /dev/null +++ b/got/login.got @@ -0,0 +1,10 @@ +<!-- -*- Mode: HTML -*- --> +{{if neq .url ""}} +<p>You must log in to do that.</p> +{{endif}} +<form method="POST" enctype="multipart/form-data"> + <input type="hidden" name="_method" value="PUT"> + <label>Username: <input type="text" name="userid" /></label> + <label>Password: <input type="password" name="password" /></label> + <input type="submit" value="Save"> +</form> diff --git a/got/template.html.got b/got/template.html.got new file mode 100644 index 0000000..ab9e633 --- /dev/null +++ b/got/template.html.got @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8"> + <meta http-equiv="X-UA-Compatible" content="IE=edge"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <!-- the meta tags must come first --> + + <title>{{.title | html}}</title> + + <link href="/style.css" rel="stylesheet"> + {{.head}} + </head> + <body> + <header> + {{if eq .userid ""}} + <p>You are not logged in</p> + {{else}} + <p>You are logged in as {{.session.userid | html}}</p> + <form action="/session" method="POST"> + <input type="hidden" name="_method" value="DELETE" /> + <input type="hidden" name="_xsrf_token" value="{{.session.id | html}}" /> + <input type="submit" value="Log out" /> + </form> + {{endif}} + </header> + <article> + {{.body}} + </article> + </body> +</html> diff --git a/got/upload.got b/got/upload.got new file mode 100644 index 0000000..069d9f8 --- /dev/null +++ b/got/upload.got @@ -0,0 +1,11 @@ +<!-- -*- Mode: HTML -*- --> +<h1>{{.path | html}}</h1> +<p>Content-Type: {{.ctype | html}}</p> +<form method="POST" enctype="multipart/form-data"> + <input type="hidden" name="_method" value="PUT" /> + <input type="hidden" name="_xsrf_token" value="{{.xsrf_token | html}}"> + <p>You can't edit this type of file in your browser. But you can + upload a new version.</p> + <input type="file" name="_body" required=required /> + <input type="submit" value="Upload" /> +</form> |