diff --git a/splenda/core.py b/splenda/core.py index 8ef4679..0f0d42e 100644 --- a/splenda/core.py +++ b/splenda/core.py @@ -32,12 +32,30 @@ def index(): return render_template('index.html', builds=builds) + @app.route('//') def repo(user, repo): r = requests.get('http://travis-ci.org/{0}/{1}.json'.format(user, repo)) - repo = r.json + _repo = r.json r = requests.get('http://travis-ci.org/{0}/{1}/builds.json'.format(user, repo)) builds = r.json - return render_template('repo.html', repo=repo, builds=builds) \ No newline at end of file + url = 'http://travis-ci.org/{0}/{1}/builds/{2}.json'.format( + user, repo, _repo[u'last_build_id']) + + r = requests.get(url) + build = r.json + + return render_template('repo.html', repo=_repo, builds=builds, build=build) + +@app.route('///') +def build(user, repo, build): + + url = 'http://travis-ci.org/{0}/{1}/builds/{2}.json'.format(user, repo, build) + + r = requests.get(url) + build = r.content + + return render_template('build.html', build=build) + diff --git a/splenda/templates/build.html b/splenda/templates/build.html index 301ccb3..e92d42a 100644 --- a/splenda/templates/build.html +++ b/splenda/templates/build.html @@ -1,4 +1,9 @@ {% extends "base.html" %} {% block content %} + +
+{{ build }}
+
+ {% endblock %} \ No newline at end of file diff --git a/splenda/templates/repo.html b/splenda/templates/repo.html index b68c30a..f0bedb6 100644 --- a/splenda/templates/repo.html +++ b/splenda/templates/repo.html @@ -2,10 +2,14 @@ {% block content %} -

{{ repo }}

+

{{ repo['slug'] }}

+ +
+{{ build }}
+
{% for build in builds %} -
  • {{ build['slug'] }}
  • +
  • {{ build['number'] }}
  • {% endfor %}