From 28d82b533bce9ebac0a0f85a90f9654361849ceb Mon Sep 17 00:00:00 2001 From: "Karl O. Pinc" Date: Tue, 8 Oct 2024 12:17:37 -0500 Subject: [PATCH] Abstract out the making of label tags from td tags --- src/pgwui_common/templates/lib.mak | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/pgwui_common/templates/lib.mak b/src/pgwui_common/templates/lib.mak index 266b16a..40a7526 100644 --- a/src/pgwui_common/templates/lib.mak +++ b/src/pgwui_common/templates/lib.mak @@ -36,17 +36,23 @@ % endif +## labels + +<%def name="label(for_id='', id='')"> + % if for_id == '': + ${capture(caller.body) | n,trim}: + % else: + + % endif + + ## Table data -<%def name="td_label(for_id=None, id=None)"> - - % else: - >${capture(caller.body) | n, trim}: - % endif +<%def name="td_label(for_id='', id='')"> + <%self:label for_id="${for_id}" id="${id}" + >${capture(caller.body) | n,trim} <%def name="td_input(tab_index, tab_inc=1, colspan=1, clas='')"> -- 2.34.1