--- a/candolint/models.py Wed Jun 15 23:49:22 2016 +0800
+++ b/candolint/models.py Thu Jun 16 07:31:39 2016 +0800
def get_url(self, request=None):
return '{}/{}'.format(self.project.get_url(request), self.ordinal)
+ def get_duration(self):
+ d = self.finished - self.started
+ minutes, seconds = divmod(int(d.total_seconds()), 60)
+ return '{} min {} sec'.format(minutes, seconds)
+ return '{} sec'.format(seconds)
--- a/templates/check.html Wed Jun 15 23:49:22 2016 +0800
+++ b/templates/check.html Thu Jun 16 07:31:39 2016 +0800
<dd>{% module Time(check.finished) %}</dd>
- <dd>{{ check.finished - check.started }}</dd>
+ <dd>{{ check.get_duration() }}</dd>
<div class="uk-width-medium-2-3">
--- a/templates/index.html Wed Jun 15 23:49:22 2016 +0800
+++ b/templates/index.html Thu Jun 16 07:31:39 2016 +0800
<td>{{ change.rev }}:{{ change.node[:12] }} {{ change.branch }}</td>
<td>{% module Time(check.started) %}</td>
<td>{% module Time(check.finished) %}</td>
- <td>{{ check.finished - check.started }}</td>
+ <td>{{ check.get_duration() }}</td>
--- a/templates/project.html Wed Jun 15 23:49:22 2016 +0800
+++ b/templates/project.html Thu Jun 16 07:31:39 2016 +0800
<td>{% module Time(check.started) %}</td>
<td>{% module Time(check.finished) %}</td>
- <td>{{ check.finished - check.started }}</td>
+ <td>{{ check.get_duration() }}</td>