aboutsummaryrefslogtreecommitdiff
path: root/templates/edit.html
diff options
context:
space:
mode:
Diffstat (limited to 'templates/edit.html')
-rw-r--r--templates/edit.html52
1 files changed, 52 insertions, 0 deletions
diff --git a/templates/edit.html b/templates/edit.html
new file mode 100644
index 0000000..fef6846
--- /dev/null
+++ b/templates/edit.html
@@ -0,0 +1,52 @@
+{{ with .Idea}}
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta property="og:title" content="Editing '{{.Title}}'"/>
+ <meta property="og:image" content="/static/favicon.ico" />
+ <link rel="stylesheet" href="/static/main.css">
+ <title>Editing "{{.Title}}"</title>
+ <style>
+textarea[name="text"] {
+ color: #4c4c4c;
+ border: dashed 1px black;
+ font-size: 1.25em;
+ font-family: monospace;
+ width: 93%;
+ margin-left: 3%;
+ margin-right: 4%;
+}
+input[name="title"] {
+ color: #4c4c4c;
+ border: dashed 1px black;
+ font-weight: bold;
+ font-size: 2em;
+ display: inline;
+ width: 90%;
+}
+ </style>
+ </head>
+ <body>
+ <h3>Editing "{{.Title}}"</h3>
+ <hr>
+ <div class="idea">
+ <form action="{{$.RoutePrefix}}/idea/edit/" method="post">
+ <input name="title" type="text" value="{{.Title}}"><br>
+ <textarea name="text" rows=6 required>{{.Text}}</textarea>
+ <p class="creation">by <span class="author">{{.Author}}</span> on <span class="date">{{.LastUpdated}}</span></p>
+ <input type="hidden" name="id" value="{{.Id}}"}}>
+ <input type="submit" value="confirm">
+ </form>
+ <button id="cancel">cancel</button>
+ </div>
+ </body>
+</html>
+<script defer>
+ let cancelButton = document.getElementById("cancel")
+ cancelButton.onclick = function() {
+ window.location = "{{$.RoutePrefix}}"
+ }
+</script>
+{{end}}