2024-10-14 11:33:37 +00:00
|
|
|
from flask import Blueprint, render_template, request
|
2024-10-14 11:15:47 +00:00
|
|
|
|
|
|
|
blueprint = Blueprint("search", __name__, url_prefix="/search")
|
|
|
|
|
2024-10-14 11:33:37 +00:00
|
|
|
def search_results(args: dict):
|
|
|
|
class renderable:
|
|
|
|
def render(self):
|
|
|
|
return "ok"
|
|
|
|
results = [renderable(), renderable()] # Do something with args
|
|
|
|
return render_template("search/search_results.html", results=results, value=args["keywords"])
|
|
|
|
|
2024-10-14 11:15:47 +00:00
|
|
|
@blueprint.route("/")
|
|
|
|
def search_page():
|
2024-10-14 11:33:37 +00:00
|
|
|
if request.args:
|
|
|
|
return search_results(request.args)
|
2024-10-14 11:17:52 +00:00
|
|
|
return render_template("search/search.html")
|