refactor: migrate to question sets for person qs

This means we're starting to use the same system for person questions
as for relationship questions
This commit is contained in:
James Graham
2020-11-26 12:59:30 +00:00
parent a94db2713e
commit 5035b121a6
8 changed files with 304 additions and 31 deletions

View File

@@ -58,11 +58,6 @@
<dd>{{ person.job_title }}</dd>
{% endif %}
{% if person.role %}
<dt>Role</dt>
<dd>{{ person.role }}</dd>
{% endif %}
{% if person.disciplines %}
<dt>Discipline(s)</dt>
<dd>{{ person.disciplines }}</dd>
@@ -79,6 +74,33 @@
</dl>
{% endif %}
{% with person.current_answers as answer_set %}
<table class="table table-borderless">
<thead>
<tr>
<th>Question</th>
<th>Answer</th>
</tr>
</thead>
<tbody>
{% for answer in answer_set.question_answers.all %}
<tr>
<td>{{ answer.question }}</td>
<td>{{ answer }}</td>
</tr>
{% empty %}
<tr>
<td>No records</td>
</tr>
{% endfor %}
</tbody>
</table>
<p>Last updated: {{ answer_set.timestamp }}</p>
{% endwith %}
<a class="btn btn-success"
href="{% url 'people:person.update' pk=person.pk %}">Update</a>