diff --git a/downloads/templatetags/download_tags.py b/downloads/templatetags/download_tags.py index 0bc50ff8f..9ae4dcf8a 100644 --- a/downloads/templatetags/download_tags.py +++ b/downloads/templatetags/download_tags.py @@ -96,6 +96,16 @@ def has_sbom(files): return any(f.sbom_spdx2_file for f in files) +@register.filter +def has_md5(files): + return any(f.md5_sum for f in files) + + +@register.filter +def has_sha256(files): + return any(f.sha256_sum for f in files) + + @register.filter def sort_windows(files): if not files: diff --git a/templates/downloads/release_detail.html b/templates/downloads/release_detail.html index a41393711..dfdfe6190 100644 --- a/templates/downloads/release_detail.html +++ b/templates/downloads/release_detail.html @@ -4,6 +4,8 @@ {% load has_gpg from download_tags %} {% load has_sigstore_materials from download_tags %} {% load has_sbom from download_tags %} +{% load has_md5 from download_tags %} +{% load has_sha256 from download_tags %} {% load sort_windows from download_tags %} {% load get_eol_info from download_tags %} @@ -85,11 +87,9 @@

{{ f.os.name }}

Version - Operating System + Operating system Description - MD5 Checksum - SHA256 Checksum - File Size + File size {% if release_files|has_sigstore_materials %} Sigstore {% endif %} @@ -99,6 +99,11 @@

{{ f.os.name }}

{% if release_files|has_gpg %} GPG {% endif %} + {% if release_files|has_sha256 %} + SHA-256 checksum + {% elif release_files|has_md5 %} + MD5 checksum + {% endif %} @@ -107,8 +112,6 @@

{{ f.os.name }}

{{ f.name }} {{ f.os.name }} {{ f.description }} - {{ f.md5_sum }} - {{ f.sha256_sum|default:"n/a" }} {{ f.filesize|filesizeformat }} {% if release_files|has_sigstore_materials %} {% if f.sigstore_bundle_file %} @@ -124,6 +127,11 @@

{{ f.os.name }}

{% if release_files|has_gpg %} {% if f.gpg_signature_file %}SIG{% endif %} {% endif %} + {% if release_files|has_sha256 %} + {{ f.sha256_sum }} + {% elif release_files|has_md5 %} + {{ f.md5_sum }} + {% endif %} {% endfor %}