{% extends "userprofile/base_2col.html" %}
{% load i18n %}

{% block title %}{% blocktrans %}{{ user }}'s Dashboard{% endblocktrans %}{% endblock %}
{% block robots %}noindex,nofollow{% endblock %}

{% block extrajs %}
	{% if GOOGLE_MAPS_API_KEY %}
	<script type="text/javascript" src="{{ STATIC_URL }}userprofile/js/jquery.location.js"></script>
	{% endif %}
{% endblock %}

{% block userprofile_navigation %}
{% include "userprofile/menu.html" %}
{% endblock %}

{% block userprofile_content %}
	<form action="{% url profile_edit_location %}" method="post" enctype="multipart/form-data">
	{{ form.errors }}
	<fieldset>
		<legend>{% trans "Define your location" %}{% if geoip %} (<a href="?ip=1">{% trans "Auto-discover location" %}</a>){% endif %}</legend>
		<label for="id_country">{% trans "Country" %}<img class="hide loading" alt="{% trans "Loading..." %}" src="{{ STATIC_URL }}userprofile/images/loading.gif" /></label>
		<p>{{ form.country }}</p>
		{% if GOOGLE_MAPS_API_KEY %}
			<div class="mapinfo">
				<p><label>{% trans "Location:" %}</label> <span id="location_info">{{ form.instance.location }}</span></p>
				<label for="map">{% trans "Position" %}</label>
				<div id="map"></div>
			</div>
			<div class="hide">{{ form.location }}{{ form.latitude }}{{ form.longitude }}</div>
			<input type='hidden' name='_apikey' id="google_maps_apikey" value="{{ GOOGLE_MAPS_API_KEY }}" />
			<input type='hidden' name='_fetch_geodata_url' id="fetch_geodata_url" value="{% url profile_geocountry_info 0 0  %}" />
		{% endif %}
	</fieldset>
	<p><input type="submit" value="{% trans 'Save' %}" /></p>
	</form>
{% endblock %}
{% block userprofile_content_related %}
<div class="box">
  <h3>{% trans "Location information" %}</h3>
    <p>{% trans "Define your location information." %}</p>
</div>
{% endblock %}
