From 469bf8dfd7dcd0ce580e95bae3dbb5fefcf9f865 Mon Sep 17 00:00:00 2001 From: Kiril Kovachev Date: Mon, 14 Oct 2024 12:13:26 +0100 Subject: [PATCH] Add search view --- kanken_online/__init__.py | 4 ++++ kanken_online/lang.py | 11 ++++++++--- kanken_online/templates/search.html | 9 +++++++++ 3 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 kanken_online/templates/search.html diff --git a/kanken_online/__init__.py b/kanken_online/__init__.py index 6f88ce8..93dcab7 100644 --- a/kanken_online/__init__.py +++ b/kanken_online/__init__.py @@ -62,6 +62,10 @@ def create_app(test_config=None): def kotoba_page(kotoba: str): return render_template("kotoba.html", kotoba=kotoba) + @app.route("/search") + def search_page(): + return render_template("search.html") + from . import database database.initialize_app(app) diff --git a/kanken_online/lang.py b/kanken_online/lang.py index f92d484..d09b922 100644 --- a/kanken_online/lang.py +++ b/kanken_online/lang.py @@ -6,7 +6,9 @@ EXISTING_STRINGS = { "log_out", "main_page", "username", - "password" + "password", + "search", + "search_placeholder" } ENGLISH = { @@ -20,7 +22,8 @@ ENGLISH = { "main_page": "Main Page", "username": "Username", "password": "Password", - "search": "Search" + "search": "Search", + "search_placeholder": "Enter kanji or word" } JAPANESE = { @@ -33,7 +36,9 @@ JAPANESE = { "forum": "掲示板", "main_page": "ホームページ", "username": "ユーザー名", - "password": "パスワード" + "password": "パスワード", + "search": "検索", + "search_placeholder": "漢字・言葉を入力" } LANGUAGES = [ diff --git a/kanken_online/templates/search.html b/kanken_online/templates/search.html new file mode 100644 index 0000000..8bc3e69 --- /dev/null +++ b/kanken_online/templates/search.html @@ -0,0 +1,9 @@ +{% extends 'base.html' %} + +{% block header %} +

{% block title %}{{ localize("search") }}{% endblock %}

+{% endblock %} + +{% block content %} + +{% endblock %} \ No newline at end of file