diff --git a/downloads/templatetags/download_tags.py b/downloads/templatetags/download_tags.py index c72f6d58c..f61f25ada 100644 --- a/downloads/templatetags/download_tags.py +++ b/downloads/templatetags/download_tags.py @@ -8,6 +8,11 @@ def strip_minor_version(version): return '.'.join(version.split('.')[:2]) +@register.filter +def has_gpg(files: list) -> bool: + return any(f.gpg_signature_file for f in files) + + @register.filter def has_sigstore_materials(files): return any( diff --git a/templates/downloads/release_detail.html b/templates/downloads/release_detail.html index 720887074..0ddcde32a 100644 --- a/templates/downloads/release_detail.html +++ b/templates/downloads/release_detail.html @@ -1,6 +1,7 @@ {% extends "base.html" %} {% load boxes %} {% load sitetree %} +{% load has_gpg from download_tags %} {% load has_sigstore_materials from download_tags %} {% load has_sbom from download_tags %} {% load sort_windows from download_tags %} @@ -51,7 +52,9 @@

Files

Description MD5 Sum File Size + {% if release_files|has_gpg %} GPG + {% endif %} {% if release_files|has_sigstore_materials %} Sigstore {% endif %} @@ -68,7 +71,9 @@

Files

{{ f.description }} {{ f.md5_sum }} {{ f.filesize|filesizeformat }} + {% if release_files|has_gpg %} {% if f.gpg_signature_file %}SIG{% endif %} + {% endif %} {% if release_files|has_sigstore_materials %} {% if f.sigstore_bundle_file %} {% if f.sigstore_bundle_file %}.sigstore{% endif %}