From: Christian Heller Date: Tue, 28 Jan 2025 12:51:34 +0000 (+0100) Subject: Rename /booking/{id} to /bookings/{id}. X-Git-Url: https://plomlompom.com/repos/%7B%7Bdb.prefix%7D%7D/%7B%7B%20web_path%20%7D%7D/%7B%7Bprefix%7D%7D/static/bar%20baz.html?a=commitdiff_plain;h=c9ce17cf9f3654ceac5bdbc8b6c7a6c32f412bad;p=plomledger Rename /booking/{id} to /bookings/{id}. --- diff --git a/ledger.py b/ledger.py index a4a94bd..d7ebad6 100755 --- a/ledger.py +++ b/ledger.py @@ -299,7 +299,7 @@ class Handler(PlomHttpHandler): def do_GET(self) -> None: # pylint: disable=invalid-name,missing-function-docstring ctx = {'tainted': self.server.tainted, 'path': self.path} - if self.pagename == 'booking' or self.pagename.startswith('edit_'): + if self.pagename == 'bookings' or self.pagename.startswith('edit_'): id_ = int(self.path_toks[2]) if self.pagename.startswith('edit_'): ctx['id'] = id_ @@ -310,7 +310,7 @@ class Handler(PlomHttpHandler): ctx | {'roots': balance_roots, 'valid': valid, 'booking': self.server.bookings[id_]}) - elif self.pagename == 'booking': + elif self.pagename == 'bookings': self.redirect( Path('/').joinpath('edit_structured').joinpath(str(id_))) elif self.pagename == 'edit_structured': diff --git a/templates/_macros.tmpl b/templates/_macros.tmpl index acf74d9..bf9bff5 100644 --- a/templates/_macros.tmpl +++ b/templates/_macros.tmpl @@ -22,14 +22,14 @@ td.invalid, tr.warning td.invalid { background-color: #ff0000; } {% if raw %} {% if dat_line.is_intro %} - {{dat_line.raw_nbsp|safe}} + {{dat_line.raw_nbsp|safe}} {% else %} {{dat_line.raw_nbsp|safe}} {% endif %} {% else %} {% if dat_line.is_intro %} - {{dat_line.booking_line.date}} + {{dat_line.booking_line.date}} {{dat_line.booking_line.target}} {% elif not dat_line.error %} {{dat_line.booking_line.amount_short}} @@ -77,8 +77,8 @@ function taint() { switch to {{target}} balance after -prev -next +prev +next
{% endmacro %} diff --git a/templates/balance.tmpl b/templates/balance.tmpl index 15ebf83..a8a3b7f 100644 --- a/templates/balance.tmpl +++ b/templates/balance.tmpl @@ -62,7 +62,7 @@ span.indent { letter-spacing: 3em; } {% endblock css %} {% block content %} -

balance after booking {{booking.id_}} ({{booking.intro_line.date}}: {{booking.intro_line.target}})

+

balance after booking {{booking.id_}} ({{booking.intro_line.date}}: {{booking.intro_line.target}})

{% for root in roots %} {{ account_with_children(root, indent=0) }}