From: Christian Heller Date: Sat, 16 Mar 2024 23:00:29 +0000 (+0100) Subject: Add rump Days module. X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/%7B%7B%20web_path%20%7D%7D/static/%7B%7Bdb.prefix%7D%7D/balance?a=commitdiff_plain;h=ee89735cb3714dc7c3ec8bbd0643cf279ee9a1ef;p=plomtask Add rump Days module. --- diff --git a/scripts/pre-commit b/scripts/pre-commit index a053262..e1cfb73 100755 --- a/scripts/pre-commit +++ b/scripts/pre-commit @@ -1,6 +1,6 @@ #!/bin/sh set -e -python3 -m mypy task.py -python3 -m flake8 task.py -python3 -m pylint --good-names 'do_GET,do_POST' task.py +python3 -m mypy *.py +python3 -m flake8 *.py +python3 -m pylint --good-names 'do_GET,do_POST' *.py exit 0 diff --git a/task.py b/task.py index 2a6c699..d6128ee 100755 --- a/task.py +++ b/task.py @@ -5,6 +5,7 @@ plom's task manager from http.server import BaseHTTPRequestHandler from http.server import HTTPServer from jinja2 import Environment as JinjaEnv, FileSystemLoader as JinjaFSLoader +from days import Day HTTP_PORT = 8082 TEMPLATES_DIR = 'templates' @@ -21,7 +22,10 @@ class TaskHandler(BaseHTTPRequestHandler): """Handle any GET request.""" self.send_response(200) self.end_headers() - html = self.server.jinja.get_template('index.html').render() + days = [Day('2024-01-03'), Day('2024-01-01'), Day('2024-01-02')] + days.sort() + html = self.server.jinja.get_template('calendar.html').render( + days=days) self.wfile.write(bytes(html, 'utf-8')) diff --git a/templates/calendar.html b/templates/calendar.html new file mode 100644 index 0000000..0f18203 --- /dev/null +++ b/templates/calendar.html @@ -0,0 +1,9 @@ +{% extends 'base.html' %} + +{% block content %} + +{% endblock %} diff --git a/templates/index.html b/templates/index.html deleted file mode 100644 index 72d81d4..0000000 --- a/templates/index.html +++ /dev/null @@ -1,5 +0,0 @@ -{% extends 'base.html' %} - -{% block content %} -Hi there! -{% endblock %}