summaryrefslogtreecommitdiffhomepage
path: root/apioforum/templates
diff options
context:
space:
mode:
authorubq323 <ubq323>2021-05-24 00:26:43 +0000
committerubq323 <ubq323>2021-05-24 00:26:43 +0000
commit282a2a1dd49d8c21402574e853ad231fe606dfbb (patch)
treedeb71834a50863ddb5e4e521d5d474410e665190 /apioforum/templates
parent78bee4ec778947df35fa47e29282a60aec5a7acd (diff)
create posts and threads
Diffstat (limited to 'apioforum/templates')
-rw-r--r--apioforum/templates/create_thread.html14
-rw-r--r--apioforum/templates/view_forum.html1
-rw-r--r--apioforum/templates/view_thread.html6
3 files changed, 20 insertions, 1 deletions
diff --git a/apioforum/templates/create_thread.html b/apioforum/templates/create_thread.html
new file mode 100644
index 0000000..b8d204c
--- /dev/null
+++ b/apioforum/templates/create_thread.html
@@ -0,0 +1,14 @@
+{% extends 'base.html' %}
+{% block header %}
+<h1>{% block title %}create thread{% endblock %}</h1>
+{% endblock %}
+
+{% block content %}
+<form action="{{url_for('forum.create_thread')}}", method="POST">
+ <label for="title">thread title</label>
+ <input name="title" id="title">
+ <label for="content">thread content</label>
+ <textarea name="content" id="content"></textarea>
+ <input type="submit" value="yes">
+</form>
+{% endblock %}
diff --git a/apioforum/templates/view_forum.html b/apioforum/templates/view_forum.html
index 2140c7a..13e35a8 100644
--- a/apioforum/templates/view_forum.html
+++ b/apioforum/templates/view_forum.html
@@ -2,6 +2,7 @@
{% block header %}<h1>{% block title %}apio forum george etc{%endblock%}</h1>{%endblock%}
{%block content%}
<p>the</p>
+<a href="{{url_for('forum.create_thread')}}">create thread</a>
<table>
<tr>
<th>id</th>
diff --git a/apioforum/templates/view_thread.html b/apioforum/templates/view_thread.html
index ebbcd3b..718df4e 100644
--- a/apioforum/templates/view_thread.html
+++ b/apioforum/templates/view_thread.html
@@ -9,7 +9,7 @@
<dl>
{% for post in posts %}
<dt>{{post.author}} {{post.created}}</dt>
-<dd>{{post.content}}</dd>
+<dd>{{rendered_posts[loop.index0] | safe}}<dd>
{% else %}
<dt>there weren't</dt>
<dd>any posts</dd>
@@ -17,6 +17,10 @@
</dl>
{% if g.user %}
<p>loggedi n as {{ g.user }}</p>
+<form action="{{url_for('thread.create_post',thread_id=thread_id)}}" method="POST">
+ <textarea name="content"></textarea>
+ <input type="submit" value="yes">
+</form>
{% else %}
<p>not logged in</p>
{% endif %}