comment field fix

This commit is contained in:
aneuhmanh 2025-02-20 19:32:59 +02:00
parent bce05da487
commit dc3925eb73

View File

@ -28,7 +28,6 @@
<div class="video-details"> <div class="video-details">
<video controls> <video controls>
<source src="{{ url_for('static', filename='videos/' + content.video_file) }}" type="video/mp4"> <source src="{{ url_for('static', filename='videos/' + content.video_file) }}" type="video/mp4">
Ваш браузер не поддерживает элемент video.
</video> </video>
<p><strong>Author:</strong> <a href="{{ url_for('profile', username=content.username) }}">{{ content.username }}</a></p> <p><strong>Author:</strong> <a href="{{ url_for('profile', username=content.username) }}">{{ content.username }}</a></p>
<p><strong>Publication Date:</strong> {{ content.publication_date }}</p> <p><strong>Publication Date:</strong> {{ content.publication_date }}</p>
@ -141,31 +140,5 @@
<p>You need to <a href="{{ url_for('login') }}">log in</a> to vote.</p> <p>You need to <a href="{{ url_for('login') }}">log in</a> to vote.</p>
{% endif %} {% endif %}
</div> </div>
<div class="comments-section">
<h3>Comments</h3>
{% if comments %}
<ul class="comments-list">
{% for comment in comments %}
<li>
<img src="{{ url_for('static', filename='avatars/' + (avatars.get(comment.username) or 'default_avatar.png')) }}" alt="Avatar"
class="comment-avatar">
<strong>{{ comment.username }}</strong>: {{ comment.comment_text }}
</li>
{% endfor %}
</ul>
{% else %}
<p>No comments yet. Be the first to comment!</p>
{% endif %}
{% if current_user.is_authenticated %}
<form method="POST" class="comment-form">
<textarea name="comment" placeholder="Write your comment..." maxlength="44" required
class="input-textarea"></textarea>
<button type="submit" class="button">Post Comment</button>
</form>
{% else %}
<p>You need to <a href="{{ url_for('login') }}">log in</a> to comment.</p>
{% endif %}
</div>
</body> </body>
</html> </html>