The "label" element should not be used without the "for" attribute
authorKarl O. Pinc <kop@karlpinc.com>
Thu, 26 Sep 2024 20:13:04 +0000 (15:13 -0500)
committerKarl O. Pinc <kop@karlpinc.com>
Thu, 26 Sep 2024 20:13:04 +0000 (15:13 -0500)
src/pgwui_common/templates/lib.mak

index 8f337711029751f8bb848bb97b873d28fd6e3ff6..ba20aaaa3f0e9c8d59f4a72da54e66ab17d9803a 100644 (file)
 ## Table data
 
 <%def name="td_label(for_id=None)">
-        <td class="label">
-          <%
-            for_attr = ''
-            if for_id is not None:
-              for_attr = f'for="{for_id}"'
-          %>
-          <label ${for_attr | n}>${capture(caller.body) | n,trim}:</label>
-        </td>
+        <td class="label"
+          % if for_id is not None:
+              ><label ${f'for="{for_id}"' | n}>${capture(caller.body)
+                                                | n,trim}:</label></td>
+          % else:
+              >${capture(caller.body) | n, trim}:</td>
+          % endif
 </%def>
 
 <%def name="td_input(tab_index, tab_inc=1, colspan=1, clas='')">