feat(people): Display activites and data on profile

See #10
This commit is contained in:
James Graham
2020-02-25 10:47:56 +00:00
parent 224bce9853
commit d733b6db63

View File

@@ -10,17 +10,54 @@
</ol> </ol>
</nav> </nav>
<h1>{{ person }}</h1>
<dl>
{% if person.gender %}
<dt>Gender</dt>
<dd>{{ person.get_gender_display }}</dd>
{% endif %}
{% if person.age_group %}
<dt>Age Group</dt>
<dd>{{ person.get_age_group_display }}</dd>
{% endif %}
{% if person.nationality %}
<dt>Nationality</dt>
<dd>{{ person.nationality.name }}</dd>
{% endif %}
{% if person.country_of_residence %}
<dt>Country of Residence</dt>
<dd>{{ person.country_of_residence.name }}</dd>
{% endif %}
{% if person.organisation %}
<dt>Organisation</dt>
<dd>{{ person.organisation }}</dd>
{% endif %}
{% if person.job_title %}
<dt>Job Title</dt>
<dd>{{ person.job_title }}</dd>
{% endif %}
{% if person.role %}
<dt>Role</dt>
<dd>{{ person.role }}</dd>
{% endif %}
</dl>
<a class="btn btn-success" <a class="btn btn-success"
href="{% url 'people:person.update' pk=person.pk %}">Update</a> href="{% url 'people:person.update' pk=person.pk %}">Update</a>
<hr> <hr>
<div class="row">
<div class="col-md-6">
<h2>Relationships As Source</h2> <h2>Relationships As Source</h2>
<a class="btn btn-success"
href="{% url 'people:person.relationship.create' person_pk=person.pk %}">New Relationship
</a>
<table class="table table-borderless"> <table class="table table-borderless">
<thead> <thead>
<tr> <tr>
@@ -53,6 +90,12 @@
</tbody> </tbody>
</table> </table>
<a class="btn btn-success btn-block"
href="{% url 'people:person.relationship.create' person_pk=person.pk %}">New Relationship
</a>
</div>
<div class="col-md-6">
<h2>Relationships As Target</h2> <h2>Relationships As Target</h2>
<table class="table table-borderless"> <table class="table table-borderless">
@@ -86,4 +129,36 @@
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
</div>
</div>
<hr>
<h2>Activities</h2>
<table class="table table-borderless">
<thead>
<tr>
<th>Name</th>
</tr>
</thead>
<tbody>
{% for activity in person.activities.all %}
<tr>
<td>{{ activity }}</td>
<td>
<a class="btn btn-sm btn-info"
href="{% url 'activities:activity.detail' pk=activity.pk %}">Details</a>
</td>
</tr>
{% empty %}
<tr>
<td>No records</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %} {% endblock %}