aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorubq323 <ubq323>2021-06-02 17:02:09 +0000
committerubq323 <ubq323>2021-06-02 17:02:09 +0000
commit10fb40ceaefa4c014bbc67d4b908af2163344f0c (patch)
tree5ebf840b88451e91b7c15134b569a80ad1da501a
parent282a2a1dd49d8c21402574e853ad231fe606dfbb (diff)
view threads apparently
-rw-r--r--apioforum/templates/base.html39
-rw-r--r--apioforum/templates/view_thread.html33
2 files changed, 38 insertions, 34 deletions
diff --git a/apioforum/templates/base.html b/apioforum/templates/base.html
index 28fd055..d4ecb54 100644
--- a/apioforum/templates/base.html
+++ b/apioforum/templates/base.html
@@ -4,26 +4,29 @@
<head>
<title>{%block title %}{% endblock %}</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
+ <link rel="stylesheet" href="/static/style.css">
</head>
<body>
- <nav>
- <h1>apioforum</h1>
- <ul>
- {% if g.user %}
- <li>{{ g.user }}</li>
- <li><a href="{{ url_for('auth.logout') }}">logout</a></li>
- {% else %}
- <li><a href="{{ url_for('auth.login') }}">login</a></li>
- <li><a href="{{ url_for('auth.register') }}">register</a></li>
- {% endif %}
- </ul>
- </nav>
-
- {% block header %}{% endblock %}
- {% for msg in get_flashed_messages() %}
- <div class="flash">{{ msg }}</div>
- {% endfor %}
- {%block content %}{% endblock %}
+ <main>
+ <nav>
+ {% if g.user %}
+ <div class="logged-in-user">{{ g.user }}</div>
+ <a class="link-button logout" href="{{ url_for('auth.logout') }}">logout</a>
+ {% else %}
+ <a class="link-button login" href="{{ url_for('auth.login') }}">login</a>
+ <a class="link-button register" href="{{ url_for('auth.register') }}">register</a>
+ {% endif %}
+ </nav>
+ {% for msg in get_flashed_messages() %}
+ <div class="flashmsg">{{ msg }}</div>
+ {% endfor %}
+
+ <div class="header">
+ {% block header %}{% endblock %}
+ </div>
+
+ {%block content %}{% endblock %}
+ </main>
</body>
</html>
diff --git a/apioforum/templates/view_thread.html b/apioforum/templates/view_thread.html
index 718df4e..615aee0 100644
--- a/apioforum/templates/view_thread.html
+++ b/apioforum/templates/view_thread.html
@@ -1,25 +1,26 @@
{% extends 'base.html' %}
{% block header %}
-<h1>{%block title %}thread{% endblock %}</h1>
+<h1>{%block title %}{{thread.title}}{% endblock %}</h1>
{% endblock %}
{%block content%}
-<h2>{{thread.title}}</h2>
-<p>by {{thread.creator}}</p>
-<dl>
-{% for post in posts %}
-<dt>{{post.author}} {{post.created}}</dt>
-<dd>{{rendered_posts[loop.index0] | safe}}<dd>
-{% else %}
-<dt>there weren't</dt>
-<dd>any posts</dd>
-{% endfor %}
-</dl>
+<div class="posts">
+ {% for post in posts %}
+ <div class="post">
+ <div class="heading">
+ <div class="username">{{post.author}}</div>
+ <div><span class="timestamp">{{post.created}}</span></div>
+ </div>
+ <div class="md">
+ {{rendered_posts[loop.index0] | safe}}
+ </div>
+ </div>
+ {% endfor %}
+</div>
{% 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 class="new-post" action="{{url_for('thread.create_post',thread_id=thread_id)}}" method="POST">
+ <textarea placeholder="your post here..." name="content"></textarea>
+ <input class="submit-post" type="submit" value="yes">
</form>
{% else %}
<p>not logged in</p>