Allow td_label labels to have ids
authorKarl O. Pinc <kop@karlpinc.com>
Thu, 3 Oct 2024 16:30:09 +0000 (11:30 -0500)
committerKarl O. Pinc <kop@karlpinc.com>
Thu, 3 Oct 2024 16:30:09 +0000 (11:30 -0500)
src/pgwui_common/templates/lib.mak

index ba20aaaa3f0e9c8d59f4a72da54e66ab17d9803a..266b16a786c0bb016b0ce0fd743d3f7ece1dff5d 100644 (file)
 
 ## Table data
 
-<%def name="td_label(for_id=None)">
+<%def name="td_label(for_id=None, id=None)">
         <td class="label"
           % if for_id is not None:
-              ><label ${f'for="{for_id}"' | n}>${capture(caller.body)
+              ><label ${f'id="{id}"' if id is not None else '' | n}
+                      ${f'for="{for_id}"' | n}>${capture(caller.body)
                                                 | n,trim}:</label></td>
           % else:
               >${capture(caller.body) | n, trim}:</td>