aboutsummaryrefslogtreecommitdiffstats
path: root/lib/toaster/toastergui/templatetags
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2013-12-13 17:14:34 +0000
committerPaul Eggleton <paul.eggleton@linux.intel.com>2014-01-10 14:13:50 +0000
commitbf7fbf5c0ee39564d813f82e194242f9d4f73c47 (patch)
treeb3d69409691d79f1ab6842166dc1b3ba7dabc35d /lib/toaster/toastergui/templatetags
parentd31f039ae31b77023722c06e66542751536a1362 (diff)
downloadbitbake-bf7fbf5c0ee39564d813f82e194242f9d4f73c47.tar.gz
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] Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Diffstat (limited to 'lib/toaster/toastergui/templatetags')
-rw-r--r--lib/toaster/toastergui/templatetags/projecttags.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/toaster/toastergui/templatetags/projecttags.py b/lib/toaster/toastergui/templatetags/projecttags.py
index 5f6037993..145502675 100644
--- a/lib/toaster/toastergui/templatetags/projecttags.py
+++ b/lib/toaster/toastergui/templatetags/projecttags.py
@@ -29,3 +29,21 @@ def time_difference(start_time, end_time):
def timespent(build_object):
tdsec = (build_object.completed_on - build_object.started_on).total_seconds()
return "%02d:%02d:%02d" % (int(tdsec/3600), int((tdsec - tdsec/ 3600)/ 60), int(tdsec) % 60)
+
+@register.assignment_tag
+def query(qs, **kwargs):
+ """ template tag which allows queryset filtering. Usage:
+ {% query books author=author as mybooks %}
+ {% for book in mybooks %}
+ ...
+ {% endfor %}
+ """
+ return qs.filter(**kwargs)
+
+@register.filter
+def divide(value, arg):
+ return int(value) / int(arg)
+
+@register.filter
+def multiply(value, arg):
+ return int(value) * int(arg)