1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-09 17:39:31 +00:00

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>
This commit is contained in:
Belen Barros Pena
2014-11-24 18:30:58 +00:00
committed by Richard Purdie
parent be2475b409
commit c31f30918b
2 changed files with 19 additions and 4 deletions
@@ -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 %}
@@ -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