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 325cacb  Add a page for admins to display all of their releases, for 
debugging
325cacb is described below

commit 325cacb16bcad96951b5686746fab678fbf8035c
Author: Sean B. Palmer <[email protected]>
AuthorDate: Fri Apr 4 20:22:04 2025 +0100

    Add a page for admins to display all of their releases, for debugging
---
 atr/blueprints/admin/admin.py                |  8 ++++++
 atr/blueprints/admin/templates/releases.html | 43 ++++++++++++++++++++++++++++
 atr/templates/includes/sidebar.html          |  5 ++++
 3 files changed, 56 insertions(+)

diff --git a/atr/blueprints/admin/admin.py b/atr/blueprints/admin/admin.py
index 7da70e4..430399e 100644
--- a/atr/blueprints/admin/admin.py
+++ b/atr/blueprints/admin/admin.py
@@ -389,6 +389,14 @@ async def _update_committees() -> tuple[int, int]:  # 
noqa: C901
     return added_count, updated_count
 
 
[email protected]("/releases")
+async def admin_releases() -> str:
+    """Display a list of all releases across all stages and phases."""
+    async with db.session() as data:
+        releases = await data.release(_project=True, 
_committee=True).order_by(models.Release.name).all()
+    return await quart.render_template("releases.html", releases=releases)
+
+
 @admin.BLUEPRINT.route("/tasks")
 async def admin_tasks() -> str:
     return await quart.render_template("tasks.html")
diff --git a/atr/blueprints/admin/templates/releases.html 
b/atr/blueprints/admin/templates/releases.html
new file mode 100644
index 0000000..7c6d01b
--- /dev/null
+++ b/atr/blueprints/admin/templates/releases.html
@@ -0,0 +1,43 @@
+{% extends "layouts/base.html" %}
+
+{% block title %}
+  All releases ~ ATR Admin
+{% endblock title %}
+
+{% block description %}
+  View all releases across all stages and phases, for debugging.
+{% endblock description %}
+
+{% block content %}
+  <h2>All releases</h2>
+
+  <table class="table table-striped table-hover">
+    <thead>
+      <tr>
+        <th>Release name</th>
+        <th>Project</th>
+        <th>Committee</th>
+        <th>Stage</th>
+        <th>Phase</th>
+        <th>Created</th>
+      </tr>
+    </thead>
+    <tbody>
+      {% for release in releases %}
+        <tr>
+          <td>{{ release.name }}</td>
+          <td>{{ release.project.name if release.project else "N/A" }}</td>
+          <td>{{ release.project.committee.name if release.project and 
release.project.committee else "N/A" }}</td>
+          <td>{{ release.stage.value }}</td>
+          <td>{{ release.phase.value }}</td>
+          <td>{{ release.created.strftime('%Y-%m-%d %H:%M:%S UTC') }}</td>
+        </tr>
+      {% else %}
+        <tr>
+          <td colspan="6">No releases found.</td>
+        </tr>
+      {% endfor %}
+    </tbody>
+  </table>
+
+{% endblock content %}
diff --git a/atr/templates/includes/sidebar.html 
b/atr/templates/includes/sidebar.html
index 86834f4..e073caa 100644
--- a/atr/templates/includes/sidebar.html
+++ b/atr/templates/includes/sidebar.html
@@ -115,6 +115,11 @@
             <a href="{{ url_for('admin.admin_data') }}"
                {% if request.endpoint == 'admin.admin_data' %}class="active"{% 
endif %}>Browse database</a>
           </li>
+          <li>
+            <i class="fa-solid fa-list-ul"></i>
+            <a href="{{ url_for('admin.admin_releases') }}"
+               {% if request.endpoint == 'admin.admin_releases' 
%}class="active"{% endif %}>All releases</a>
+          </li>
           <li>
             <i class="fa-solid fa-rotate"></i>
             <a href="{{ url_for('admin.admin_projects_update') }}"


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

Reply via email to