1
0
Fork 1

show replies on board, fix reg flow

main
Toaster 5 months ago
parent bb756f6664
commit bef8b4d06f

@ -35,6 +35,7 @@ def get_feed(uname):
post["ownerblog"] = (config["owner"] == post["author"])
post["board"] = i
post["credate"] = int(post["credate"])
post["hasreplies"] = ("replies" in post)
allposts.append(post)
# Excuse me op but what the fuck is this
allposts = sorted(allposts, key=lambda x: x["credate"], reverse=True)

@ -19,6 +19,8 @@ def login():
else:
error = 'Invalid username/password'
if "success" in request.args:
error = "Successfully registered your account!"
return render_template('login.html', error=error)
@app.route('/logout')
@ -34,7 +36,7 @@ def register():
if request.method == 'POST':
if (not uexist(request.form['username'])) and len(request.form['password']) >= 8 and request.form['username'].strip() != "":
newuser(request.form['username'], request.form['password'])
return redirect('/', 303)
return redirect('/login?success', 303)
elif len(request.form['password']) < 8:
error = "Password must be at least 8 characters."
else:

@ -162,3 +162,6 @@ div.action_panel table td { padding: 0px; }
.notsoobviouslink { text-decoration: none; color: inherit; }
.notsoobviouslink:hover * { color: #efefef; }
.userpage_col tr td { vertical-align: middle; }
.error.success {
background: green; border: 1px solid lime;
}

@ -49,6 +49,25 @@
<td>
<h3><a href="/u/{{ post['author'] }}" class="username {% if post['ownerblog'] %}owner{% endif %}">{{ post['author'] }}</a> says...</h3>
<a href="/b/{{bname}}/{{post['id']}}" class="notsoobviouslink"><p>{{ post['content'] | safe }}</p></a>
{% if "replies" in post %}
<details>
<summary>View replies</summary>
{% for reply in post['replies'] %}
<table width="100%">
<tr class="post">
<td align="right" width="56px" style="min-width: 56px">
<img src="/avatar/{{reply['author']}}" width="48px" alt="reply['author']" />
</td>
<td>
<h3><a class="username" href="/u/{{reply['author']}}">{{reply['author']}}</a></h3>
{{reply['content']|safe}}
</td>
</tr>
</table>
{% endfor %}
</details>
{% endif %}
</a>
</td>
<td width="24px">
{% if post['author'] == name or ismod -%}

@ -46,7 +46,25 @@
</a>
&raquo;
<a class="mods" href="/b/{{post['board']}}">{{post['board']}}</a></h3>
<a class="notsoobviouslink" href="/b/{{post['board']}}/{{post['id']}}"><p>{{post['content']|safe}}</p></a>
<a class="notsoobviouslink" href="/b/{{post['board']}}/{{post['id']}}"><p>{{post['content']|safe}}</p>
{% if 'replies' in post %}
<details>
<summary>View replies</summary>
{% for reply in post['replies'] %}
<table width="100%">
<tr class="post">
<td align="right" width="56px" style="min-width: 56px">
<img src="/avatar/{{reply['author']}}" width="48px" alt="reply['author']" />
</td>
<td>
<h3><a class="username" href="/u/{{reply['author']}}">{{reply['author']}}</a></h3>
{{reply['content']|safe}}
</td>
</tr>
</table>
{% endfor %}
</details>
{% endif %}</a>
</td>
</tr>
{% endfor %}

@ -10,7 +10,7 @@
<h3>Welcome back!</h3>
<hr/>
{% if error %}
<div class="error">
<div class="error{% if 'Success' in error %} success{%endif%}">
{{ error }}
</div>
{% endif %}

Loading…
Cancel
Save