From: Karl O. Pinc Date: Tue, 8 Oct 2024 17:17:37 +0000 (-0500) Subject: Abstract out the making of label tags from td tags X-Git-Url: https://papio.biology.duke.edu/gitweb/?a=commitdiff_plain;h=28d82b533bce9ebac0a0f85a90f9654361849ceb;p=pgwui_common Abstract out the making of label tags from td tags --- 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='')">