aboutsummaryrefslogtreecommitdiffstats
path: root/lib/toaster/toastergui/templatetags
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2013-12-11 16:42:34 +0000
committerPaul Eggleton <paul.eggleton@linux.intel.com>2014-01-10 14:13:47 +0000
commitd31f039ae31b77023722c06e66542751536a1362 (patch)
tree6a549f7ebd5500368115b3a5b774553503f5e939 /lib/toaster/toastergui/templatetags
parent0b3d2000c0bcd2bb5a3af5d49a514a90f001a7d2 (diff)
downloadbitbake-d31f039ae31b77023722c06e66542751536a1362.tar.gz
toaster: Create the base page navigation structure
Updating the general container pages to use the graphical design and features from the design phase. In the process of adapting the Simple UI to the designed interface, we create all the pages and the navigation structure for the Toaster GUI. Views for each page have been added, and the url mapping has been updated to reflect newly added pages. The table page has been refactored to be component-oriented instead of class-oriented in order to facilitate reusage. Changes are made in different layers of the template (base, basetable) in order to maximize code reuse among different pages in the build. Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Diffstat (limited to 'lib/toaster/toastergui/templatetags')
-rw-r--r--lib/toaster/toastergui/templatetags/projecttags.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/toaster/toastergui/templatetags/projecttags.py b/lib/toaster/toastergui/templatetags/projecttags.py
index 0c0d804c0..5f6037993 100644
--- a/lib/toaster/toastergui/templatetags/projecttags.py
+++ b/lib/toaster/toastergui/templatetags/projecttags.py
@@ -24,3 +24,8 @@ register = template.Library()
@register.simple_tag
def time_difference(start_time, end_time):
return end_time - start_time
+
+@register.filter(name = 'timespent')
+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)