1. Benoît Allard
  2. buglink

Commits

Benoît Allard  committed 266c765

web: same for the binaries

  • Participants
  • Parent commits 566f175
  • Branches default

Comments (0)

Files changed (3)

File web/templates/binaries.html

View file
 {% block items %}
 {% for binary in binaries %}
   <li class="binary">
-    {{ binary.module.name }} - {{binary.build.number}}
-    <ul>
-      {% for release in binary.releases %}
-        <li>{{ release }}</li>
-      {% endfor %}
-    </ul>
+    <h3><a href="{{ url_for('views.binary', name=binary.module.name, build=binary.build.number) }}">{{ binary.module.name }} - {{binary.build.number}}</a></h3>
+    <p>Included in {{ binary.releases | count }} releases</p>
   </li>
 {% else %}
 <li> No binary in DB (yet)</li>

File web/templates/binary.html

View file
+{% extends "layout.html" %}
+
+{% import "macros.j2" as macros %}
+
+{% block body %}
+<h3>{{ binary.module.name}} - <a href="{{ url_for('views.build', number=binary.build.number)}}">{{ binary.build.number }}</a></h3>
+<ul>
+  {% for release in binary.releases %}
+  <li><a href="{{ url_for('views.release', ref=release.ref, rc=release.rc) }}">{{ release }}</a></li>
+  {% endfor %}
+</ul>
+{% endblock %}

File web/views.py

View file
                            binaries=items,
                            )
 
+
+@views.route('/binary/<name>/<int:build>')
+def binary(name, build):
+    query = request.dbsession.query(models.Binary) \
+                             .join(models.Module) \
+                             .join(models.Build) \
+                             .filter(models.Module.name==name) \
+                             .filter(models.Build.number==build)
+    try:
+        binary = query.one()
+    except sqlalchemy.orm.exc.NoResultFound:
+        abort(404)
+    return render_template('binary.html', binary=binary)
+
 @views.route('/repositories/', defaults={'page': 1})
 @views.route('/repositories/page/<int:page>')
 def listrepositories(page):