Skip to content

Commit

Permalink
downloads: show last 5 beta versions
Browse files Browse the repository at this point in the history
  • Loading branch information
delroth committed Apr 27, 2020
1 parent 03b103e commit f84e290
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
17 changes: 17 additions & 0 deletions dolweb/downloads/templates/downloads-index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,23 @@
<h1>{% trans "Download" %}</h1>
</div>

<div id="download-beta">
<h1>{% trans "Beta versions" %}</h1>

<div class="alert">{% blocktrans %}
<p>Beta versions are released every month, usually accompanied by a
<em>Progress Report</em> article. They are a good balance between the Dolphin
<a href="#download-dev">development versions</a> and the
<a href="#download-stable">stable versions</a>.</p>

<div class="alert alert-info">The beta versions require the <a href="https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads">64-bit Visual C++ redistributable for Visual Studio 2019</a>
to be installed.</div>
{% endblocktrans %}</div>

{% include "downloads-devrel.html" with builds=beta_builds primclass='btn-info' %}

</div>

<div id="download-dev">
<h1>{% trans "Development versions" %}</h1>

Expand Down
7 changes: 6 additions & 1 deletion dolweb/downloads/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -28,10 +29,14 @@ def index(request):
master_builds = (DevVersion.objects.filter(branch='master')
.order_by('-date')
[:10])
beta_track = (UpdateTrack.objects.filter(name='beta')
.order_by('-version__date')
[:5])
beta_builds = [track.version for track in beta_track]
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')
Expand Down

0 comments on commit f84e290

Please sign in to comment.