Files
breccia-mapper/people/templates/people/organisation/detail.html
T
James Graham 74fffb0cac refactor: views to handled ended relationships
Add ending of organisation relationships
2021-03-19 12:41:36 +00:00

108 lines
3.1 KiB
HTML

{% extends 'base.html' %}
{% block extra_head %}
{{ map_markers|json_script:'map-markers' }}
{% load staticfiles %}
<script src="{% static 'js/map.js' %}"></script>
<script async defer src="https://maps.googleapis.com/maps/api/js?key={{ settings.GOOGLE_MAPS_API_KEY }}&callback=initMap"
type="text/javascript"></script>
{% endblock %}
{% block content %}
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="{% url 'people:organisation.list' %}">Organisations</a>
</li>
<li class="breadcrumb-item active" aria-current="page">{{ object }}</li>
</ol>
</nav>
<h1>{{ organisation }}</h1>
<hr>
<div class="row justify-content-md-center">
<div class="col-md-3">
<a class="btn btn-warning btn-block"
href="{% url 'people:organisation.update' pk=organisation.pk %}">Update Organisation</a>
</div>
<div class="col-md-3">
{% if relationship %}
<a class="btn btn-warning btn-block"
href="{% url 'people:organisation.relationship.create' organisation_pk=organisation.pk %}">Update Relationship
</a>
{% else %}
<a class="btn btn-success btn-block"
href="{% url 'people:organisation.relationship.create' organisation_pk=organisation.pk %}">New Relationship
</a>
{% endif %}
</div>
{% if relationship %}
<div class="col-md-3">
<a class="btn btn-danger btn-block"
href="{% url 'people:organisation.relationship.end' pk=relationship.pk %}">End Relationship
</a>
</div>
{% endif %}
</div>
<hr>
<table class="table table-borderless">
<thead>
<tr>
<th width="50%">Question</th>
<th>Answer</th>
</tr>
</thead>
<tbody>
{% if answer_set.website %}
<tr><td>Website</td><td>
<a href="{{ answer_set.website }}">{{ answer_set.website }}</a>
</td></tr>
{% endif %}
{% if answer_set.countries %}
<tr><td>Countries</td><td>
{% for country in answer_set.countries %}
{{ country.name }}{% if not forloop.last %},{% endif %}
{% endfor %}
</td></tr>
{% endif %}
{% if answer_set.hq_country %}
<tr><td>HQ Country</td><td>{{ answer_set.hq_country.name }}</td></tr>
{% endif %}
{% for question, answers in question_answers.items %}
<tr>
<td>{{ question }}</td>
<td>{{ answers }}</td>
</tr>
{% endfor %}
{% if answer_set is None %}
<tr>
<td colspan="2">No answers</td>
</tr>
{% endif %}
</tbody>
</table>
<p>Last updated: {{ answer_set.timestamp }}</p>
<hr>
<div id="map" style="height: 800px; width: 100%"></div>
<hr>
{% endblock %}