From 02115938dd49cca515d65c8fbf53c6bd04104e72 Mon Sep 17 00:00:00 2001
From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Date: Thu, 6 Nov 2025 22:25:16 +0200
Subject: [PATCH 1/3] Add featured downloads
---
downloads/views.py | 16 +++++++++++++++-
templates/downloads/release_detail.html | 15 ++++++++++++++-
2 files changed, 29 insertions(+), 2 deletions(-)
diff --git a/downloads/views.py b/downloads/views.py
index 21e66cd55..57196d622 100644
--- a/downloads/views.py
+++ b/downloads/views.py
@@ -2,7 +2,7 @@
from datetime import datetime
-from django.db.models import Prefetch
+from django.db.models import Case, IntegerField, Prefetch, When
from django.urls import reverse
from django.utils import timezone
from django.views.generic import DetailView, TemplateView, ListView, RedirectView
@@ -157,6 +157,20 @@ def get_object(self):
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
+ # Add featured files (files with download_button=True)
+ # Order: macOS first, Windows second, Source last
+ context['featured_files'] = self.object.files.filter(
+ download_button=True
+ ).annotate(
+ os_order=Case(
+ When(os__slug='macos', then=1),
+ When(os__slug='windows', then=2),
+ When(os__slug='source', then=3),
+ default=4,
+ output_field=IntegerField(),
+ )
+ ).order_by('os_order')
+
# Manually add release files for better ordering
context['release_files'] = []
diff --git a/templates/downloads/release_detail.html b/templates/downloads/release_detail.html
index db49d974e..0eb4114ed 100644
--- a/templates/downloads/release_detail.html
+++ b/templates/downloads/release_detail.html
@@ -41,9 +41,22 @@
{{ release.name }}
{% endif %}
+ {% if featured_files %}
+
+ {% for f in featured_files %}
+
+ {% endfor %}
+
+ {% endif %}
+
From 8966436f382afc053739ebe0c6f17d0825246fe8 Mon Sep 17 00:00:00 2001
From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Date: Thu, 6 Nov 2025 23:00:11 +0200
Subject: [PATCH 2/3] Style the featured downloads
---
static/sass/style.css | 44 ++++++++++++++++++++++++++++++++++++++++++
static/sass/style.scss | 40 ++++++++++++++++++++++++++++++++++++++
2 files changed, 84 insertions(+)
diff --git a/static/sass/style.css b/static/sass/style.css
index 09c849482..b66cc9de4 100644
--- a/static/sass/style.css
+++ b/static/sass/style.css
@@ -2113,6 +2113,50 @@ table tfoot {
.download-widget p:last-child a {
white-space: nowrap; }
+.featured-downloads-list {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 1.5em;
+ justify-content: center;
+ margin-bottom: 2em; }
+
+.featured-download-box {
+ background-color: #f2f4f6;
+ border: 1px solid #caccce;
+ border-radius: 5px;
+ display: flex;
+ flex: 1 1 300px;
+ flex-direction: column;
+ min-width: 250px;
+ max-width: 400px;
+ padding: 1.25em; }
+ .featured-download-box h3 {
+ margin-top: 0; }
+ .featured-download-box .button {
+ background-color: #ffd343;
+ *zoom: 1;
+ filter: progid:DXImageTransform.Microsoft.gradient(gradientType=0, startColorstr='#FFFFDF76', endColorstr='#FFFFD343');
+ background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(10%, #ffdf76), color-stop(90%, #ffd343));
+ background-image: -webkit-linear-gradient(#ffdf76 10%, #ffd343 90%);
+ background-image: -moz-linear-gradient(#ffdf76 10%, #ffd343 90%);
+ background-image: -o-linear-gradient(#ffdf76 10%, #ffd343 90%);
+ background-image: linear-gradient(#ffdf76 10%, #ffd343 90%);
+ border: 1px solid #dca900;
+ white-space: normal; }
+ .featured-download-box .button:hover, .featured-download-box .button:active {
+ background-color: inherit;
+ background-color: #ffd343;
+ *zoom: 1;
+ filter: progid:DXImageTransform.Microsoft.gradient(gradientType=0, startColorstr='#FFFFEBA9', endColorstr='#FFFFD343');
+ background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(10%, #ffeba9), color-stop(90%, #ffd343));
+ background-image: -webkit-linear-gradient(#ffeba9 10%, #ffd343 90%);
+ background-image: -moz-linear-gradient(#ffeba9 10%, #ffd343 90%);
+ background-image: -o-linear-gradient(#ffeba9 10%, #ffd343 90%);
+ background-image: linear-gradient(#ffeba9 10%, #ffd343 90%); }
+ .featured-download-box .download-buttons {
+ margin-bottom: 0;
+ text-align: center; }
+
.time-posted {
display: block;
font-size: 0.875em;
diff --git a/static/sass/style.scss b/static/sass/style.scss
index cb78d9a4d..174a73374 100644
--- a/static/sass/style.scss
+++ b/static/sass/style.scss
@@ -1098,6 +1098,46 @@ $colors: $blue, $psf, $yellow, $green, $purple, $red;
p:last-child a { white-space: nowrap; }
}
+.featured-downloads-list {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 1.5em;
+ justify-content: center;
+ margin-bottom: 2em;
+}
+
+.featured-download-box {
+ background-color: $grey-lighterest;
+ border: 1px solid $default-border-color;
+ border-radius: 5px;
+ display: flex;
+ flex: 1 1 300px;
+ flex-direction: column;
+ min-width: 250px;
+ max-width: 400px;
+ padding: 1.25em;
+
+ h3 {
+ margin-top: 0;
+ }
+
+ .button {
+ @include vertical-gradient( lighten($yellow, 10%), $yellow );
+ border: 1px solid darken($yellow, 20%);
+ white-space: normal;
+
+ &:hover, &:active {
+ background-color: inherit;
+ @include vertical-gradient( lighten($yellow, 20%), $yellow );
+ }
+ }
+
+ .download-buttons {
+ margin-bottom: 0;
+ text-align: center;
+ }
+}
+
.documentation-widget { }
.jobs-widget { }
From 4f5aec37b610f58ad3e2ca3e7754549e3301b131 Mon Sep 17 00:00:00 2001
From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Date: Fri, 7 Nov 2025 15:18:05 +0200
Subject: [PATCH 3/3] If there's a Python install manager, use for Windows
---
templates/downloads/release_detail.html | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/templates/downloads/release_detail.html b/templates/downloads/release_detail.html
index 0eb4114ed..5959dfe30 100644
--- a/templates/downloads/release_detail.html
+++ b/templates/downloads/release_detail.html
@@ -50,7 +50,11 @@ Files
{% endfor %}