{% extends "base.html" %}
{% load static %}
{% load i18n %}
{% load leaflet_tags %}
{% load geojson_tags %}

{% block extra-head %}
  {% leaflet_js %}
  {% leaflet_css %}
  <style>
    .leaflet-container {  /* all maps */
      height: 600px;
    }
  </style>
{% endblock extra-head %}

{% block content %}
  <details>
    <summary style="font-size: 1.875em;">{% trans "All drawings" %}</summary>
    <ul>
      <li>
        <a href="/admin/djeocad/drawing/add/">
          {% trans "Add drawing" %}
        </a>
      </li>
      {% if unreferenced %}
        {% for unref in unreferenced %}
          <li>
            <a href="/admin/djeocad/drawing/{{ unref.id }}/change/">
              {% trans "Unreferenced drawing" %}: {{ unref.title }}
            </a>
          </li>
        {% endfor %}
      {% endif %}
    </ul>
  </details>
  <script id="marker_data" type="application/json">{{ object_list|geojsonfeature:"popupContent"|safe }}</script>
  {% include "djeocad/map_data.html" %}
  <script src="{% static 'djeocad/js/map_script.js'%}"></script>
  <div>
    {% leaflet_map "mymap" callback="window.map_init" %}
  </div>
{% endblock content %}
