feat: a link in download section

This commit is contained in:
mohamad
2026-06-07 17:41:41 +03:30
parent cbc49cd8ae
commit 33b3477176
17 changed files with 215 additions and 17 deletions
+9
View File
@@ -13,6 +13,14 @@ def package_button_labels(product):
}
def downloads_section_link(product):
url = (getattr(product, "downloads_section_link_url", "") or "").strip()
text = (getattr(product, "downloads_section_link_text", "") or "").strip()
if url and text:
return {"url": url, "text": text}
return None
def featured_version(qs):
ordered = qs.order_by("order", "pk")
cand = ordered.filter(is_featured_stable=True).first()
@@ -38,6 +46,7 @@ def build_release_context(distribution, active_versions, product):
"show_older_versions_link": False,
"package_versions": [],
**package_button_labels(product),
"downloads_section_link": downloads_section_link(product),
}
if distribution == DISTRIBUTION_INSTALLABLE: