Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Change service names to be full links

  • Loading branch information...
commit 57d7f934c9b4072ff9cd1fea6f4066872fba85d5 1 parent 94de094
@dcramer dcramer authored
View
4 overseer/models.py
@@ -105,8 +105,8 @@ def __unicode__(self):
def get_absolute_url(self):
return ('overseer:event', [self.pk], {})
- def get_service_names(self):
- return self.services.values_list('name', flat=True)
+ def get_services(self):
+ return self.services.values_list('slug', 'name')
def get_duration(self):
return self.date_updated - self.date_created
View
4 overseer/templates/overseer/index.html
@@ -7,7 +7,7 @@
<div class="latest-event event status-{{ latest_event.status }}">
<p>{{ latest_event.description }}</p>
<time>{{ latest_event.date_updated|timesince }} (lasted {{ latest_event.get_duration|duration }})</time>
- <span class="affects">affects {{ latest_event.get_service_names|join:", "}}</span>
+ <span class="affects">affects {% for slug, name in latest_event.get_services %}<a href="{% url overseer:service slug %}">{{ name }}</a>{% if not forloop.last %}, {% endif %}{% endfor %}</span>
</div>
{% endif %}
@@ -45,7 +45,7 @@
<li class="event status-{{ event.status }}">
<p>{{ event.description }}</p>
<time>{{ event.date_updated|timesince }}</time>
- <span class="affects">affects {{ event.get_service_names|join:", "}}</span>
+ <span class="affects">affects {% for slug, name in event.get_services %}<a href="{% url overseer:service slug %}">{{ name }}</a>{% if not forloop.last %}, {% endif %}{% endfor %}</span>
</li>
{% endfor %}
</ul>
View
2  overseer/templates/overseer/service.html
@@ -23,7 +23,7 @@
<li class="event status-{{ event.status }}">
<p>{{ event.description }}</p>
<time>{{ event.date_updated|timesince }}</time>
- <span class="affects">affects {{ event.get_service_names|join:", "}}</span>
+ <span class="affects">affects {% for slug, name in event.get_services %}<a href="{% url overseer:service slug %}">{{ name }}</a>{% if not forloop.last %}, {% endif %}{% endfor %}</span>
</li>
{% endfor %}
</ul>
Please sign in to comment.
Something went wrong with that request. Please try again.