start the new topics route and view

This commit is contained in:
2026-04-12 23:36:50 +03:00
parent 099b5c135e
commit ce9bca0a75
11 changed files with 141 additions and 34 deletions

17
app/routes/topics.py Normal file
View File

@@ -0,0 +1,17 @@
from flask import Blueprint, redirect, url_for, render_template
from ..models import Topics
bp = Blueprint('topics', __name__, url_prefix = '/topics/')
@bp.get('/')
def all_topics():
topic_list = Topics.get_list()
return render_template('topics/topics.html', topics=topic_list)
@bp.get('/<slug>')
def topic(slug):
t = Topics.find({'slug': slug})
if t:
return 'yes'
return 'no'