From c31f30918b6c221531535297c5604cb61849b544 Mon Sep 17 00:00:00 2001 From: Belen Barros Pena Date: Mon, 24 Nov 2014 18:30:58 +0000 Subject: bitbake: toaster: make 'latest builds' section consistent across pages Make sure that the 'latest builds' sections in the all builds page and the project page are identical: * no icon to represent build outcome * remove machine name * show date only when the build is more than 24 hours old * same date and time format (Bitbake rev: 99ac7379e5df6c5cc491c2be591b15ad7ec04caa) Signed-off-by: Belen Barros Pena Signed-off-by: Alexandru DAMIAN Signed-off-by: Richard Purdie --- bitbake/lib/toaster/toastergui/templates/mrb_section.html | 15 +++++++++++---- .../lib/toaster/toastergui/templatetags/projecttags.py | 8 ++++++++ 2 files changed, 19 insertions(+), 4 deletions(-) (limited to 'bitbake') diff --git a/bitbake/lib/toaster/toastergui/templates/mrb_section.html b/bitbake/lib/toaster/toastergui/templates/mrb_section.html index 4237980c58..33afb7ba18 100644 --- a/bitbake/lib/toaster/toastergui/templates/mrb_section.html +++ b/bitbake/lib/toaster/toastergui/templates/mrb_section.html @@ -7,7 +7,7 @@
@@ -18,16 +18,23 @@ {% endif %}
-
- {%if build.outcome == build.SUCCEEDED%}{%elif build.outcome == build.FAILED%}{%else%}{%endif%} + +
+ {% if build.completed_on|format_build_date %} + {{ build.completed_on|date:'d/m/y H:i' }} + {% else %} + {{ build.completed_on|date:'H:i' }} + {% endif %} +
{%if build.outcome == build.SUCCEEDED or build.outcome == build.FAILED %}
{% if build.errors_no %} diff --git a/bitbake/lib/toaster/toastergui/templatetags/projecttags.py b/bitbake/lib/toaster/toastergui/templatetags/projecttags.py index 99fd4cf287..f564edfe49 100644 --- a/bitbake/lib/toaster/toastergui/templatetags/projecttags.py +++ b/bitbake/lib/toaster/toastergui/templatetags/projecttags.py @@ -268,3 +268,11 @@ def get_dict_value(dictionary, key): return dictionary[key] except (KeyError, IndexError): return '' + +@register.filter +def format_build_date(completed_on): + now = timezone.now() + delta = now - completed_on + + if delta.days >= 1: + return True -- cgit v1.2.3-54-g00ecf