feat(people): Add detail views for Person and Relationship

This commit is contained in:
James Graham
2020-02-18 14:38:41 +00:00
parent 026fc10999
commit 4b2abd5d6c
6 changed files with 161 additions and 0 deletions

View File

@@ -0,0 +1,78 @@
{% extends 'base.html' %}
{% block content %}
<h1>
<a href="#">People</a> /
{{ object }}
</h1>
<hr>
<h2>Relationships As Source</h2>
<table class="table table-borderless">
<thead>
<tr>
<th>Contact Name</th>
<th></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>
</td>
<td>
<a class="btn btn-sm btn-info"
href="{% url 'people:relationship.detail' pk=relationship.pk %}">Relationship Detail</a>
</td>
</tr>
{% empty %}
<tr>
<td colspan="2">No known relationships</td>
</tr>
{% endfor %}
</tbody>
</table>
<h2>Relationships As Target</h2>
<table class="table table-borderless">
<thead>
<tr>
<th>Contact Name</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
{% for relationship in person.relationships_as_target.all %}
<tr>
<td>{{ relationship.source }}</td>
<td>
<a class="btn btn-sm btn-info"
href="{% url 'people:person.detail' pk=relationship.source.pk %}">Profile</a>
</td>
<td>
<a class="btn btn-sm btn-info"
href="{% url 'people:relationship.detail' pk=relationship.pk %}">Relationship Detail</a>
</td>
</tr>
{% empty %}
<tr>
<td colspan="2">No known relationships</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}

View File

@@ -0,0 +1,29 @@
{% extends 'base.html' %}
{% block content %}
<h1>
<a href="#">Relationships</a> /
{{ object }}
</h1>
<hr>
<div class="row align-content-center">
<div class="col-md-6">
<h2>Source</h2>
{{ relationship.source }}
<a class="btn btn-sm btn-info"
href="{% url 'people:person.detail' pk=relationship.source.pk %}">Profile</a>
</div>
<div class="col-md-6">
<h2>Target</h2>
{{ relationship.target }}
<a class="btn btn-sm btn-info"
href="{% url 'people:person.detail' pk=relationship.target.pk %}">Profile</a>
</div>
</div>
{% endblock %}