summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElliot Smith <elliot.smith@intel.com>2016-01-15 13:00:52 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-01-15 16:30:00 +0000
commitb929889cdd4a36846f9569d89fabd9987e94b39e (patch)
tree9e11edd9fcb580734f5f6feedb3a032752c4fde5
parent1a4b203ca59bcf953b030dc582e298ce13cf3470 (diff)
downloadpoky-b929889cdd4a36846f9569d89fabd9987e94b39e.tar.gz
bitbake: toastergui: show recent builds on all builds page
The recent builds section was disabled while converting the all builds page to ToasterTable. Re-enable the recent builds area and add the data it requires to the ToasterTable context. [YOCTO #8738] (Bitbake rev: d6df4545bd134a23c9bd3cd1ba3b61ddb26545e4) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-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>