-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathindex.html
More file actions
33 lines (31 loc) · 1.23 KB
/
index.html
File metadata and controls
33 lines (31 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<!DOCTYPE html>
{% autoescape true %}
<html>
<body>
<h2>Posts</h2>
{% for post in posts %}
<h3>Title: {{ post.title }}</h3>
<h5>{{ post.date.strftime("%d/%m/%y") }}</h5>
<p>{{ post.content }}</p>
{% for comment_key in post.comment_keys %}
<h3>Commenter: {{ comment_key.get().name }}</h3>
<!-- <h5> comment_key.date.strftime("%d/%m/%y") }}</h5> -->
<p>{{ comment_key.get().comment }}</p>
{% endfor %}
<!-- This form is to create a new comment, it needs to send to '/comment using the post method' -->
<form action="" method="">
<!-- It needs to take inputs for the commenters name and comment -->
<!-- This next line is a sneaky way to make sure we know what post we are talking about -->
<div><input type="hidden" name="post_url_key" value="{{ post.key.urlsafe() }}">
<div><input type="submit" value="Leave Comment"></div>
</form>
<hr>
{% endfor %}
<form action="/" method="post">
<div>Title: <input name="name"></input></div>
<div>Content: <textarea name="content" rows="3" cols="60"></textarea></div>
<div><input type="submit" value="Add Post"></div>
</form>
</body>
</html>
{% endautoescape %}