From: Christian Heller Date: Thu, 6 Jun 2024 06:20:22 +0000 (+0200) Subject: Add minimalist plain-text calendar view. X-Git-Url: https://plomlompom.com/repos/%7B%7Bdb.prefix%7D%7D/%7B%7Bprefix%7D%7D/condition_descriptions?a=commitdiff_plain;h=eea64af900512aaa83146a02f6e7c6d0092b5b3a;p=plomtask Add minimalist plain-text calendar view. --- diff --git a/.pylintrc b/.pylintrc index 82e4d96..b4814d1 100644 --- a/.pylintrc +++ b/.pylintrc @@ -1,3 +1,3 @@ [BASIC] init-hook='import sys; sys.path.append(".")' -good-names-rgxs=(test_)?do_(GET|POST)(_[a-z]+)?,test_[A-Z]+ +good-names-rgxs=.*_?do_(GET|POST)(_[a-z]+)?,test_[A-Z]+ diff --git a/plomtask/http.py b/plomtask/http.py index 1a06f30..bb05fa9 100644 --- a/plomtask/http.py +++ b/plomtask/http.py @@ -110,7 +110,7 @@ class TaskHandler(BaseHTTPRequestHandler): finally: self.conn.close() - def do_GET_calendar(self) -> dict[str, object]: + def _do_GET_calendar(self) -> dict[str, object]: """Show Days from ?start= to ?end=.""" start = self.params.get_str('start') end = self.params.get_str('end') @@ -124,6 +124,14 @@ class TaskHandler(BaseHTTPRequestHandler): today = date_in_n_days(0) return {'start': start, 'end': end, 'days': days, 'today': today} + def do_GET_calendar(self) -> dict[str, object]: + """Show Days from ?start= to ?end= – normal view.""" + return self._do_GET_calendar() + + def do_GET_calendar_txt(self) -> dict[str, object]: + """Show Days from ?start= to ?end= – minimalist view.""" + return self._do_GET_calendar() + def do_GET_day(self) -> dict[str, object]: """Show single Day of ?date=.""" date = self.params.get_str('date', date_in_n_days(0)) diff --git a/templates/calendar.html b/templates/calendar.html index 42c821a..699caab 100644 --- a/templates/calendar.html +++ b/templates/calendar.html @@ -35,6 +35,8 @@ td.today { {% block content %}

calendar

+

basic view

+
from to