diff --git a/kanken_online/search.py b/kanken_online/search.py index 8d84120..40bcf31 100644 --- a/kanken_online/search.py +++ b/kanken_online/search.py @@ -1,7 +1,16 @@ -from flask import Blueprint, render_template +from flask import Blueprint, render_template, request blueprint = Blueprint("search", __name__, url_prefix="/search") +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"]) + @blueprint.route("/") def search_page(): + if request.args: + return search_results(request.args) return render_template("search/search.html") diff --git a/kanken_online/templates/search/search.html b/kanken_online/templates/search/search.html index 8bc3e69..c0aae21 100644 --- a/kanken_online/templates/search/search.html +++ b/kanken_online/templates/search/search.html @@ -5,5 +5,14 @@ {% endblock %} {% block content %} - +
+ + + + + + +
+ {% block results %} + {% endblock %} {% endblock %} \ No newline at end of file diff --git a/kanken_online/templates/search/search_results.html b/kanken_online/templates/search/search_results.html new file mode 100644 index 0000000..85132f1 --- /dev/null +++ b/kanken_online/templates/search/search_results.html @@ -0,0 +1,11 @@ +{% extends 'search/search.html' %} + +{% block results %} + +{% for result in results %} +
+ {{result.render()}} +
+{% endfor %} + +{% endblock%} \ No newline at end of file