aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2018-01-10 21:09:10 +0100
committerHarald Eilertsen <haraldei@anduin.net>2018-01-10 21:09:10 +0100
commit42413235bed80e9af6a9655dba504dbf2bdc572c (patch)
tree0902fef17fcab699652fc801f7ee36d36ad570a5 /templates
parentf6033128292bbd5838a6585a1214bc6c9275de38 (diff)
downloadrocket-blog-42413235bed80e9af6a9655dba504dbf2bdc572c.tar.gz
rocket-blog-42413235bed80e9af6a9655dba504dbf2bdc572c.tar.bz2
rocket-blog-42413235bed80e9af6a9655dba504dbf2bdc572c.zip
Adding edit/update logic.
The model is not done yet, though. No net on the train.
Diffstat (limited to 'templates')
-rw-r--r--templates/edit_post.html30
-rw-r--r--templates/post_teaser.html4
2 files changed, 32 insertions, 2 deletions
diff --git a/templates/edit_post.html b/templates/edit_post.html
new file mode 100644
index 0000000..9154e3d
--- /dev/null
+++ b/templates/edit_post.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Edit {{ post.title }}</title>
+ </head>
+ <body>
+ <h1>Edit post</h1>
+ <form id="new_post" name="post" method="post" action="/posts/update">
+ <input type="hidden" name="id" value="{{ post.id }}">
+ <div class="field">
+ <label>Title:</label>
+ <input type="text" name="title" value="{{ post.title }}">
+ </div>
+
+ <div class="field">
+ <label>Contents:</label>
+ <textarea name="body">{{ post.body }}</textarea>
+ </div>
+
+ <div class="field">
+ <input type="checkbox" checked="{{ post.published }}">
+ <label>Published</label>
+ </div>
+
+ <div class="actions">
+ <input type="submit" value="Save">
+ </div>
+ </form>
+ </body>
+</html>
diff --git a/templates/post_teaser.html b/templates/post_teaser.html
index 19a30ec..751f4ea 100644
--- a/templates/post_teaser.html
+++ b/templates/post_teaser.html
@@ -2,10 +2,10 @@
<header>
<h1><a href="/posts/{{ .id }}">{{ .title }}</a></h1>
<div class="post-actions">
- Edit | Publish | Delete
+ <a href="/posts/{{ .id }}/edit">Edit</a> | Publish | Delete
</div>
</header>
<section class="teaser">
{{ .body }}
</section>
-</article> \ No newline at end of file
+</article>