{% extends 'userena/base_userena.html' %}
{% load i18n %}
{% load addons %}

{% block title %}{% trans "Account setup" %}{% endblock %}

{% block extrajs %}
    {{ block.super }}
    <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?libraries=places&sensor=false"></script>

{% endblock %}

{% block userena_header %}<h3 class="userena-header">{% trans "Edit Profile" %}</h3>{% endblock %}

{% block userena_content %}

  <form class="tx-form dual" action="" enctype="multipart/form-data" method="post">
    {% csrf_token %}
	  <fieldset>
      {% for field in form %}
        <div class="tx-form-field">
          {{ field.label_tag }}
          {{ field }}
          {{ field.errors }}
        </div>
      {% endfor %}
	  </fieldset>
    <input type="submit" class="i16 tick buttonized" value="{% trans 'Save changes' %}" />
  </form>


<script type="text/javascript">
$(document).ready(function() {
    var defaultBounds = new google.maps.LatLngBounds(
        new google.maps.LatLng(-33.8902, 151.1759),
        new google.maps.LatLng(-33.8474, 151.2631)
    );

    var input = document.getElementById('id_location');
    var options = {
        bounds: defaultBounds
    };

    autocomplete = new google.maps.places.Autocomplete(input, options);

    $('#id_location').keypress(function(event) {
        if(event.which == 13)
            event.preventDefault();
    });
});
</script>
{% endblock %}

