From a8ceba34299cca271ddf433bf7618aa98e56cc36 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Mon, 1 Sep 2014 16:16:44 -0500 Subject: Add details link to mirror status page Signed-off-by: Dan McGee --- mirrors/models.py | 13 ++++++++----- templates/mirrors/status.html | 4 +++- templates/mirrors/status_table.html | 2 ++ templates/mirrors/url_details.html | 4 ++++ 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/mirrors/models.py b/mirrors/models.py index 4113222..e360801 100644 --- a/mirrors/models.py +++ b/mirrors/models.py @@ -75,6 +75,12 @@ class MirrorUrl(models.Model): created = models.DateTimeField(editable=False) active = models.BooleanField(default=True) + class Meta: + verbose_name = 'mirror URL' + + def __unicode__(self): + return self.url + def address_families(self): hostname = urlparse(self.url).hostname info = socket.getaddrinfo(hostname, None, 0, socket.SOCK_STREAM) @@ -101,11 +107,8 @@ class MirrorUrl(models.Model): self.has_ipv4 = False self.has_ipv6 = False - def __unicode__(self): - return self.url - - class Meta: - verbose_name = 'mirror URL' + def get_absolute_url(self): + return '/mirrors/%s/%d/' % (self.mirror.name, self.pk) class MirrorRsync(models.Model): diff --git a/templates/mirrors/status.html b/templates/mirrors/status.html index e97ad4b..24408be 100644 --- a/templates/mirrors/status.html +++ b/templates/mirrors/status.html @@ -80,7 +80,9 @@