Commit 505b792c authored by Stauros Kroustouris's avatar Stauros Kroustouris

add route details url

parent 62153a86
......@@ -581,6 +581,9 @@ class Route(models.Model):
def junos_name(self):
return create_junos_name(self)
def get_absolute_url(self):
return reverse('route-details', kwargs={'route_slug': self.name})
def send_message(msg, user):
# username = user.username
......
......@@ -186,7 +186,8 @@ def build_routes_json(groutes):
for r in groutes:
rd = {}
rd['id'] = r.pk
rd['name'] = r.name
# name with link to rule details
rd['name'] = '<a href="%s">%s</a>' % (r.get_absolute_url(), r.name)
if not r.comments:
rd['comments'] = 'Not Any'
else:
......@@ -720,3 +721,7 @@ def lookupShibAttr(attrmap, requestMeta):
if len(requestMeta[attr]) > 0:
return requestMeta[attr]
return ''
def routedetails(request, route_slug):
raise NotImplementedError
......@@ -63,7 +63,7 @@
<div class="timeline-panel">
<div class="timeline-heading">
<h4 class="timeline-title">{{route.name}}</h4>
<h4 class="timeline-title"><a href="{{ route.get_absolute_url }}">{{route.name}}</a></h4>
<p>
<small class="text-muted"><i class="fa fa-pencil-square-o"></i> {% trans "Last update" %}: {{route.last_updated}} {% trans "by" %} {{route.applier}}</small>
</p>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment