summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBelen Barros Pena <belen.barros.pena@linux.intel.com>2014-11-24 18:30:58 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-11-28 14:02:59 +0000
commitc31f30918b6c221531535297c5604cb61849b544 (patch)
tree80a51be42765ebf6befb68cc05c8f51cb283fece
parentbe2475b409ce4d959cba9dbde56f3e3de903a94a (diff)
downloadast2050-yocto-poky-c31f30918b6c221531535297c5604cb61849b544.zip
ast2050-yocto-poky-c31f30918b6c221531535297c5604cb61849b544.tar.gz
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 <belen.barros.pena@linux.intel.com> Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/toaster/toastergui/templates/mrb_section.html15
-rw-r--r--bitbake/lib/toaster/toastergui/templatetags/projecttags.py8
2 files changed, 19 insertions, 4 deletions
diff --git a/bitbake/lib/toaster/toastergui/templates/mrb_section.html b/bitbake/lib/toaster/toastergui/templates/mrb_section.html
index 4237980..33afb7b 100644
--- a/bitbake/lib/toaster/toastergui/templates/mrb_section.html
+++ b/bitbake/lib/toaster/toastergui/templates/mrb_section.html
@@ -7,7 +7,7 @@
<div class="page-header top-air">
<h1>
- Latest Builds
+ Latest builds
</h1>
</div>
<div id="latest-builds">
@@ -18,16 +18,23 @@
{% endif %}
<div class="row-fluid">
- <div class="span4 lead">
- {%if build.outcome == build.SUCCEEDED%}<i class="icon-ok-sign success"></i>{%elif build.outcome == build.FAILED%}<i class="icon-minus-sign error"></i>{%else%}{%endif%}
+ <div class="span3 lead">
{%if build.outcome == build.SUCCEEDED or build.outcome == build.FAILED %}
<a href="{%url 'builddashboard' build.pk%}" class="{%if build.outcome == build.SUCCEEDED %}success{%else%}error{%endif%}">
{% endif %}
- <span data-toggle="tooltip" {%if build.target_set.all.count > 1%}title="Targets: {%for target in build.target_set.all%}{{target.target}} {%endfor%}"{%endif%}>{{build.target_set.all.0.target}} {%if build.target_set.all.count > 1%}(+ {{build.target_set.all.count|add:"-1"}}){%endif%} {{build.machine}} ({{build.completed_on|naturaltime}})</span>
+ <span data-toggle="tooltip" {%if build.target_set.all.count > 1%}title="Targets: {%for target in build.target_set.all%}{{target.target}} {%endfor%}"{%endif%}>{{build.target_set.all.0.target}} {%if build.target_set.all.count > 1%}(+ {{build.target_set.all.count|add:"-1"}}){%endif%}
+ </span>
{%if build.outcome == build.SUCCEEDED or build.outcome == build.FAILED %}
</a>
{% endif %}
</div>
+ <div class="span2 lead">
+ {% if build.completed_on|format_build_date %}
+ {{ build.completed_on|date:'d/m/y H:i' }}
+ {% else %}
+ {{ build.completed_on|date:'H:i' }}
+ {% endif %}
+ </div>
{%if build.outcome == build.SUCCEEDED or build.outcome == build.FAILED %}
<div class="span2 lead">
{% if build.errors_no %}
diff --git a/bitbake/lib/toaster/toastergui/templatetags/projecttags.py b/bitbake/lib/toaster/toastergui/templatetags/projecttags.py
index 99fd4cf..f564edf 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
OpenPOWER on IntegriCloud