summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/templatetags/projecttags.py
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2013-12-13 17:14:34 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-01-10 15:20:26 +0000
commit5482409a370552809de75150350defef04ac7144 (patch)
treee0af09995517b66cc01be62508fef763907e051d /bitbake/lib/toaster/toastergui/templatetags/projecttags.py
parent2251426ae420640c082ec0d0109b9be435075411 (diff)
downloadpoky-5482409a370552809de75150350defef04ac7144.tar.gz
bitbake: toaster: Build dashboard implementation
This patch adds the build dashboard page implementation, which is the landing page for the Toaster GUI. Also adds correct links from the main build page to the various parts of the dashboard. [YOCTO #4258] (Bitbake rev: bf7fbf5c0ee39564d813f82e194242f9d4f73c47) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/templatetags/projecttags.py')
-rw-r--r--bitbake/lib/toaster/toastergui/templatetags/projecttags.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/toastergui/templatetags/projecttags.py b/bitbake/lib/toaster/toastergui/templatetags/projecttags.py
index 5f60379932..1455026754 100644
--- a/bitbake/lib/toaster/toastergui/templatetags/projecttags.py
+++ b/bitbake/lib/toaster/toastergui/templatetags/projecttags.py
@@ -29,3 +29,21 @@ def time_difference(start_time, end_time):
29def timespent(build_object): 29def timespent(build_object):
30 tdsec = (build_object.completed_on - build_object.started_on).total_seconds() 30 tdsec = (build_object.completed_on - build_object.started_on).total_seconds()
31 return "%02d:%02d:%02d" % (int(tdsec/3600), int((tdsec - tdsec/ 3600)/ 60), int(tdsec) % 60) 31 return "%02d:%02d:%02d" % (int(tdsec/3600), int((tdsec - tdsec/ 3600)/ 60), int(tdsec) % 60)
32
33@register.assignment_tag
34def query(qs, **kwargs):
35 """ template tag which allows queryset filtering. Usage:
36 {% query books author=author as mybooks %}
37 {% for book in mybooks %}
38 ...
39 {% endfor %}
40 """
41 return qs.filter(**kwargs)
42
43@register.filter
44def divide(value, arg):
45 return int(value) / int(arg)
46
47@register.filter
48def multiply(value, arg):
49 return int(value) * int(arg)