Commits

Anonymous committed 068e5ca

add pending builds to tinder display

  • Participants
  • Parent commits 870a39c

Comments (0)

Files changed (2)

File tinder/templates/tinder/builds_for.html

 <h1>Builds for change {{change.number}}</h1>
 <p>
 {{ change.who }}
+{% if change.branch %}
+on {{ change.branch }}
+{% endif %}
 </p>
 <p>
 {{ change.comments }}
 </p>
+{% if pending %}{{ pending }} builds pending{% endif %}
 {% for build in done_builds %}
 <div class="buildbox {{ build.class }}">
   {{ build.build|showbuild }}

File tinder/views.py

         return HttpResponseNotFound("Given change does not exist")
 
     builds = Build.objects.filter(sourcestamp__changes=change).order_by('starttime')
+    pending = BuildRequest.objects.filter(builds__isnull=True,
+                                          sourcestamp__changes).count()
     running = []
     done = []
     for b in builds:
     
     return render_to_response('tinder/builds_for.html',
                               {'done_builds': done,
+                               'pending': pending,
                                'change': change})
 
 
 
     def title(self, change):
         title = []
-        builds = Build.objects.filter(sourcestamp__changes=change)
-        pending = builds.filter(endtime__isnull=True).count()
+        pending = BuildRequest.objects.filter(builds__isnull=True,
+                                              sourcestamp__changes).count()
         if pending:
             title.append("%d pending" % pending)
+        builds = Build.objects.filter(sourcestamp__changes=change)
+        building = builds.filter(endtime__isnull=True).count()
+        if building:
+            title.append("%d building" % building)
         failed = builds.filter(result=2).count()
         if failed:
             title.append("%d failed" % failed)