{% extends "admin/change_form.html" %}
{% load i18n admin_static admin_modify %}
{% load url from future %}
{% load admin_urls %}

{% block extrastyle %}
    {{ block.super }}
    <style type="text/css">
    #map_canvas {
        width:722px;
        height:300px;
    }
    .buttonHolder {
        width:722px;
    }
    #remove_geo {
        float: right;
    }
    </style>
{% endblock %}

{% block field_sets %}
    {% for fieldset in adminform %}
        {% include "admin/includes/fieldset.html" %}
        {% if forloop.counter == 2 %}
            <fieldset class="module aligned">
                <h2>{% trans "Mapa" %}</h2>
                <div class="form-row">
                    <div id="map_canvas">
                        <!-- MAPY GOOGLE BĘDĄ WSTAWIANE TUTAJ DYNAMICZNIE -->
                    </div>
                    <ul id="map_locations"></ul>
                    <div class="buttonHolder">
                        <button id="locate_address" type="button" class="secondaryAction">{% trans "Znajdź adres" %}</button>&nbsp;
                        <button id="remove_geo" type="button" class="secondaryAction">{% trans "Usuń z mapy" %}</button>
                    </div>
                </div>
            </fieldset>
        {% endif %}
    {% endfor %}
    <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
    <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&amp;language=pl&amp;region=PL"></script>
    <script type="text/javascript" src="{{ STATIC_URL }}site/js/locating.js"></script>
{% endblock %}

