You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tooling.apache.org by sb...@apache.org on 2025/04/29 13:37:20 UTC
(tooling-trusted-release) branch main updated: Add a download button to the candidate view page
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 7a31601 Add a download button to the candidate view page
7a31601 is described below
commit 7a31601d63fc419e59e71c5fe17c7c71a130d742
Author: Sean B. Palmer <se...@miscoranda.com>
AuthorDate: Tue Apr 29 14:36:59 2025 +0100
Add a download button to the candidate view page
---
atr/routes/download.py | 4 +++-
atr/templates/check-selected.html | 4 ++++
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/atr/routes/download.py b/atr/routes/download.py
index aa5d7f4..876e078 100644
--- a/atr/routes/download.py
+++ b/atr/routes/download.py
@@ -42,10 +42,12 @@ async def phase(
raise routes.FlashError("Path must be relative")
release = await session.release(project_name, version_name, phase=None)
+ # logging.warning(f"Downloading {file_path} from {release}")
full_path = util.release_directory(release) / file_path
+ # logging.warning(f"Full path: {full_path}")
# Check that the file exists
- if not await aiofiles.os.path.exists(file_path):
+ if not await aiofiles.os.path.exists(full_path):
# Even using the following type declaration, mypy does not know the type
# The same pattern is used in release.py, so this is a bug in mypy
# TODO: Report the bug upstream to mypy
diff --git a/atr/templates/check-selected.html b/atr/templates/check-selected.html
index d6a1a13..2b9f8fe 100644
--- a/atr/templates/check-selected.html
+++ b/atr/templates/check-selected.html
@@ -232,6 +232,10 @@
onclick="this.innerHTML = (this.innerHTML.trim() === 'More') ? 'Less' : 'More';">
More
</button>
+ {% else %}
+ <a href="{{ as_url(routes.download.phase, phase='candidate', project_name=release.project.name, version_name=release.version, file_path=path) }}"
+ title="Download file {{ path }}"
+ class="btn btn-sm btn-outline-secondary">Download</a>
{% endif %}
</div>
</td>
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@tooling.apache.org
For additional commands, e-mail: commits-help@tooling.apache.org