summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bitbake/lib/toaster/toastergui/templates/builddashboard.html9
-rw-r--r--bitbake/lib/toaster/toastergui/templatetags/field_values_filter.py18
2 files changed, 23 insertions, 4 deletions
diff --git a/bitbake/lib/toaster/toastergui/templates/builddashboard.html b/bitbake/lib/toaster/toastergui/templates/builddashboard.html
index 04a57ef64f..dcda2a891f 100644
--- a/bitbake/lib/toaster/toastergui/templates/builddashboard.html
+++ b/bitbake/lib/toaster/toastergui/templates/builddashboard.html
@@ -1,8 +1,9 @@
1{% extends "basebuildpage.html" %} 1{% extends "basebuildpage.html" %}
2{% load humanize %} 2{% load humanize %}
3{% load projecttags %} 3{% load projecttags %}
4{% load field_values_filter %}
4 5
5{% block title %} {{build.target_set.all|dictsort:"target"|join:", "}} {{build.machine}} - {{build.project.name}} - Toaster {% endblock %} 6{% block title %} {{build.get_sorted_target_list|field_values:"target"|join:", "}} {{build.machine}} - {{build.project.name}} - Toaster {% endblock %}
6{% block parentbreadcrumb %} 7{% block parentbreadcrumb %}
7{% if build.get_sorted_target_list.count > 0 %} 8{% if build.get_sorted_target_list.count > 0 %}
8 {{build.get_sorted_target_list.0.target}} 9 {{build.get_sorted_target_list.0.target}}
@@ -15,7 +16,7 @@
15<!-- page title --> 16<!-- page title -->
16<div class="col-md-10"> 17<div class="col-md-10">
17 <div class="page-header build-data"> 18 <div class="page-header build-data">
18 <h1>{{build.target_set.all|dictsort:"target"|join:", "}} {{build.machine}}</h1> 19 <h1>{{build.get_sorted_target_list|field_values:"target"|join:", "}} {{build.machine}}</h1>
19 </div> 20 </div>
20 21
21<!-- build result bar --> 22<!-- build result bar -->
@@ -113,7 +114,7 @@
113 </dt> 114 </dt>
114 <dd> 115 <dd>
115 <ul class="list-unstyled"> 116 <ul class="list-unstyled">
116 {% for i in target.imageFiles %} 117 {% for i in target.imageFiles|dictsort:"suffix" %}
117 <li> 118 <li>
118 <a href="{% url 'build_artifact' build.pk 'imagefile' i.id %}"> 119 <a href="{% url 'build_artifact' build.pk 'imagefile' i.id %}">
119 {{i.suffix}} 120 {{i.suffix}}
@@ -261,7 +262,7 @@
261 if (location.href.search('#warnings') > -1) { 262 if (location.href.search('#warnings') > -1) {
262 $('#warning-info').addClass('in'); 263 $('#warning-info').addClass('in');
263 } 264 }
264 265
265 //show warnings section when requested from the build outcome 266 //show warnings section when requested from the build outcome
266 $(".show-warnings").click(function() { 267 $(".show-warnings").click(function() {
267 $('#warning-info').addClass('in'); 268 $('#warning-info').addClass('in');
diff --git a/bitbake/lib/toaster/toastergui/templatetags/field_values_filter.py b/bitbake/lib/toaster/toastergui/templatetags/field_values_filter.py
new file mode 100644
index 0000000000..5a73af797c
--- /dev/null
+++ b/bitbake/lib/toaster/toastergui/templatetags/field_values_filter.py
@@ -0,0 +1,18 @@
1from django import template
2
3register = template.Library()
4
5def field_values(iterable, field):
6 """
7 Convert an iterable of models into a list of strings, one for each model,
8 where the string for each model is the value of the field "field".
9 """
10 objects = []
11
12 if field:
13 for item in iterable:
14 objects.append(getattr(item, field))
15
16 return objects
17
18register.filter('field_values', field_values) \ No newline at end of file