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 cda616d  Improve references to static paths
cda616d is described below

commit cda616daffad46da9f508c5328ba87ba00217db7
Author: Sean B. Palmer <[email protected]>
AuthorDate: Sun Oct 26 20:25:22 2025 +0000

    Improve references to static paths
---
 atr/admin/templates/tasks.html     |  4 ++--
 atr/server.py                      |  1 +
 atr/templates/finish-selected.html |  2 +-
 atr/templates/index-committer.html |  2 +-
 atr/templates/layouts/base.html    | 15 ++++++---------
 atr/templates/tutorial.html        | 28 ++++++++++++++--------------
 atr/util.py                        |  5 +++++
 7 files changed, 30 insertions(+), 27 deletions(-)

diff --git a/atr/admin/templates/tasks.html b/atr/admin/templates/tasks.html
index b9b0ad0..b934a48 100644
--- a/atr/admin/templates/tasks.html
+++ b/atr/admin/templates/tasks.html
@@ -7,7 +7,7 @@
 {% block stylesheets %}
   {{ super() }}
   <link rel="stylesheet"
-        href="{{ url_for('static', filename='css/mermaid.min.css') }}" />
+        href="{{ static_url('css/mermaid.min.css') }}" />
 
   <style>
     .gridjs-pages button {
@@ -24,7 +24,7 @@
 
 {% block javascripts %}
   {{ super() }}
-  <script src="{{ url_for('static', filename='js/gridjs.production.min.js') 
}}"></script>
+  <script src="{{ static_url('js/gridjs.production.min.js') }}"></script>
 
   <script>
     new gridjs.Grid({
diff --git a/atr/server.py b/atr/server.py
index 0251064..c83a153 100644
--- a/atr/server.py
+++ b/atr/server.py
@@ -142,6 +142,7 @@ def app_setup_context(app: base.QuartApp) -> None:
             "is_viewing_as_admin_fn": util.is_user_viewing_as_admin,
             "is_committee_member_fn": user.is_committee_member,
             "routes": routes,
+            "static_url": util.static_url,
             "unfinished_releases_fn": interaction.unfinished_releases,
             # "user_committees_fn": interaction.user_committees,
             "user_projects_fn": interaction.user_projects,
diff --git a/atr/templates/finish-selected.html 
b/atr/templates/finish-selected.html
index 943713b..6d32898 100644
--- a/atr/templates/finish-selected.html
+++ b/atr/templates/finish-selected.html
@@ -226,6 +226,6 @@
 </script>
   {# djlint:on #}
   <script id="main-script-data"
-          src="{{ url_for('static', filename='js/finish-selected-move.js') }}"
+          src="{{ static_url('js/finish-selected-move.js') }}"
           data-csrf-token="{{ form.csrf_token.current_token }}"></script>
 {% endblock javascripts %}
diff --git a/atr/templates/index-committer.html 
b/atr/templates/index-committer.html
index 14e8a36..4786a2f 100644
--- a/atr/templates/index-committer.html
+++ b/atr/templates/index-committer.html
@@ -69,7 +69,7 @@
           {{ display_name_cleaned }}
           {% if project.committee.is_podling or 
project.name.startswith("incubator-") %}
             <span class="text-muted fw-normal fs-5">(Incubating)</span>
-            <img src="{{ url_for('static', 
filename='svg/apache_incubator.svg') }}"
+            <img src="{{ static_url('svg/apache_incubator.svg') }}"
                  alt=""
                  class="float-end ms-3 page-logo"
                  height="24" />
diff --git a/atr/templates/layouts/base.html b/atr/templates/layouts/base.html
index 279fba6..53e03b6 100644
--- a/atr/templates/layouts/base.html
+++ b/atr/templates/layouts/base.html
@@ -14,14 +14,11 @@
           type="image/x-icon"
           href="https://apache.org/favicons/favicon.ico"; />
     {% block stylesheets %}
+      <link rel="stylesheet" href="{{ static_url('css/normalize.css') }}" />
+      <link rel="stylesheet" href="{{ static_url('css/atr.css') }}" />
       <link rel="stylesheet"
-            href="{{ url_for('static', filename='css/normalize.css') }}" />
-      <link rel="stylesheet"
-            href="{{ url_for('static', filename='css/atr.css') }}" />
-      <link rel="stylesheet"
-            href="{{ url_for('static', filename='css/bootstrap-icons.min.css') 
}}" />
-      <link rel="stylesheet"
-            href="{{ url_for('static', filename='css/bootstrap.custom.css') 
}}" />
+            href="{{ static_url('css/bootstrap-icons.min.css') }}" />
+      <link rel="stylesheet" href="{{ static_url('css/bootstrap.custom.css') 
}}" />
     {% endblock stylesheets %}
     {% block head_extra %}
     {% endblock head_extra %}
@@ -59,8 +56,8 @@
     </div>
 
     {% block javascripts %}
-      <script src="{{ url_for('static', filename='js/bootstrap.bundle.min.js') 
}}"></script>
-      <script src="{{ url_for('static', filename='js/atr.js') }}"></script>
+      <script src="{{ static_url('js/bootstrap.bundle.min.js') }}"></script>
+      <script src="{{ static_url('js/atr.js') }}"></script>
     {% endblock javascripts %}
   </body>
 </html>
diff --git a/atr/templates/tutorial.html b/atr/templates/tutorial.html
index 75eb9cf..f52ad64 100644
--- a/atr/templates/tutorial.html
+++ b/atr/templates/tutorial.html
@@ -34,14 +34,14 @@
     Use the <strong>Make releases</strong> sidebar link [<code>1</code>], then 
press the <strong>Start a new release</strong> button for any project 
[<code>2</code>].
   </p>
   <p>
-    <img src="{{ url_for('static', filename='png/tutorial-compose-01.png') }}"
+    <img src="{{ static_url('png/tutorial-compose-01.png') }}"
          alt="Illustration: Follow the sidebar link, and use the button." />
   </p>
   <p>
     Press the <strong>Upload files</strong> button on the empty 
<em>Compose</em> page to add files.
   </p>
   <p>
-    <img src="{{ url_for('static', filename='png/tutorial-compose-02.png') }}"
+    <img src="{{ static_url('png/tutorial-compose-02.png') }}"
          alt="Illustration: Use the Upload files button to add files." />
   </p>
   <p>
@@ -54,14 +54,14 @@
     When the files are present and the check results are satisfactory, press 
the <strong>Start voting</strong> button to proceed [<code>2</code>].
   </p>
   <p>
-    <img src="{{ url_for('static', filename='png/tutorial-compose-03.png') }}"
+    <img src="{{ static_url('png/tutorial-compose-03.png') }}"
          alt="Illustration: Review the results of your checks, and use the 
Start voting button." />
   </p>
   <p>
     This takes you to a form to start the vote. If necessary, use its ability 
to preview the vote announcement email body. When you submit the form, ATR 
sends an announcement message in your name to the chosen mailing list.
   </p>
   <p>
-    <img src="{{ url_for('static', filename='png/tutorial-compose-04.png') }}"
+    <img src="{{ static_url('png/tutorial-compose-04.png') }}"
          alt="Illustration: Use the form to start a vote." />
   </p>
 
@@ -70,28 +70,28 @@
     The <em>Vote</em> page is available to all project participants, and 
displays the report results from the end of the <em>Compose</em> phase to help 
participants decide how to cast their votes [<code>1</code>]. Press the 
<strong>Download files</strong> button to download the release candidate files 
to review them before voting [<code>2</code>].
   </p>
   <p>
-    <img src="{{ url_for('static', filename='png/tutorial-vote-01.png') }}"
+    <img src="{{ static_url('png/tutorial-vote-01.png') }}"
          alt="Illustration: Anybody can review the reports." />
   </p>
   <p>
     Several methods are available to download files: using the browser, 
<code>curl</code>, <code>rsync</code>, or <code>wget</code>. You must upload an 
SSH key before you can use <code>rsync</code>.
   </p>
   <p>
-    <img src="{{ url_for('static', filename='png/tutorial-vote-02.png') }}"
+    <img src="{{ static_url('png/tutorial-vote-02.png') }}"
          alt="Illustration: Download the release candidate files." />
   </p>
   <p>
     A link allows review of the voting thread in the mailing list archives 
[<code>1</code>]. ATR will try to tally votes for you, but you must check the 
results manually. A form on the page allows you to cast your vote on the 
mailing list [<code>2</code>].
   </p>
   <p>
-    <img src="{{ url_for('static', filename='png/tutorial-vote-03.png') }}"
+    <img src="{{ static_url('png/tutorial-vote-03.png') }}"
          alt="Illustration: Review the voting thread, and cast your own vote." 
/>
   </p>
   <p>
     When the voting period concludes and the mandate is clear, record the 
outcome using the vote resolution form, accessed by pressing the 
<strong>Resolve vote</strong> button. Submitting this form also sends the 
outcome of the vote to the mailing list. A successful vote promotes the release 
candidate to the next phase; a failed vote returns it to the <em>Compose</em> 
phase.
   </p>
   <p>
-    <img src="{{ url_for('static', filename='png/tutorial-vote-04.png') }}"
+    <img src="{{ static_url('png/tutorial-vote-04.png') }}"
          alt="Illustration: Use the vote resolution form to progress to the 
next phase." />
   </p>
 
@@ -106,21 +106,21 @@
     When the release is finished, press the <strong>Announce and 
distribute</strong> button.
   </p>
   <p>
-    <img src="{{ url_for('static', filename='png/tutorial-finish-01.png') }}"
+    <img src="{{ static_url('png/tutorial-finish-01.png') }}"
          alt="Illustration: Use the Announce and distribute button." />
   </p>
   <p>
     Submitting the announcement form sends a message to your selected mailing 
list. Complete the <strong>Download path suffix</strong> field to choose a 
specific location from which users can download your release artifacts.
   </p>
   <p>
-    <img src="{{ url_for('static', filename='png/tutorial-finish-02.png') }}"
+    <img src="{{ static_url('png/tutorial-finish-02.png') }}"
          alt="Illustration: The announcement form sends a message to your 
selected mailing list." />
   </p>
 
   <h2 id="releases">Releases</h2>
   <p>When a release is finished, it is listed alongside any other finished 
releases for a project.</p>
   <p>
-    <img src="{{ url_for('static', filename='png/tutorial-releases-01.png') }}"
+    <img src="{{ static_url('png/tutorial-releases-01.png') }}"
          alt="Illustration: Finished releases are shown for each individual 
project." />
   </p>
   <p>Each release entry provides a link to download the files in the 
release.</p>
@@ -134,19 +134,19 @@
     There is a <strong>Create project</strong> button under each committee in 
your <strong>Committee directory</strong>, accessible from the sidebar.
   </p>
   <p>
-    <img src="{{ url_for('static', filename='png/tutorial-projects-01.png') }}"
+    <img src="{{ static_url('png/tutorial-projects-01.png') }}"
          alt="Illustration: Use the Create project button to create a new 
project." />
   </p>
   <p>Follow the instructions under each form input carefully, otherwise your 
new project will not be created.</p>
   <p>
-    <img src="{{ url_for('static', filename='png/tutorial-projects-02.png') }}"
+    <img src="{{ static_url('png/tutorial-projects-02.png') }}"
          alt="Illustration: The create project form has Display name and Label 
fields." />
   </p>
   <p>
     Every successfully added project is listed on the <strong>Committee 
directory</strong> page. Press the project button, and the project page will be 
displayed with its release policy form. Edit the release policy form to your 
liking, and <strong>Save</strong> your changes.
   </p>
   <p>
-    <img src="{{ url_for('static', filename='png/tutorial-projects-03.png') }}"
+    <img src="{{ static_url('png/tutorial-projects-03.png') }}"
          alt="Illustration: The release policy form is split into three 
sections." />
   </p>
   <p>
diff --git a/atr/util.py b/atr/util.py
index c0b5208..849887f 100644
--- a/atr/util.py
+++ b/atr/util.py
@@ -815,6 +815,11 @@ def static_path(*args: str) -> str:
     return quart.url_for("static", filename=filename)
 
 
+def static_url(filename: str) -> str:
+    """Return the URL for a static file."""
+    return quart.url_for("static", filename=filename)
+
+
 async def task_archive_url(task_mid: str) -> str | None:
     if "@" not in task_mid:
         return None


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

Reply via email to