Add user page stub

This commit is contained in:
Kiril Kovachev 2024-10-18 16:36:03 +01:00
parent 826d240489
commit 9eeb8bd873
2 changed files with 20 additions and 0 deletions

View File

@ -67,6 +67,17 @@ def create_app(test_config=None):
else:
return update_settings(request.form)
@app.get("/user/<int:user_id>")
def user_page(user_id: int):
db = get_database()
(username,) = db.execute("SELECT username FROM user WHERE id = ?", (user_id,)).fetchone()
return render_template("user_page.html", username=username)
@app.get("/me")
@login_required
def my_page():
return user_page(session["user_id"])
def format_reading(reading: str) -> str:
"""Apply bold to the part of the reading which the kanji represents; for kun, this can be
e.g. : えら- --> <b>えら</b>. For reading strings which don't have any "-" character in them,

View File

@ -0,0 +1,9 @@
{% extends 'base.html' %}
{% block header %}
<h1>{% block title %}{{ localize("user_introduction") }} {{ username }}{% endblock %}</h1>
{% endblock %}
{% block content %}
(profile picture)
{% endblock %}