Add conditionals to related models links. Bugfix for #41

This commit is contained in:
Tom Price
2015-03-31 10:29:48 +01:00
parent 6cdfb826f2
commit 99208f4022

View File

@@ -36,9 +36,11 @@
<dl class="dl-horizontal"> <dl class="dl-horizontal">
<dt>Person</dt> <dt>Person</dt>
<dd> <dd>
<a href="{% url 'person_detail' object.person.pk %}" class="modal-href"> {% if object.person %}
{{ object.person }} <a href="{% url 'person_detail' object.person.pk %}" class="modal-href">
</a> {{ object.person }}
</a>
{% endif %}
</dd> </dd>
<dt>Email</dt> <dt>Email</dt>
@@ -60,9 +62,11 @@
<dl class="dl-horizontal"> <dl class="dl-horizontal">
<dt>Organisation</dt> <dt>Organisation</dt>
<dd> <dd>
<a href="{% url 'organisation_detail' object.organisation.pk %}" class="modal-href"> {% if object.organisation %}
{{ object.organisation }} <a href="{% url 'organisation_detail' object.organisation.pk %}" class="modal-href">
</a> {{ object.organisation }}
</a>
{% endif %}
</dd> </dd>
<dt>Phone Number</dt> <dt>Phone Number</dt>
@@ -86,7 +90,13 @@
<div class="panel-body"> <div class="panel-body">
<dl class="dl-horizontal"> <dl class="dl-horizontal">
<dt>Event Venue</dt> <dt>Event Venue</dt>
<dd><a href="{% url 'venue_detail' object.venue.pk %}" class="modal-href">{{ object.venue }}</a></dd> <dd>
{% if object.venue %}
<a href="{% url 'venue_detail' object.venue.pk %}" class="modal-href">
{{ object.venue }}
</a>
{% endif %}
</dd>
{% if event.is_rig %} {% if event.is_rig %}
<dt>Event MIC</dt> <dt>Event MIC</dt>