Add kotoba view

This commit is contained in:
Kiril Kovachev 2024-10-14 11:28:53 +01:00
parent 21d14b086b
commit 2a4c724af5
2 changed files with 22 additions and 0 deletions

View File

@ -57,6 +57,10 @@ def create_app(test_config=None):
kanji.glyph_origin = "会意。广(げん)(いえ)と、𣏟(はい)(あさ)とから成り、屋下であさの繊維をはぎとる、ひいて「あさ」の意を表す。" kanji.glyph_origin = "会意。广(げん)(いえ)と、𣏟(はい)(あさ)とから成り、屋下であさの繊維をはぎとる、ひいて「あさ」の意を表す。"
return render_template("kanji.html", kanji=kanji) return render_template("kanji.html", kanji=kanji)
@app.route("/kotoba/<kotoba>")
def kotoba_page(kotoba: str):
return render_template("kotoba.html", kotoba=kotoba)
from . import database from . import database
database.initialize_app(app) database.initialize_app(app)

View File

@ -0,0 +1,18 @@
{% extends 'base.html' %}
{% block header %}
<h1>{% block title %}Kotoba - {{ kotoba.word }}{% endblock %}</h1>
{% endblock %}
{% block content %}
<div id="headword-and-meaning">
<div id="kotoba-box">
<div id="headword-box">
<span id="kotoba">{{ kotoba.word }}</span>
</div>
</div>
<div id="meaning-box">
<p id="meanings">{{ kotoba.meanings }}</p>
</div>
</div>
{% endblock %}