From b5ed7151350fbbf31ce4dec52b8de20817d7c0bf Mon Sep 17 00:00:00 2001 From: "Karl O. Pinc" Date: Sat, 3 Aug 2024 15:43:25 -0500 Subject: [PATCH] Add label id targets back to input labels As it turns out, you can't use "for" as an argument/tag element attribute with mako. At least not when inheriting the namespace into templates at arbitrary depth. --- src/pgwui_common/templates/auth_base.mak | 4 ++-- src/pgwui_common/templates/db_base.mak | 2 +- src/pgwui_common/templates/lib.mak | 9 +++++++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/pgwui_common/templates/auth_base.mak b/src/pgwui_common/templates/auth_base.mak index c017d31..eb92dbc 100644 --- a/src/pgwui_common/templates/auth_base.mak +++ b/src/pgwui_common/templates/auth_base.mak @@ -97,7 +97,7 @@ <%def name="user_row(tab_index, havecreds, user)"> - <%self.lib:td_label>Username + <%self.lib:td_label for_id="user_id">Username % if havecreds: ${user} % else: @@ -117,7 +117,7 @@ <%def name="password_row(tab_index, havecreds)"> % if not havecreds: - <%self.lib:td_label>Password + <%self.lib:td_label for_id="password_id">Password <%self.lib:td_input tab_index="${tab_index}"> - <%self.lib:td_label>Database + <%self.lib:td_label for_id="db_id">Database <%self.lib:td_input tab_index="${tab_index}"> +<%def name="td_label(for_id=None)"> - + <% + for_attr = '' + if for_id is not None: + for_attr = f'for="{for_id}"' + %> + -- 2.34.1