summaryrefslogtreecommitdiff
path: root/week-7/Final4/blog/views/entry_template.html
diff options
context:
space:
mode:
Diffstat (limited to 'week-7/Final4/blog/views/entry_template.html')
-rw-r--r--week-7/Final4/blog/views/entry_template.html58
1 files changed, 58 insertions, 0 deletions
diff --git a/week-7/Final4/blog/views/entry_template.html b/week-7/Final4/blog/views/entry_template.html
new file mode 100644
index 0000000..27a0789
--- /dev/null
+++ b/week-7/Final4/blog/views/entry_template.html
@@ -0,0 +1,58 @@
+<!doctype HTML>
+<html
+<head>
+<title>
+Blog Post
+</title>
+</head>
+<body>
+{% if username %}
+Welcome {{username}} <a href="/logout">Logout</a> | <a href="/newpost">New Post</a><p>
+{% else %}
+You are not logged in! <a href="/login">Login</a> | <a href="/signup">Sign Up</a><p>
+{% endif %}
+<a href="/">Blog Home</a><br><br>
+
+<h2>{{post['title']}}</h2>
+Posted {{post['date']}}<i> By {{post['author']}}</i><br>
+<hr>
+{% autoescape false %}
+{{post['body']}}
+{% endautoescape %}
+<p>
+<em>Filed Under</em>:
+{% for tag in post.tags %}
+ {% if loop.first %}
+ <a href="/tag/{{tag}}">{{tag}}</a>
+ {% else %}
+ , <a href="/tag/{{tag}}">{{tag}}</a>
+ {% endif %}
+{% endfor %}
+<p>
+Comments:
+<ul>
+{% for comment in post.comments %}
+<form action="/like" method="POST">
+<input type="hidden" name="permalink", value="{{post['permalink']}}">
+<input type="hidden" name="comment_ordinal", value="{{loop.index0}}">
+Author: {{comment['author']}}<br>
+Likes: {{comment['num_likes']}} <input type="submit" value="Like"></form><br>
+{{comment['body']}}<br>
+<hr>
+{% endfor %}
+<h3>Add a comment</h3>
+<form action="/newcomment" method="POST">
+<input type="hidden" name="permalink", value="{{post['permalink']}}">
+<h4>{{errors}}</h4>
+<b>Name</b> (required)<br>
+<input type="text" name="commentName" size="60" value="{{comment['name']}}"><br>
+<b>Email</b> (optional)<br>
+<input type="text" name="commentEmail" size="60" value="{{comment['email']}}"><br>
+<b>Comment</b><br>
+<textarea name="commentBody" cols="60" rows="10">{{comment['body']}}</textarea><br>
+<input type="submit" value="Submit">
+</ul>
+</body>
+</html>
+
+