diff options
| author | Karan Jayachandra <karan.jayachandra@nxp.com> | 2024-10-16 23:36:56 +0200 |
|---|---|---|
| committer | Karan Jayachandra <karan.jayachandra@nxp.com> | 2024-10-16 23:36:56 +0200 |
| commit | 310c54caffb137af593e710b2437c2639863574d (patch) | |
| tree | 6d678db08c6d6df65e0e7c7cbe91b5531e6bf6ab /app.py | |
| parent | 156056e9c31468564fb53ca284996a5de41471fb (diff) | |
Added a few more j2 macros
Diffstat (limited to 'app.py')
| -rw-r--r-- | app.py | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -23,12 +23,14 @@ def home(): @app.route("/time", methods=["GET"]) def get_time(): mins, secs = rg.timer.get() - return render_template("time.j2", mins=mins, secs=secs) + t = re.from_string('{% from "macros.j2" import timer %}{{timer(mins, secs)}}') + return render_template(t, mins=mins, secs=secs) @app.route("/guests", methods=["GET"]) def get_guests(): - return render_template("guests.j2", guests=rg.players.guests) + t = re.from_string('{% from "macros.j2" import guests %}{{guests(count)}}') + return render_template(t, count=rg.players.guests) @app.route("/decrement", methods=["POST"]) |
