summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bitbake/lib/toaster/toastergui/tables.py18
-rw-r--r--bitbake/lib/toaster/toastergui/templates/builds-toastertable.html10
-rw-r--r--bitbake/lib/toaster/toastergui/templates/mrb_section.html2
3 files changed, 23 insertions, 7 deletions
diff --git a/bitbake/lib/toaster/toastergui/tables.py b/bitbake/lib/toaster/toastergui/tables.py
index a0991ec3ea..0941637704 100644
--- a/bitbake/lib/toaster/toastergui/tables.py
+++ b/bitbake/lib/toaster/toastergui/tables.py
@@ -27,6 +27,7 @@ from django.db.models import Q, Max, Count
27from django.conf.urls import url 27from django.conf.urls import url
28from django.core.urlresolvers import reverse 28from django.core.urlresolvers import reverse
29from django.views.generic import TemplateView 29from django.views.generic import TemplateView
30import itertools
30 31
31from toastergui.tablefilter import TableFilter, TableFilterActionToggle 32from toastergui.tablefilter import TableFilter, TableFilterActionToggle
32 33
@@ -887,7 +888,22 @@ class BuildsTable(ToasterTable):
887 self.static_context_extra['Task'] = Task 888 self.static_context_extra['Task'] = Task
888 889
889 def get_context_data(self, **kwargs): 890 def get_context_data(self, **kwargs):
890 return super(BuildsTable, self).get_context_data(**kwargs) 891 context = super(BuildsTable, self).get_context_data(**kwargs)
892
893 # for the latest builds section
894 queryset = Build.objects.all()
895
896 finished_criteria = Q(outcome=Build.SUCCEEDED) | Q(outcome=Build.FAILED)
897
898 latest_builds = itertools.chain(
899 queryset.filter(outcome=Build.IN_PROGRESS).order_by("-started_on"),
900 queryset.filter(finished_criteria).order_by("-completed_on")[:3]
901 )
902
903 context['mru'] = list(latest_builds)
904 context['mrb_type'] = 'all'
905
906 return context
891 907
892 def setup_queryset(self, *args, **kwargs): 908 def setup_queryset(self, *args, **kwargs):
893 queryset = Build.objects.all() 909 queryset = Build.objects.all()
diff --git a/bitbake/lib/toaster/toastergui/templates/builds-toastertable.html b/bitbake/lib/toaster/toastergui/templates/builds-toastertable.html
index 419d2b52f4..f7604fd7a4 100644
--- a/bitbake/lib/toaster/toastergui/templates/builds-toastertable.html
+++ b/bitbake/lib/toaster/toastergui/templates/builds-toastertable.html
@@ -3,13 +3,13 @@
3{% block title %} All builds - Toaster {% endblock %} 3{% block title %} All builds - Toaster {% endblock %}
4 4
5{% block pagecontent %} 5{% block pagecontent %}
6 <div class="page-header top-air">
7 <h1 data-role="page-title"></h1>
8 </div>
9 6
10 <div class="row-fluid"> 7 <div class="row-fluid">
11 {# TODO need to pass this data to context #} 8 {% with mru=mru mrb_type=mrb_type %}
12 {#% include 'mrb_section.html' %#} 9 {% include 'mrb_section.html' %}
10 {% endwith %}
11
12 <h1 class="page-header top-air" data-role="page-title"></h1>
13 13
14 {% url 'builds' as xhr_table_url %} 14 {% url 'builds' as xhr_table_url %}
15 {% include 'toastertable.html' %} 15 {% include 'toastertable.html' %}
diff --git a/bitbake/lib/toaster/toastergui/templates/mrb_section.html b/bitbake/lib/toaster/toastergui/templates/mrb_section.html
index bd8f99178f..52b3f1a7d3 100644
--- a/bitbake/lib/toaster/toastergui/templates/mrb_section.html
+++ b/bitbake/lib/toaster/toastergui/templates/mrb_section.html
@@ -14,7 +14,7 @@
14 {% endif %} 14 {% endif %}
15 </h2> 15 </h2>
16 {% else %} 16 {% else %}
17 <div class="page-header"> 17 <div class="page-header top-air">
18 <h1> 18 <h1>
19 Latest builds 19 Latest builds
20 </h1> 20 </h1>