Abstract table data input element
authorKarl O. Pinc <kop@karlpinc.com>
Sat, 3 Aug 2024 19:35:53 +0000 (14:35 -0500)
committerKarl O. Pinc <kop@karlpinc.com>
Sat, 3 Aug 2024 19:35:53 +0000 (14:35 -0500)
src/pgwui_common/templates/auth_base.mak
src/pgwui_common/templates/db_base.mak
src/pgwui_common/templates/lib.mak

index 6c11cd86494e2a0476938bffd32d4aaf8ac9fc1b..c017d3141ad296d0059c31b59e103bab7385ac1c 100644 (file)
 <%def name="user_row(tab_index, havecreds, user)">
       <tr>
         <%self.lib:td_label>Username</%self.lib:td_label>
-        <td>
           % if havecreds:
-            <span id="user_id">${user}</span>
+            <td><span id="user_id">${user}</span></td>
           % else:
-            <input name="user"
-                   tabindex="${tab_index.val}"
-                   id="user_id"
-                   type="text"
-                   size="30"
-                   value=""
-                   />
+            <%self.lib:td_input tab_index="${tab_index}">
+              <input name="user"
+                     tabindex="${tab_index.val}"
+                     id="user_id"
+                     type="text"
+                     size="30"
+                     value=""
+                     />
+            </%self.lib:td_input>
           % endif
-          <% tab_index.inc() %>
-        </td>
       </tr>
 </%def>
 
       % if not havecreds:
         <tr>
           <%self.lib:td_label>Password</%self.lib:td_label>
-          <td>
+          <%self.lib:td_input tab_index="${tab_index}">
             <input name="password"
                    tabindex="${tab_index.val}"
                    id="password_id"
                    type="password"
                    size="30"
                    />
-          </td>
+          </%self.lib:td_input>
         </tr>
-        <% tab_index.inc() %>
       % endif
 </%def>
 
index b4f258bea86f01849c4db131f09dd50c85f6e9c4..5bd818deb67109d308d56e278afcb7e0627766b9 100644 (file)
@@ -67,7 +67,7 @@
 <%def name="database_row(tab_index)">
   <tr>
     <%self.lib:td_label>Database</%self.lib:td_label>
-    <td>
+    <%self.lib:td_input tab_index="${tab_index}">
       <input name="db"
              tabindex="${tab_index.val}"
              id="db_id"
@@ -75,9 +75,8 @@
              size="30"
              value="${db}"
              />
-    </td>
+    </%self.lib:td_input>
   </tr>
-  <% tab_index.inc() %>
 </%def>
 
 <%def name="table_rows(tab_index)">
index 2824d577674c33403abaaa3cdd87b7f97a4b39a3..81da801e9069e050c9f42812979bd25ec3c7632a 100644 (file)
@@ -43,3 +43,8 @@
           <label for="user_id">${capture(caller.body) | trim}:</label>
         </td>
 </%def>
+
+<%def name="td_input(tab_index)">
+        <td>${caller.body()}</td>
+        <% tab_index.inc() %>
+</%def>