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 04a79be
Show file tree
Hide file tree
Showing 2 changed files with 22 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
6 changes: 5 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,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')
Expand Down

0 comments on commit 04a79be

Please sign in to comment.