summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/includes/layout.gohtml19
-rw-r--r--templates/pages/error.gohtml5
-rw-r--r--templates/pages/index.gohtml21
-rw-r--r--templates/pages/memo.gohtml13
-rw-r--r--templates/pages/notfound.gohtml10
-rw-r--r--templates/pages/save.gohtml13
6 files changed, 81 insertions, 0 deletions
diff --git a/templates/includes/layout.gohtml b/templates/includes/layout.gohtml
new file mode 100644
index 0000000..adebd99
--- /dev/null
+++ b/templates/includes/layout.gohtml
@@ -0,0 +1,19 @@
+<!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.0">
+ <title>SendSafe</title>
+ <link rel="stylesheet" href="/css/index.css" />
+ <script src="https://unpkg.com/turbolinks/dist/turbolinks.js" crossorigin="anonymous"></script>
+</head>
+
+<body>
+<header>
+ <a id="header-logo" href="/"></> SendSafe</a>
+</header>
+{{template "content" .}}
+</body>
+</html>
diff --git a/templates/pages/error.gohtml b/templates/pages/error.gohtml
new file mode 100644
index 0000000..8d63bbd
--- /dev/null
+++ b/templates/pages/error.gohtml
@@ -0,0 +1,5 @@
+{{template "layout.gohtml" .}}
+{{define "content"}}
+<h1>Error happened.</h1>
+<h2>Nothing can be done.</h2>
+{{ end }}
diff --git a/templates/pages/index.gohtml b/templates/pages/index.gohtml
new file mode 100644
index 0000000..8cfcae1
--- /dev/null
+++ b/templates/pages/index.gohtml
@@ -0,0 +1,21 @@
+{{template "layout.gohtml" .}}
+{{define "content"}}
+<div class="layout-center">
+ <form method="POST" action="/save">
+ <h1>New secret</h1>
+ <label for="secret">Secret content:<span class="required">(required)</span></label>
+ <textarea id="secret" name="secret" rows="6" required></textarea>
+ <label><span>Expires after (or <b>first</b> read):</span><span class="required">(required)</span></label>
+ <div class="form-row">
+ <label><input id="days" name="days" type="number" value="0" min="0" max="365" required />days</label>
+ <label><input id="hours" name="hours" type="number" value="0" min="0" max="23" required />hours</label>
+ <label><input id="minutes" name="minutes" type="number" value="30" min="0" max="59" required />minutes</label>
+ </div>
+ {{/* <label for="pin">Pin code to open:<span class="optional">(optional)</span></label> */}}
+ {{/* <input id="pin" name="pin" type="string" value="" /> */}}
+ <hr />
+ <input type="hidden" name="csrf" value={{.csrf}} />
+ <input type="submit" value="Send" />
+ </form>
+</div>
+{{ end }}
diff --git a/templates/pages/memo.gohtml b/templates/pages/memo.gohtml
new file mode 100644
index 0000000..804d7b7
--- /dev/null
+++ b/templates/pages/memo.gohtml
@@ -0,0 +1,13 @@
+{{template "layout.gohtml" .}}
+{{define "content"}}
+<div class="layout-center">
+ <form action="/">
+ <h1>Secret:</h1>
+ <b>Warning!</b> This text already deleted from server! If you refresh or close page - secret will be completely lost!
+ <hr />
+ <pre>{{.secret}}</pre>
+ <hr />
+ <input type="submit" value="&larr; Back">
+ </form>
+</div>
+{{ end }}
diff --git a/templates/pages/notfound.gohtml b/templates/pages/notfound.gohtml
new file mode 100644
index 0000000..911f8e1
--- /dev/null
+++ b/templates/pages/notfound.gohtml
@@ -0,0 +1,10 @@
+{{template "layout.gohtml" .}}
+{{define "content"}}
+<div class="layout-center">
+ <form action="/">
+ <h1>Not found.</h1>
+ <p>Link expired or already viewed.</p>
+ <input type="submit" value="&larr; Back">
+ </form>
+</div>
+{{ end }}
diff --git a/templates/pages/save.gohtml b/templates/pages/save.gohtml
new file mode 100644
index 0000000..f940502
--- /dev/null
+++ b/templates/pages/save.gohtml
@@ -0,0 +1,13 @@
+{{template "layout.gohtml" .}}
+{{define "content"}}
+<div class="layout-center">
+ <form action="/">
+ <h1>Saved</h1>
+ Secret url:
+ <hr />
+ <a href="https://sendsafe.xyz/s/{{.id}}">https://sendsafe.xyz/s/{{.id}}</a>
+ <hr />
+ <input type="submit" value="&larr; Back">
+ </form>
+</div>
+{{ end }}