fix: add organisation relationships to profile

Resolves #92
This commit is contained in:
James Graham
2021-03-09 12:39:20 +00:00
parent e457086c50
commit 6670a87a52

View File

@@ -1,36 +1,71 @@
<h2>People I've Answered Questions About</h2>
<div class="row">
<div class="col-lg-6">
<h2>People I've Answered Questions About</h2>
<table class="table table-borderless">
<thead>
<tr>
<th>Contact Name</th>
<th></th>
</tr>
</thead>
<table class="table table-borderless">
<thead>
<tr>
<th>Contact Name</th>
<th></th>
</tr>
</thead>
<tbody>
{% for relationship in person.relationships_as_source.all %}
<tr>
<td>{{ relationship.target }}</td>
<td>
<a class="btn btn-sm btn-info"
href="{% url 'people:person.detail' pk=relationship.target.pk %}">Profile</a>
<a class="btn btn-sm btn-info"
href="{% url 'people:relationship.detail' pk=relationship.pk %}">Relationship Detail</a>
<a class="btn btn-sm btn-success"
href="{% url 'people:relationship.update' relationship_pk=relationship.pk %}">Update</a>
</td>
</tr>
<tbody>
{% for relationship in person.relationships_as_source.all %}
<tr>
<td>{{ relationship.target }}</td>
<td>
<a class="btn btn-sm btn-info"
href="{% url 'people:person.detail' pk=relationship.target.pk %}">Profile</a>
<a class="btn btn-sm btn-info"
href="{% url 'people:relationship.detail' pk=relationship.pk %}">Relationship Detail</a>
<a class="btn btn-sm btn-success"
href="{% url 'people:relationship.update' relationship_pk=relationship.pk %}">Update</a>
</td>
</tr>
{% empty %}
<tr>
<td colspan="2">No known relationships</td>
</tr>
{% empty %}
<tr>
<td colspan="2">No known relationships</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endfor %}
</tbody>
</table>
</div>
<a class="btn btn-success"
href="{% url 'people:person.relationship.create' person_pk=person.pk %}">New Relationship
</a>
<div class="col-lg-6">
<h2>Organisations I've Answered Questions About</h2>
<table class="table table-borderless">
<thead>
<tr>
<th>Organisation Name</th>
<th></th>
</tr>
</thead>
<tbody>
{% for relationship in person.organisation_relationships_as_source.all %}
<tr>
<td>{{ relationship.target }}</td>
<td>
<a class="btn btn-sm btn-info"
href="{% url 'people:organisation.detail' pk=relationship.target.pk %}">Profile</a>
<a class="btn btn-sm btn-info"
href="{% url 'people:organisation.relationship.detail' pk=relationship.pk %}">Relationship Detail</a>
<a class="btn btn-sm btn-success"
href="{% url 'people:organisation.relationship.update' relationship_pk=relationship.pk %}">Update</a>
</td>
</tr>
{% empty %}
<tr>
<td colspan="2">No known relationships</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>