{% extends "base.html" %}
{% load url from future %}
{% load i18n %}
{% load translations %}

{% block content %}

{% if form.errors or userform.errors or subscriptionform.errors %}
<div class="ui-widget">
    <div style="padding: 0pt 0.7em;" class="ui-state-error ui-corner-all"> 
        <p><span style="float: left; margin-right: 0.3em;" class="ui-icon ui-icon-alert"></span>
        {% trans "Please fix errors in the form." %}
        </p>
    </div>
</div>
{% endif %}

<form method="post" action="{% url 'weblate.accounts.views.profile' %}">
{% csrf_token %}
<div class="tabs" id="tabs-preferences">
<ul>
<li><a href="#preferences">{% trans "Preferences" %}</a></li>
<li><a href="#subscriptions">{% trans "Subscriptions" %}</a></li>
<li><a href="#account">{% trans "Account" %}</a></li>
<li><a href="#password">{% trans "Password" %}</a></li>
<li><a href="#info">{% trans "Information" %}</a></li>
<li><a href="#avatar">{% trans "Avatar" %}</a></li>
</ul>
<div id="preferences">
<table>
{{ form.as_table }}
</table>
</div>
<div id="subscriptions">
<p>{% trans "You will receive chosen notifications via email for all your languages." %}</p>
<table>
{{ subscriptionform.as_table }}
</table>
</div>
<div id="account">
<table>
{{ userform.as_table }}
</table>
<span class="helptext">{% trans "Your name and email will appear as author on Git commits." %}</span>
</div>
<div id="password">
{% url 'django.contrib.auth.views.password_change' as pw_url %}
{% blocktrans %}You can change password on <a href="{{ pw_url }}">separate page</a>.{% endblocktrans %}
</div>
<div id="info">
<table>
<tr>
<th>{% trans "Suggestions made" %}</th>
<td>{{ profile.suggested }}</td>
</tr>
<tr>
<th>{% trans "Translations made" %}</th>
<td>{{ profile.translated }}</td>
</tr>
<tr>
<th>{% trans "Last login" %}</th>
<td>{{ request.user.last_login|date:"DATETIME_FORMAT" }}</td>
</tr>
<tr>
<th>{% trans "Registration date" %}</th>
<td>{{ request.user.date_joined|date:"DATETIME_FORMAT" }}</td>
</tr>
</table>
</div>
<div id="avatar">
<p>{% gravatar request.user 128 %}</p>
<p><a href="http://gravatar.com/emails/">{% trans "Change your avatar at gravatar.com" %}</a></p>
</div>
</div>

<input type="submit" value="{% trans "Save" %}" class="button" />
</form>

{% endblock %}
