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 2036cbf Allow key upload from committee pages, and improve their key
tables
2036cbf is described below
commit 2036cbf1ba5f8c1b99a9a5c1c6013a91bb7d75c8
Author: Sean B. Palmer <[email protected]>
AuthorDate: Fri May 30 14:07:48 2025 +0100
Allow key upload from committee pages, and improve their key tables
---
atr/routes/committees.py | 2 +
atr/templates/committee-view.html | 81 ++++++++++++++-------------------------
2 files changed, 31 insertions(+), 52 deletions(-)
diff --git a/atr/routes/committees.py b/atr/routes/committees.py
index 8dc47e0..4570282 100644
--- a/atr/routes/committees.py
+++ b/atr/routes/committees.py
@@ -24,6 +24,7 @@ import atr.db as db
import atr.db.models as models
import atr.routes as routes
import atr.template as template
+import atr.util as util
@routes.public("/committees")
@@ -45,4 +46,5 @@ async def view(name: str) -> str:
committee=committee,
algorithms=routes.algorithms,
now=datetime.datetime.now(datetime.UTC),
+ email_from_key=util.email_from_uid,
)
diff --git a/atr/templates/committee-view.html
b/atr/templates/committee-view.html
index 5e40597..915f927 100644
--- a/atr/templates/committee-view.html
+++ b/atr/templates/committee-view.html
@@ -45,59 +45,36 @@
<h3 class="mb-2">Signing keys</h3>
</div>
<div class="card-body">
- <div class="row row-cols-1 g-4">
- {% for key in committee.public_signing_keys %}
- <div class="col">
- <div class="card h-100 border">
- <div class="card-body">
- <table class="table mb-0">
- <tbody>
- <tr>
- <th class="border-0">Fingerprint</th>
- <td class="text-break border-0">{{ key.fingerprint
}}</td>
- </tr>
- <tr>
- <th class="border-0">Key Type</th>
- <td class="text-break border-0">{{
algorithms[key.algorithm] }} ({{ key.length }} bits)</td>
- </tr>
- <tr>
- <th class="border-0">Created</th>
- <td class="text-break border-0">{{
key.created.strftime("%Y-%m-%d %H:%M:%S") }}</td>
- </tr>
- <tr>
- <th class="border-0">Expires</th>
- <td class="text-break border-0">
- {% if key.expires %}
- {% set days_until_expiry = (key.expires - now).days
%}
- {% if days_until_expiry < 0 %}
- <span class="text-danger fw-bold">
- {{ key.expires.strftime("%Y-%m-%d %H:%M:%S") }}
- <span class="badge bg-danger text-white
ms-2">Expired</span>
- </span>
- {% elif days_until_expiry <= 30 %}
- <span class="text-warning fw-bold">
- {{ key.expires.strftime("%Y-%m-%d %H:%M:%S") }}
- <span class="badge bg-warning text-dark
ms-2">Expires in {{ days_until_expiry }} days</span>
- </span>
- {% else %}
- {{ key.expires.strftime("%Y-%m-%d %H:%M:%S") }}
- {% endif %}
- {% else %}
- Never
- {% endif %}
- </td>
- </tr>
- <tr>
- <th class="border-0">User ID</th>
- <td class="text-break border-0">{{ key.declared_uid or
'Not specified' }}</td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- </div>
- {% endfor %}
+ <div class="mb-4">
+ <a href="{{ as_url(routes.keys.upload) }}"
+ class="btn btn-outline-primary">Upload a KEYS file</a>
</div>
+ {% if committee.public_signing_keys %}
+ <div class="table-responsive mb-2">
+ <table class="table border table-striped table-hover table-sm">
+ <thead>
+ <tr>
+ <th class="px-2" scope="col">Fingerprint</th>
+ <th class="px-2" scope="col">Email</th>
+ <th class="px-2" scope="col">Apache UID</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for key in committee.public_signing_keys %}
+ <tr>
+ <td class="text-break font-monospace px-2">
+ <a href="{{ as_url(routes.keys.show_gpg_key,
fingerprint=key.fingerprint) }}">{{ key.fingerprint[:16]|upper }}</a>
+ </td>
+ <td class="text-break px-2">{{
email_from_key(key.primary_declared_uid) or 'Not specified' }}</td>
+ <td class="text-break px-2">{{ key.apache_uid or "-" }}</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ </div>
+ {% else %}
+ <p class="mb-4">No keys uploaded for this committee yet.</p>
+ {% endif %}
</div>
</div>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]