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-releases.git
The following commit(s) were added to refs/heads/main by this push:
new 0a68552 Move event handlers from attributes to existing script files
0a68552 is described below
commit 0a6855285803c8c58d19acd1ce5aaea1ef0be937
Author: Sean B. Palmer <[email protected]>
AuthorDate: Wed Dec 10 16:00:13 2025 +0000
Move event handlers from attributes to existing script files
---
atr/static/js/committee-directory.js | 7 +++++++
atr/static/js/ongoing-tasks-poll.js | 7 +++++++
atr/static/js/report-results.js | 17 +++++++++++++++++
atr/templates/check-selected-path-table.html | 5 ++---
atr/templates/committee-directory.html | 6 ++----
atr/templates/includes/topnav.html | 6 ++----
atr/templates/report-selected-path.html | 12 +++++++-----
7 files changed, 44 insertions(+), 16 deletions(-)
diff --git a/atr/static/js/committee-directory.js
b/atr/static/js/committee-directory.js
index 9818a10..3e02fbf 100644
--- a/atr/static/js/committee-directory.js
+++ b/atr/static/js/committee-directory.js
@@ -75,6 +75,13 @@ if (participantButton) {
}
document.addEventListener("DOMContentLoaded", function() {
+ // Hide images that fail to load
+ document.querySelectorAll(".page-logo").forEach(function(img) {
+ img.addEventListener("error", function() {
+ this.style.display = "none";
+ });
+ });
+
allCommitteeCards =
Array.from(document.querySelectorAll(".page-project-card"));
const cards = allCommitteeCards;
const committeeCountSpan = document.getElementById("committee-count");
diff --git a/atr/static/js/ongoing-tasks-poll.js
b/atr/static/js/ongoing-tasks-poll.js
index 348305f..33c08dc 100644
--- a/atr/static/js/ongoing-tasks-poll.js
+++ b/atr/static/js/ongoing-tasks-poll.js
@@ -1,4 +1,11 @@
(function() {
+ // Handle More and Less toggle buttons for collapse sections
+
document.querySelectorAll(".page-collapse-toggle").forEach(function(button) {
+ button.addEventListener("click", function() {
+ this.textContent = this.textContent.trim() === "More" ? "Less" :
"More";
+ });
+ });
+
const banner = document.getElementById("ongoing-tasks-banner");
if (!banner) return;
diff --git a/atr/static/js/report-results.js b/atr/static/js/report-results.js
index 5b39f2f..34dc44e 100644
--- a/atr/static/js/report-results.js
+++ b/atr/static/js/report-results.js
@@ -62,6 +62,22 @@ function updateMemberStriping() {
restripeVisibleRows(".atr-result-member", "page-member-visible-odd");
}
+// Toggle status visibility buttons
+document.querySelectorAll(".page-toggle-status").forEach(function(btn) {
+ btn.addEventListener("click", function() {
+ const type = this.dataset.type;
+ const status = this.dataset.status;
+ toggleStatusVisibility(type, status);
+ });
+});
+
+// Toggle all details button
+const toggleAllBtn = document.getElementById("btn-toggle-all-details");
+if (toggleAllBtn) {
+ toggleAllBtn.addEventListener("click", toggleAllDetails);
+}
+
+// Member path filter
const mpfInput = document.getElementById("member-path-filter");
if (mpfInput) {
mpfInput.addEventListener("input", function() {
@@ -79,5 +95,6 @@ if (mpfInput) {
updateMemberStriping();
});
}
+
updatePrimaryStriping();
updateMemberStriping();
diff --git a/atr/templates/check-selected-path-table.html
b/atr/templates/check-selected-path-table.html
index afa82f2..1c8a81d 100644
--- a/atr/templates/check-selected-path-table.html
+++ b/atr/templates/check-selected-path-table.html
@@ -84,14 +84,13 @@
{% endif %}
{% if phase == "release_candidate_draft" %}
- <button class="btn btn-sm btn-outline-secondary"
+ <button class="btn btn-sm btn-outline-secondary
page-collapse-toggle"
type="button"
data-bs-toggle="collapse"
data-bs-target="#actions-{{ row_id }}"
aria-expanded="false"
aria-controls="actions-{{ row_id }}"
- title="Show more actions for {{ path }}"
- onclick="this.innerHTML = (this.innerHTML.trim() ===
'More') ? 'Less' : 'More';">More</button>
+ title="Show more actions for {{ path }}">More</button>
{% elif phase == "release_candidate" %}
<a href="{{ as_url(get.download.path,
project_name=release.project.name, version_name=release.version,
file_path=path) }}"
title="Download file {{ path }}"
diff --git a/atr/templates/committee-directory.html
b/atr/templates/committee-directory.html
index 6d92852..eb9442c 100644
--- a/atr/templates/committee-directory.html
+++ b/atr/templates/committee-directory.html
@@ -102,13 +102,11 @@
{% if (committee.name == "incubator") or
committee.name.startswith("incubator-") %}
<img
src="https://www.apache.org/logos/res/incubator/default.png"
alt=""
- class="page-logo"
- onerror="this.style.display='none';"
/>
+ class="page-logo" />
{% else %}
<img
src="https://www.apache.org/logos/res/{{ committee.name }}/default.png"
alt=""
- class="page-logo"
- onerror="this.style.display='none';"
/>
+ class="page-logo" />
{% endif %}
</div>
</div>
diff --git a/atr/templates/includes/topnav.html
b/atr/templates/includes/topnav.html
index 001c787..4524bbc 100644
--- a/atr/templates/includes/topnav.html
+++ b/atr/templates/includes/topnav.html
@@ -303,12 +303,10 @@
<span>{{ current_user.fullname }}</span>
(<code>{{ current_user.uid }}</code>)
<br />
- <a href="#"
- onclick="location.href='/auth?logout=/';"
+ <a href="/auth?logout=/"
class="logout-link btn btn-sm btn-outline-secondary
mt-2">Log out</a>
{% else %}
- <a href="#"
- onclick="location.href='/auth?login=' +
window.location.pathname;"
+ <a href="/auth?login={{ request.path }}"
class="login-link btn btn-sm btn-secondary">Log in</a>
{% endif %}
</div>
diff --git a/atr/templates/report-selected-path.html
b/atr/templates/report-selected-path.html
index 2fc36e9..0503f4d 100644
--- a/atr/templates/report-selected-path.html
+++ b/atr/templates/report-selected-path.html
@@ -77,8 +77,9 @@
{% set bs_status = 'danger' if status == 'exception' or status ==
'failure' else status %}
<button id="btn-toggle-primary-{{ status }}"
type="button"
- class="btn {% if status == 'success' and not
all_primary_are_success %}btn-outline-success{% elif status == 'success' and
all_primary_are_success %}btn-success{% else %}btn-{{ bs_status }}{% endif %}"
- onclick="toggleStatusVisibility('primary', '{{ status }}')">
+ class="btn page-toggle-status {% if status == 'success' and
not all_primary_are_success %}btn-outline-success{% elif status == 'success'
and all_primary_are_success %}btn-success{% else %}btn-{{ bs_status }}{% endif
%}"
+ data-type="primary"
+ data-status="{{ status }}">
<span>
{% if status == 'success' and not all_primary_are_success %}
Show
@@ -91,7 +92,7 @@
{% endif %}
{% endfor %}
{% endif %}
- <button type="button" onclick="toggleAllDetails()" class="btn
btn-secondary">Toggle all details</button>
+ <button type="button" id="btn-toggle-all-details" class="btn
btn-secondary">Toggle all details</button>
</div>
<div class="mb-3">
@@ -242,8 +243,9 @@
{% set bs_status = 'danger' if status == 'exception' or status
== 'failure' else status %}
<button id="btn-toggle-member-{{ status }}"
type="button"
- class="btn {% if status == 'success' and not
all_member_are_success %}btn-outline-success{% elif status == 'success' and
all_member_are_success %}btn-success{% else %}btn-{{ bs_status }}{% endif %}"
- onclick="toggleStatusVisibility('member', '{{ status
}}')">
+ class="btn page-toggle-status {% if status == 'success'
and not all_member_are_success %}btn-outline-success{% elif status == 'success'
and all_member_are_success %}btn-success{% else %}btn-{{ bs_status }}{% endif
%}"
+ data-type="member"
+ data-status="{{ status }}">
<span>
{% if status == 'success' and not all_member_are_success %}
Show
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]