Files
runnerspace/templates/pages/post.html
Xevion 2e8688f59b Revamp all form submissions with Flask-WTF forms
- Rename blueprint route 'main.user' to 'main.view_user' for clarity
- Rename 'forms.py' to 'route_forms.py'
2022-03-29 02:00:43 -05:00

39 lines
1.6 KiB
HTML

{% extends 'layouts/index.html' %}
{% block content %}
<div class="post-box">
{{ post.text }}
<br>
<div class="post-author">
<em>Posted by <a href="{{ url_for('main.view_user', username=author.username) }}">{{ author.name }}</a></em> <span
title="{{ post.date_posted }}">{{ post.get_time_ago() }} ago</span>.
</div>
<div class="post-comments">
{% if current_user.is_authenticated %}
{% with messages = get_flashed_messages() %}
{% if messages %}
<span class="error-message">
{{ messages[0] }}
</span>
{% endif %}
{% endwith %}
<div class="post-comment add-comment">
<form method="POST" action="{{ url_for('forms.add_comment', post_id=post.id) }}">
<label>
<input type="text" name="comment-text">
</label>
<button>Add Comment</button>
</form>
</div>
{% endif %}
{% for comment, author in comments_and_authors %}
<div class="post-comment">
<span class="comment-text">"{{ comment.text }}"</span><a class="comment-author"
href="{{ url_for('main.view_user', username=author.username) }}">{{ author.name }}</a>
</div>
{% endfor %}
</div>
</div>
{% endblock %}