summaryrefslogtreecommitdiff
path: root/got
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-11-02 16:09:45 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-11-02 16:09:45 -0400
commitade49d8845e044292da64fcbe72a1f7ee91e66d9 (patch)
treeb2030f99f28b1d9366989df3d74da5d874d6dbd9 /got
parent60632ea541ac6fc57c8158bf44c625c526e1b215 (diff)
some views
Diffstat (limited to 'got')
-rw-r--r--got/deleted.got0
-rw-r--r--got/login.got10
-rw-r--r--got/modified.got0
-rw-r--r--got/page.html.got17
-rw-r--r--got/template.html.got31
-rw-r--r--got/upload.got11
-rw-r--r--got/view_blob.got (renamed from got/edit.got)14
-rw-r--r--got/view_tree.got16
8 files changed, 45 insertions, 54 deletions
diff --git a/got/deleted.got b/got/deleted.got
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/got/deleted.got
diff --git a/got/login.got b/got/login.got
deleted file mode 100644
index 546d2e3..0000000
--- a/got/login.got
+++ /dev/null
@@ -1,10 +0,0 @@
-<!-- -*- 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/modified.got b/got/modified.got
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/got/modified.got
diff --git a/got/page.html.got b/got/page.html.got
new file mode 100644
index 0000000..a0f34f9
--- /dev/null
+++ b/got/page.html.got
@@ -0,0 +1,17 @@
+<!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>
+ {{.body}}
+ </body>
+</html>
diff --git a/got/template.html.got b/got/template.html.got
deleted file mode 100644
index ab9e633..0000000
--- a/got/template.html.got
+++ /dev/null
@@ -1,31 +0,0 @@
-<!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
deleted file mode 100644
index 069d9f8..0000000
--- a/got/upload.got
+++ /dev/null
@@ -1,11 +0,0 @@
-<!-- -*- 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>
diff --git a/got/edit.got b/got/view_blob.got
index 3fcdd23..a1d7e2c 100644
--- a/got/edit.got
+++ b/got/view_blob.got
@@ -1,16 +1,26 @@
<!-- -*- Mode: HTML -*- -->
<h1>{{.path | html}}</h1>
<p>Content-Type: {{.ctype | html}}</p>
+{{if hasprefix .ctype "text/"}}
<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>
+ <label>
+ Description of change:
+ <input type="text" value="_message" />
+ </label>
<input type="submit" value="Save">
</form>
+{{else}}
+<p>You can't edit this type of file in your browser.</p>
+{{end}}
<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>
+ <label>
+ Description of change:
+ <input type="text" value="_message" />
+ </label>
<input type="submit" value="Upload">
</form>
diff --git a/got/view_tree.got b/got/view_tree.got
new file mode 100644
index 0000000..46f4af7
--- /dev/null
+++ b/got/view_tree.got
@@ -0,0 +1,16 @@
+<!-- -*- Mode: HTML -*- -->
+<h1>Index of {{.path | html}}</h1>
+<table>
+ <tr>
+ <td><a href="..">..</a></td>
+ <td>tree</td>
+ <td>-</td>
+ </tr>
+ {{range $name, $file := .files}}
+ <tr>
+ <td><a href="{{$name | html}}">{{$name | html}}</a></td>
+ <td>{{$file.Type | html}}</td>
+ <td>{{if lt $file.Size 0}}-{{else}}{{$file.Size | html}}{{end}}</td>
+ </tr>
+ {{end}}
+</table>