This is an automated email from the ASF dual-hosted git repository.

sbp pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tooling-trusted-release.git


The following commit(s) were added to refs/heads/main by this push:
     new d0a5750  Use radio inputs for the KEYS file upload form
d0a5750 is described below

commit d0a5750a92a6b5ef976ddaa9d7d55abb1721fb84
Author: Sean B. Palmer <[email protected]>
AuthorDate: Sun Jul 20 10:05:13 2025 +0100

    Use radio inputs for the KEYS file upload form
---
 atr/routes/keys.py             |  8 ++++----
 atr/templates/keys-upload.html | 39 ---------------------------------------
 2 files changed, 4 insertions(+), 43 deletions(-)

diff --git a/atr/routes/keys.py b/atr/routes/keys.py
index 48073e6..ebf869e 100644
--- a/atr/routes/keys.py
+++ b/atr/routes/keys.py
@@ -525,15 +525,15 @@ async def upload(session: routes.CommitterSession) -> str:
 
     class UploadKeyForm(UploadKeyFormBase):
         selected_committees = wtforms.SelectMultipleField(
-            "Associate keys with committees",
+            "Associate keys with committee",
             choices=[(c.name, c.display_name) for c in user_committees if (not 
util.committee_is_standing(c.name))],
             coerce=str,
-            option_widget=wtforms.widgets.CheckboxInput(),
+            option_widget=wtforms.widgets.RadioInput(),
             widget=wtforms.widgets.ListWidget(prefix_label=False),
             validators=[wtforms.validators.InputRequired("You must select at 
least one committee")],
             description=(
-                "Select the committees with which to associate these keys."
-                " You must be a member of the selected committees."
+                "Select the committee with which to associate these keys."
+                " You must be a member of the selected committee."
             ),
         )
 
diff --git a/atr/templates/keys-upload.html b/atr/templates/keys-upload.html
index 431df86..d12d5d8 100644
--- a/atr/templates/keys-upload.html
+++ b/atr/templates/keys-upload.html
@@ -216,11 +216,6 @@
                 <p class="text-muted fst-italic">No committees available for 
association.</p>
               {% endfor %}
             </div>
-            <div class="mt-2 mb-2">
-              <button type="button"
-                      id="toggleCommitteesBtn"
-                      class="btn btn-sm btn-outline-secondary">Select 
all</button>
-            </div>
             {{ forms.errors(form.selected_committees, 
classes="invalid-feedback d-block") }}
             {{ forms.description(form.selected_committees, classes="form-text 
text-muted mt-2") }}
           </div>
@@ -244,38 +239,4 @@
 
 {% block javascripts %}
   {{ super() }}
-  <script>
-      document.addEventListener("DOMContentLoaded", () => {
-          const btn = document.getElementById("toggleCommitteesBtn");
-          const checkboxes = 
document.querySelectorAll("input[name='selected_committees']");
-
-          if (!btn || checkboxes.length === 0) return;
-
-          function updateButtonText() {
-              let allChecked = true;
-              checkboxes.forEach(cb => {
-                  if (!cb.checked) allChecked = false;
-              });
-              btn.textContent = allChecked ? "Select none" : "Select all";
-          }
-
-          btn.addEventListener("click", () => {
-              let allChecked = true;
-              checkboxes.forEach(cb => {
-                  if (!cb.checked) allChecked = false;
-              });
-              const shouldCheck = !allChecked;
-              checkboxes.forEach(cb => {
-                  cb.checked = shouldCheck;
-              });
-              updateButtonText();
-          });
-
-          checkboxes.forEach(cb => {
-              cb.addEventListener("change", updateButtonText);
-          });
-
-          updateButtonText();
-      });
-  </script>
 {% endblock javascripts %}


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to