2020-02-24 22:28:52 +00:00
|
|
|
{% extends 'program_base.html' %}
|
|
|
|
{% load leaflet_tags %}
|
2020-03-28 10:45:54 +00:00
|
|
|
{% load static %}
|
2020-02-24 22:28:52 +00:00
|
|
|
|
|
|
|
{% block extra_head %}
|
|
|
|
{% leaflet_css %}
|
2020-03-28 10:45:54 +00:00
|
|
|
<script src="{% static 'js/leaflet-1.6.0.js' %}" type="text/javascript"></script>
|
|
|
|
<script src="{% static 'js/proj4.js' %}" type="text/javascript"></script>
|
|
|
|
<script src="{% static 'js/proj4leaflet.js' %}" type="text/javascript"></script>
|
|
|
|
<script src="{% static 'js/leaflet-color-markers.js' %}" type="text/javascript"></script>
|
2020-02-24 22:28:52 +00:00
|
|
|
{% endblock extra_head %}
|
|
|
|
|
|
|
|
{% block title %}
|
|
|
|
{{ facility.name }} - Facilities | {{ block.super }}
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block content %}
|
|
|
|
<div class="panel panel-default">
|
|
|
|
<div class="panel-heading">
|
|
|
|
<h3 class="panel-title">{{ facility.facility_type.name }}: {{ facility.name }}</h3>
|
|
|
|
</div>
|
|
|
|
<div class="panel-body">
|
2020-03-28 10:45:54 +00:00
|
|
|
<p class="lead">
|
|
|
|
<i class="{{ facility.facility_type.icon }} fa-2x fa-pull-left fa-fw"></i> {{ facility.name }} {{ facility.description }}</p>
|
2020-02-24 22:28:52 +00:00
|
|
|
{% if request.user.is_authenticated %}
|
|
|
|
<a href="{% url "facilities:facility_feedback" camp_slug=camp.slug facility_type_slug=facilitytype.slug facility_uuid=facility.uuid %}" class="btn btn-primary"><i class="fas fa-comment-dots"></i> Submit Feedback</a>
|
|
|
|
{% endif %}
|
|
|
|
<a href="{% url "facilities:facility_list" camp_slug=camp.slug facility_type_slug=facilitytype.slug %}" class="btn btn-primary"><i class="fas fa-list"></i> Back to {{ facilitytype.name }} list</a>
|
2020-03-28 10:45:54 +00:00
|
|
|
<p>
|
|
|
|
<div id="map" class="map"></div>
|
2020-02-24 22:28:52 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
2020-03-28 10:45:54 +00:00
|
|
|
function MapReadyCallback() {
|
|
|
|
// add a marker for this facility
|
2020-02-24 22:28:52 +00:00
|
|
|
{% url "facilities:facility_feedback" camp_slug=facility.camp.slug facility_type_slug=facility.facility_type.slug facility_uuid=facility.uuid as feedback %}
|
2020-03-28 10:45:54 +00:00
|
|
|
var marker = L.marker([{{ facility.location.y }}, {{ facility.location.x }}])
|
|
|
|
marker.bindPopup("<b>{{ facility.name }}</b><br><p>{{ facility.description }}</p><p>Responsible team: {{ facility.facility_type.responsible_team.name }} Team</p>{% if request.user.is_authenticated %}<p><a href='{{ feedback }}' class='btn btn-primary' style='color: white;'><i class='fas fa-comment-dots'></i> Feedback</a></p>{% endif %}").addTo(this);
|
|
|
|
// max zoom since we have only one marker
|
|
|
|
this.setView(marker.getLatLng(), 13);
|
|
|
|
};
|
2020-02-24 22:28:52 +00:00
|
|
|
</script>
|
|
|
|
|
2020-03-28 10:45:54 +00:00
|
|
|
<script src="{% static 'js/kfmap.js' %}" type="text/javascript"></script>
|
|
|
|
|
2020-02-24 22:28:52 +00:00
|
|
|
{% endblock %}
|
|
|
|
|