From 2785ebc074243b98ed7b97cc40ee0d3752309007 Mon Sep 17 00:00:00 2001 From: freedisch Date: Thu, 18 Apr 2024 15:08:40 +0200 Subject: [PATCH] feat: add navigation link between logs and minutes Signed-off-by: freedisch --- mote/main.py | 9 ++++++--- mote/templates/statfile.html.j2 | 11 +++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/mote/main.py b/mote/main.py index cce321ac..1fb930d1 100644 --- a/mote/main.py +++ b/mote/main.py @@ -97,12 +97,14 @@ def getevents(): @main.get("///.log.html") def getlogs(channame, cldrdate, meetname): - return statfile(channame, cldrdate, meetname, typecont="Logs") + url_type = url_for("getminutes", channame=channame, cldrdate=cldrdate, meetname=meetname) + return statfile(channame, cldrdate, meetname, typecont="Logs", url_type=url_type) @main.get("///.html") def getminutes(channame, cldrdate, meetname): - return statfile(channame, cldrdate, meetname, typecont="Minutes") + url_type = url_for("getlogs", channame=channame, cldrdate=cldrdate, meetname=meetname) + return statfile(channame, cldrdate, meetname, typecont="Minutes", url_type=url_type) @main.get("///.txt") @@ -110,7 +112,7 @@ def getraw(channame, cldrdate, meetname): return statfile(channame, cldrdate, meetname, typecont="Raw") -def statfile(channame, cldrdate, meetname, typecont): +def statfile(channame, cldrdate, meetname, typecont, url_type): if typecont == "Raw": # if txt log, redirect to meetbot-raw encoded_uri = urllib.parse.quote(request.path) @@ -133,6 +135,7 @@ def statfile(channame, cldrdate, meetname, typecont): timetext=meeting_title.group(3), typecont=typecont, meetcont=meetcont[1], + url_type=url_type ) diff --git a/mote/templates/statfile.html.j2 b/mote/templates/statfile.html.j2 index 06e2081d..7ac3d1fb 100644 --- a/mote/templates/statfile.html.j2 +++ b/mote/templates/statfile.html.j2 @@ -25,6 +25,17 @@   {{ channame }} + {% if typecont == "Minutes" %} +
  • +   + Logs +
  • + {% elif typecont == "Logs"%} +
  • +   + Minutes +
  • + {% endif %}