From 04a79be4831f0daa6fcf86fe2a3b361714093360 Mon Sep 17 00:00:00 2001 From: Pierre Bourdon Date: Mon, 27 Apr 2020 03:37:21 +0200 Subject: [PATCH] downloads: show last 5 beta versions --- dolweb/downloads/templates/downloads-index.html | 17 +++++++++++++++++ dolweb/downloads/views.py | 6 +++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/dolweb/downloads/templates/downloads-index.html b/dolweb/downloads/templates/downloads-index.html index b4f8b61..a3260f6 100644 --- a/dolweb/downloads/templates/downloads-index.html +++ b/dolweb/downloads/templates/downloads-index.html @@ -27,6 +27,23 @@

{% trans "Download" %}

+
+

{% trans "Beta versions" %}

+ +
{% blocktrans %} +

Beta versions are released every month, usually accompanied by a + Progress Report article. They are a good balance between the Dolphin + development versions and the + stable versions.

+ +
The beta versions require the 64-bit Visual C++ redistributable for Visual Studio 2019 + to be installed.
+{% endblocktrans %}
+ +{% include "downloads-devrel.html" with builds=beta_builds primclass='btn-info' %} + +
+

{% trans "Development versions" %}

diff --git a/dolweb/downloads/views.py b/dolweb/downloads/views.py index 588e17d..11035f9 100644 --- a/dolweb/downloads/views.py +++ b/dolweb/downloads/views.py @@ -11,6 +11,7 @@ from django.views.decorators.vary import vary_on_headers from dolweb.downloads.diggpaginator import DiggPaginator from dolweb.downloads.models import Artifact, BranchInfo, DevVersion, ReleaseVersion +from dolweb.update.models import UpdateTrack import hashlib import hmac @@ -28,10 +29,13 @@ def index(request): master_builds = (DevVersion.objects.filter(branch='master') .order_by('-date') [:10]) + beta_builds = (UpdateTrack.objects.filter(name='beta') + .order_by('-version__date') + [:5]) last_master = master_builds[0] if len(master_builds) else None return { 'releases': releases, 'master_builds': master_builds, - 'last_master': last_master } + 'beta_builds': beta_builds, 'last_master': last_master } @cache_control(max_age=15) @vary_on_headers('User-Agent')