pelmeni-shield-vpn/site/templates/topic.html

47 lines
2 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{% extends "base.html" %}
{% block title %}{{ topic.title }}{% endblock %}
{% block content %}
<div style="font-size: 12px; margin-bottom: 10px;">
<a href="{{ url_for('forum') }}">&larr; Вернуться в список тем</a> /
<b>{{ topic.cat_title }}</b>
</div>
<h1>{{ topic.title }}</h1>
<div style="font-size: 11px; color: #666666; margin-bottom: 16px;">
Автор темы: <b>{{ topic.username }}</b> | Создано: {{ topic.created_at }} | Просмотров: {{ topic.views }}
</div>
<div class="posts-list">
{% for post in posts %}
<div class="post-box" id="post-{{ post.id }}">
<div class="post-author">
<div class="name">{{ post.username }}</div>
<div class="role">{{ post.role }}</div>
<div style="font-size: 11px; color: #777777;">Сообщений: {{ post.user_posts_count }}</div>
</div>
<div class="post-content">
<div class="post-text">{{ post.content }}</div>
<div class="post-meta">Опубликовано: {{ post.created_at }} #{{ loop.index }}</div>
</div>
</div>
{% endfor %}
</div>
<h2>ОТВЕТИТЬ В ТЕМУ</h2>
{% if current_user %}
<form action="{{ url_for('reply_topic', topic_id=topic.id) }}" method="POST">
<div class="form-group">
<label for="content">Ваше сообщение (от имени <b>{{ current_user.username }}</b>):</label>
<textarea name="content" id="content" required placeholder="Поделитесь опытом, задайте вопрос или прокомментируйте ракурс..."></textarea>
</div>
<button type="submit" class="btn btn-primary">Опубликовать ответ</button>
</form>
{% else %}
<p>
Чтобы написать ответ в эту тему, пожалуйста, <a href="{{ url_for('login', next=request.url) }}"><b>войдите</b></a>
или <a href="{{ url_for('register') }}"><b>зарегистрируйтесь</b></a>.
</p>
{% endif %}
{% endblock %}