feat(people): Display relationship answers on detail page

resolve #5
This commit is contained in:
James Graham
2020-02-20 15:24:48 +00:00
parent 5a1b043862
commit e4a50dbfa4
3 changed files with 66 additions and 5 deletions

View File

@@ -15,22 +15,55 @@
<hr>
<div class="row align-content-center">
<div class="col-md-6">
<div class="row align-content-center align-items-center">
<div class="col-md-5 text-center">
<h2>Source</h2>
{{ relationship.source }}
<p>{{ relationship.source }}</p>
<a class="btn btn-sm btn-info"
href="{% url 'people:person.detail' pk=relationship.source.pk %}">Profile</a>
</div>
<div class="col-md-6">
<div class="col-md-2 text-center">
{% if relationship.reverse %}
<a href="{% url 'people:relationship.detail' pk=relationship.reverse.pk %}">
<span class="fas fa-exchange-alt fa-5x"></span>
</a>
{% endif %}
</div>
<div class="col-md-5 text-center">
<h2>Target</h2>
{{ relationship.target }}
<p>{{ relationship.target }}</p>
<a class="btn btn-sm btn-info"
href="{% url 'people:person.detail' pk=relationship.target.pk %}">Profile</a>
</div>
</div>
<hr>
<table class="table table-borderless">
<thead>
<tr>
<th>Question</th>
<th>Answer</th>
</tr>
</thead>
<tbody>
{% for answer in relationship.question_answers.all %}
<tr>
<td>{{ answer.question }}</td>
<td>{{ answer }}</td>
</tr>
{% empty %}
<tr>
<td>No records</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}