summaryrefslogtreecommitdiffstats
path: root/bitbake
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 /bitbake
parentbe2475b409ce4d959cba9dbde56f3e3de903a94a (diff)
downloadpoky-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>
Diffstat (limited to 'bitbake')
-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 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 @@
7 7
8 <div class="page-header top-air"> 8 <div class="page-header top-air">
9 <h1> 9 <h1>
10 Latest Builds 10 Latest builds
11 </h1> 11 </h1>
12 </div> 12 </div>
13 <div id="latest-builds"> 13 <div id="latest-builds">
@@ -18,16 +18,23 @@
18 {% endif %} 18 {% endif %}
19 19
20 <div class="row-fluid"> 20 <div class="row-fluid">
21 <div class="span4 lead"> 21 <div class="span3 lead">
22 {%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%}
23 {%if build.outcome == build.SUCCEEDED or build.outcome == build.FAILED %} 22 {%if build.outcome == build.SUCCEEDED or build.outcome == build.FAILED %}
24 <a href="{%url 'builddashboard' build.pk%}" class="{%if build.outcome == build.SUCCEEDED %}success{%else%}error{%endif%}"> 23 <a href="{%url 'builddashboard' build.pk%}" class="{%if build.outcome == build.SUCCEEDED %}success{%else%}error{%endif%}">
25 {% endif %} 24 {% endif %}
26 <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> 25 <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%}
26 </span>
27 {%if build.outcome == build.SUCCEEDED or build.outcome == build.FAILED %} 27 {%if build.outcome == build.SUCCEEDED or build.outcome == build.FAILED %}
28 </a> 28 </a>
29 {% endif %} 29 {% endif %}
30 </div> 30 </div>
31 <div class="span2 lead">
32 {% if build.completed_on|format_build_date %}
33 {{ build.completed_on|date:'d/m/y H:i' }}
34 {% else %}
35 {{ build.completed_on|date:'H:i' }}
36 {% endif %}
37 </div>
31 {%if build.outcome == build.SUCCEEDED or build.outcome == build.FAILED %} 38 {%if build.outcome == build.SUCCEEDED or build.outcome == build.FAILED %}
32 <div class="span2 lead"> 39 <div class="span2 lead">
33 {% if build.errors_no %} 40 {% 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):
268 return dictionary[key] 268 return dictionary[key]
269 except (KeyError, IndexError): 269 except (KeyError, IndexError):
270 return '' 270 return ''
271
272@register.filter
273def format_build_date(completed_on):
274 now = timezone.now()
275 delta = now - completed_on
276
277 if delta.days >= 1:
278 return True