Add user page stub
This commit is contained in:
parent
826d240489
commit
9eeb8bd873
@ -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,
|
||||
|
9
kanken_online/templates/user_page.html
Normal file
9
kanken_online/templates/user_page.html
Normal 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 %}
|
Loading…
Reference in New Issue
Block a user