From 122273496a24c4608de776978b1b449d9c6cde09 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sat, 8 Nov 2014 14:04:31 -0600 Subject: Make delay a property, not a function And re-indent the URL details log template now that we've broken it out. Signed-off-by: Dan McGee --- mirrors/models.py | 1 + templates/mirrors/url_details_logs.html.jinja | 54 +++++++++++++-------------- 2 files changed, 28 insertions(+), 27 deletions(-) diff --git a/mirrors/models.py b/mirrors/models.py index 820f3328..9743d177 100644 --- a/mirrors/models.py +++ b/mirrors/models.py @@ -165,6 +165,7 @@ class MirrorLog(models.Model): is_success = models.BooleanField(default=True) error = models.TextField(blank=True, default='') + @property def delay(self): if self.last_sync is None: return None diff --git a/templates/mirrors/url_details_logs.html.jinja b/templates/mirrors/url_details_logs.html.jinja index 8f7c5644..09742f76 100644 --- a/templates/mirrors/url_details_logs.html.jinja +++ b/templates/mirrors/url_details_logs.html.jinja @@ -1,28 +1,28 @@ -

Check Logs

+

Check Logs

- - - - - - - - - - - - - - - {% for log in logs %} - - - - - - - - - {% endfor %} - -
Check TimeCheck LocationCheck IPLast SyncDelay (hh:mm)Duration (s)Success?Error Message
{{ log.check_time|date('Y-m-d H:i') }}{{ country_flag(log.location.country) }}{{ log.location.country.name }}{{ log.location.source_ip }}{{ log.last_sync|date('Y-m-d H:i') }}{{ log.delay()|duration }}{{ log.duration|floatvalue }}{{ log.is_success|yesno|capfirst }}{{ log.error|linebreaksbr }}
+ + + + + + + + + + + + + + + {% for log in logs %} + + + + + + + + + {% endfor %} + +
Check TimeCheck LocationCheck IPLast SyncDelay (hh:mm)Duration (s)Success?Error Message
{{ log.check_time|date('Y-m-d H:i') }}{{ country_flag(log.location.country) }}{{ log.location.country.name }}{{ log.location.source_ip }}{{ log.last_sync|date('Y-m-d H:i') }}{{ log.delay|duration }}{{ log.duration|floatvalue }}{{ log.is_success|yesno|capfirst }}{{ log.error|linebreaksbr }}
-- cgit v1.2.3-2-g168b