Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1"""LICENSE
2Copyright 2020 Hermann Krumrey <hermann@krumreyh.com>
4This file is part of jerrycan.
6jerrycan is free software: you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation, either version 3 of the License, or
9(at your option) any later version.
11jerrycan is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
16You should have received a copy of the GNU General Public License
17along with jerrycan. If not, see <http://www.gnu.org/licenses/>.
18LICENSE"""
20from typing import Union
21from flask import render_template, Blueprint
22from werkzeug import Response
23from jerrycan.Config import Config
26def define_blueprint(blueprint_name: str) -> Blueprint:
27 """
28 Defines the blueprint for this route
29 :param blueprint_name: The name of the blueprint
30 :return: The blueprint
31 """
32 blueprint = Blueprint(blueprint_name, __name__)
34 @blueprint.route("/", methods=["GET"])
35 def index() -> Union[Response, str]:
36 """
37 The index page
38 :return: The response
39 """
40 return render_template(
41 "static/index.html",
42 **Config.TEMPLATE_EXTRAS["index"]()
43 )
45 @blueprint.route("/about", methods=["GET"])
46 def about() -> Union[Response, str]:
47 """
48 The about page/"Impressum" for the website
49 :return: The response
50 """
51 return render_template(
52 "static/about.html",
53 **Config.TEMPLATE_EXTRAS["about"]()
54 )
56 @blueprint.route("/privacy", methods=["GET"])
57 def privacy() -> Union[Response, str]:
58 """
59 Page containing a privacy disclaimer
60 :return: The response
61 """
62 return render_template(
63 "static/privacy.html",
64 **Config.TEMPLATE_EXTRAS["privacy"]()
65 )
67 return blueprint