Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Implement downloads page which is nicer and simpler than dumping a us…

…er onto the Github page with all tags. Using python-github2 for Github API interaction and displaying all tags as releases on the downloads page.
  • Loading branch information...
commit f76200519128b260b9370a453896eb75a6d5ae85 1 parent 5892f5b
@danielgtaylor authored
View
3  .gitmodules
@@ -1,3 +1,6 @@
[submodule "contrib/django"]
path = contrib/django
url = http://github.com/django/django.git
+[submodule "contrib/python-github2"]
+ path = contrib/python-github2
+ url = http://github.com/ask/python-github2.git
1  contrib/python-github2
@@ -0,0 +1 @@
+Subproject commit 6f1668334f3b66ead41961a47e9eba5304657c32
View
17 main/views.py
@@ -19,6 +19,8 @@
from django.core.mail import send_mail, EmailMessage
from django.http import HttpResponse, HttpResponseRedirect
+from github2.client import Github
+
import settings
from forms import ContactForm, SubmitForm, PresetForm
@@ -113,6 +115,21 @@ def preset_create(request):
def screenshots(request):
return render(request, "screenshots.html")
+def downloads(request):
+ github = Github()
+
+ data = []
+
+ tags = github.repos.tags("danielgtaylor/arista")
+
+ for tag_name in sorted(tags.keys(), reverse=True):
+ commit = github.commits.show("danielgtaylor/arista", tags[tag_name])
+ data.append([tag_name, commit])
+
+ return render(request, "downloads.html", {
+ "data": data,
+ })
+
def contact(request):
if request.method == "POST":
form = ContactForm(request.POST)
View
BIN  media/img/download.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
2  templates/base.html
@@ -28,7 +28,7 @@
<li><a id="about" href="/" title="About Arista Transcoder">About</a></li>
<li><a id="presets" href="/presets/" title="Share and download new presets for various devices">Presets</a></li>
<li><a id="screenshots" href="/screenshots/" title="See Arista in action">Screenshots</a></li>
- <li><a href="http://github.com/danielgtaylor/arista/downloads" title="Download the latest version">Download</a></li>
+ <li><a href="/downloads/">Download</a></li>
</ul>
<a id="donate" href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=V7SCZ2ZTJKQ5A" title="Please contribute a donation to help keep this project alive!">Donate</a>
</div>
View
35 templates/downloads.html
@@ -0,0 +1,35 @@
+{% extends "base.html" %}
+
+{% block title %}Arista Transcoder - Downloads{% endblock %}
+
+{% block content %}
+ <h1>Downloads</h1>
+ <div class="half left">
+ <p>
+ Here you can download the latest releas of Arista Transcoder.
+ </p>
+ <div style="text-align: center; padding: 2.5em 0em;">
+ <a class="button" href="http://github.com/danielgtaylor/arista/tarball/{{ data|first|first }}"><img src="{{ MEDIA_URL }}img/download.png" alt="Icon" style="margin-left: -32px; margin-right: 10px; margin-bottom: -10px; margin-top: -10em;"/>Download arista-{{ data|first|first }}</a>
+ </div>
+ <p>
+ To the right you will find a full list of releases, when they were released, and the SHA commit. You can also try the latest unreleased code in <a href="http://github.com/danielgtaylor/arista">trunk</a>.
+ </p>
+ </div>
+ <div class="half right">
+ <table>
+ <tr>
+ <th>Version</th>
+ <th>Date</th>
+ <th>Commit</th>
+ </tr>
+ {% for tag, commit in data %}
+ <tr>
+ <td><a href="http://github.com/danielgtaylor/arista/tarball/{{ tag }}">arista-{{ tag }}</a></td>
+ <td>{{ commit.authored_date|date:"j N, Y" }}</td>
+ <td><a href="{{ commit.url }}">{{ commit.id|slice:":7" }}</a></td>
+ </tr>
+ {% endfor %}
+ </table>
+ </div>
+{% endblock %}
+
View
1  urls.py
@@ -24,6 +24,7 @@
(r'^presets/submit/$', 'preset_submit'),
(r'^presets/create/$', 'preset_create'),
(r'^screenshots/$', 'screenshots'),
+ (r'^downloads/$', 'downloads'),
(r'^contact/$', 'contact'),
(r'^contact/thanks/$', 'thanks'),
)
Please sign in to comment.
Something went wrong with that request. Please try again.