Add search view

This commit is contained in:
Kiril Kovachev 2024-10-14 12:13:26 +01:00
parent f4f6e624ed
commit 469bf8dfd7
3 changed files with 21 additions and 3 deletions

View File

@ -62,6 +62,10 @@ def create_app(test_config=None):
def kotoba_page(kotoba: str): def kotoba_page(kotoba: str):
return render_template("kotoba.html", kotoba=kotoba) return render_template("kotoba.html", kotoba=kotoba)
@app.route("/search")
def search_page():
return render_template("search.html")
from . import database from . import database
database.initialize_app(app) database.initialize_app(app)

View File

@ -6,7 +6,9 @@ EXISTING_STRINGS = {
"log_out", "log_out",
"main_page", "main_page",
"username", "username",
"password" "password",
"search",
"search_placeholder"
} }
ENGLISH = { ENGLISH = {
@ -20,7 +22,8 @@ ENGLISH = {
"main_page": "Main Page", "main_page": "Main Page",
"username": "Username", "username": "Username",
"password": "Password", "password": "Password",
"search": "Search" "search": "Search",
"search_placeholder": "Enter kanji or word"
} }
JAPANESE = { JAPANESE = {
@ -33,7 +36,9 @@ JAPANESE = {
"forum": "掲示板", "forum": "掲示板",
"main_page": "ホームページ", "main_page": "ホームページ",
"username": "ユーザー名", "username": "ユーザー名",
"password": "パスワード" "password": "パスワード",
"search": "検索",
"search_placeholder": "漢字・言葉を入力"
} }
LANGUAGES = [ LANGUAGES = [

View File

@ -0,0 +1,9 @@
{% extends 'base.html' %}
{% block header %}
<h1>{% block title %}{{ localize("search") }}{% endblock %}</h1>
{% endblock %}
{% block content %}
<input type="text" id="search_bar" placeholder="{{ localize("search_placeholder") }}">
{% endblock %}