Первая версия, написанная гопотой. Не работает нормально лента и поиск, сломана авторизация

This commit is contained in:
2025-10-23 11:03:01 +03:00
parent d6ba7c0f50
commit ee255f651c
12 changed files with 632 additions and 0 deletions

32
app/templates/index.html Normal file
View File

@@ -0,0 +1,32 @@
{% extends "base.html" %}
{% block title %}Лента — Text-Booru{% endblock %}
{% block content %}
{% if current_tag %}
<h2>Тег: #{{ current_tag }}</h2>
{% else %}
<h2>Последние посты</h2>
{% endif %}
{% for p in posts %}
<article class="card">
<h3><a href="{{ url_for('view_post', pid=p.id) }}">{{ p.title or ("#" ~ p.id) }}</a></h3>
<div class="excerpt">{{ markdown(p.body[:400])|safe }}</div>
<div class="meta">#{{ p.id }} • {{ p.created_at }} •
{% for t in get_tags(p.id) %}<a href="{{ url_for('tag_page', name=t) }}">#{{ t }}</a> {% endfor %}
</div>
</article>
{% endfor %}
<div class="pagination">
{% if page and pages %}
{% if page > 1 %}
<a href="{{ url_for('index') }}?page={{ page-1 }}">« Prev</a>
{% endif %}
<span>Page {{ page }} / {{ pages }}</span>
{% if page < pages %}
<a href="{{ url_for('index') }}?page={{ page+1 }}">Next »</a>
{% endif %}
{% endif %}
</div>
{% endblock %}