<div class="well well-small">
<h4>
<small class="pull-right">
- {{ friendly_time(j.duration) }} ‐
+ {{ format_time(j.duration, shorter=True) }} ‐
{% module JobState(j) %}
</small>
<a href="/job/{{ j.uuid }}">{{ j.arch.name }}</a>
</td>
<td>
- {{ friendly_time(job.duration) }}
+ {{ format_time(job.duration, shorter=True) }}
{% if job.is_running() %}
<br> <span class="muted">{{ _("ETA") }}: {{ format_eta(job.eta) }}</span>
self.format_time_short(handler, stddev),
)
- def format_time(self, handler, s):
+ def format_time(self, handler, s, shorter=False):
_ = handler.locale.translate
hrs, s = divmod(s, 3600)
if s >= 30:
min += 1
+ if shorter and not hrs:
+ return _("%(min)d min") % { "min" : min }
+
return _("%(hrs)d:%(min)02d hrs") % {"hrs" : hrs, "min" : min}
def format_time_short(self, handler, s):