home · contact · privacy
For Booking view, use '/{Booking.id_}' rather than '?idx={Booking.id_}'.
authorChristian Heller <c.heller@plomlompom.de>
Mon, 20 Jan 2025 10:54:09 +0000 (11:54 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Mon, 20 Jan 2025 10:54:09 +0000 (11:54 +0100)
ledger.py
templates/index.tmpl

index 746d8a3850bd050547ebadeb9caaf4bff79dae2a..eee9c5d4e960d1d98c69dac5d9e5538ee34a5c69 100755 (executable)
--- a/ledger.py
+++ b/ledger.py
@@ -76,7 +76,7 @@ class Handler(PlomHttpHandler):
     def do_GET(self) -> None:
         # pylint: disable=invalid-name,missing-function-docstring
         if self.pagename == 'booking':
-            b = self.server.bookings[int(self.params.first('idx'))]
+            b = self.server.bookings[int(self.path_toks[2])]
             dat_lines = self.server.dat_lines[b.idx_start:b.idx_end]
             self.send_rendered(Path('index.tmpl'), {'dat_lines': dat_lines})
         elif self.pagename == 'raw':
index ca1e0965f7f37205ce9df091b24361f7fe2f5a18..bf83499d2381ea804f48e94cfb250719521f1d52 100644 (file)
@@ -22,7 +22,7 @@ td.curr { text-align: center; }
   {% if l.type == "value" %}
     <td class="amt">{{l.amt}}</td><td class="curr">{{l.curr|truncate(4,true,"…")}}</td><td>{{l.acc}}</td>
   {% elif l.type == "intro" %}
-    <td class="code" colspan=3><a href="booking?idx={{l.booking.id_}}">{{l.code}}</a></td>
+    <td class="code" colspan=3><a href="/booking/{{l.booking.id_}}">{{l.code}}</a></td>
   {% else %}
     <td colspan=3>{{l.code}}</td>
   {% endif %}