Make consistent use of TabIndex
authorKarl O. Pinc <kop@karlpinc.com>
Tue, 30 Jul 2024 17:27:53 +0000 (12:27 -0500)
committerKarl O. Pinc <kop@karlpinc.com>
Tue, 30 Jul 2024 17:37:53 +0000 (12:37 -0500)
src/pgwui_common/templates/auth_base.mak
src/pgwui_common/templates/auth_parts.mak

index 1856ce85940c0c21ed16efd22545a73bbd444c3b..daf1fa777628eab4ddce0192c3a0b984bf36a1e6 100644 (file)
       <%
       tab_index = TabIndex()
       database_row(tab_index)
-      self.auth_parts.user_row(tab_index.val + 1, havecreds, user)
-      self.auth_parts.password_row(tab_index.val + 2, havecreds)
-      tab_index.inc(2)
+      self.auth_parts.user_row(tab_index, havecreds, user)
+      self.auth_parts.password_row(tab_index, havecreds)
 
       caller.body(tab_index)
 
index 00dc4b13bd524c0748aa728f7915617f1d014c22..ca20d4e7d934ccb9a88304c0a0de496f6733ebdd 100644 (file)
@@ -48,7 +48,7 @@
     % endif
 </%def>
 
-<%def name="user_row(tabindex, havecreds, user)">
+<%def name="user_row(tab_index, havecreds, user)">
       <tr>
         <td class="label">
           <label for="user_id">Username:</label>
             <span id="user_id">${user}</span>
           % else:
             <input name="user"
-                   tabindex="${tabindex}"
+                   tabindex="${tab_index.val}"
                    id="user_id"
                    type="text"
                    size="30"
                    value=""
                    />
           % endif
+          <% tab_index.inc() %>
         </td>
       </tr>
 </%def>
 
-<%def name="password_row(tabindex, havecreds)">
+<%def name="password_row(tab_index, havecreds)">
       % if not havecreds:
         <tr>
           <td class="label">
           </td>
           <td>
             <input name="password"
-                   tabindex="${tabindex}"
+                   tabindex="${tab_index.val}"
                    id="password_id"
                    type="password"
                    size="30"
                    />
           </td>
         </tr>
+        <% tab_index.inc() %>
       % endif
 </%def>