]> git.ipfire.org Git - people/jschlag/pbs.git/commitdiff
Change format of build time.
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 17 Feb 2013 17:36:07 +0000 (18:36 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 17 Feb 2013 17:36:07 +0000 (18:36 +0100)
data/templates/modules/jobs/boxes.html
data/templates/modules/jobs/list.html
web/__init__.py

index 4f7f0cfcb7d43cf81b390a2105023def66078d84..21c2534417f1b1d8a89cce2db23f4309cbe3364d 100644 (file)
@@ -3,7 +3,7 @@
                <div class="well well-small">
                        <h4>            
                                <small class="pull-right">
-                                       {{ friendly_time(j.duration) }} &dash;
+                                       {{ format_time(j.duration, shorter=True) }} &dash;
                                        {% module JobState(j) %}
                                </small>
                                <a href="/job/{{ j.uuid }}">{{ j.arch.name }}</a>
index d48b58e9b0218de6bd7aab5c6fb1f686a4f90d3a..60127e9cafec77da165d739af1e29df88ad0e7e5 100644 (file)
@@ -46,7 +46,7 @@
                                </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>
index b40e5f27eaf67064eab760a2d65e4923a81c9b8b..3a493703867d13e33ae472e0b7bb5db8b705a9ad 100644 (file)
@@ -313,7 +313,7 @@ class Application(tornado.web.Application):
                        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)
@@ -322,6 +322,9 @@ class Application(tornado.web.Application):
                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):