{% extends "one_column_body.html" %}
{% import "macros.html" as macros %}
<!-- user_edit.html -->
{% block title %}{% spaceless %}{% trans %}Edit user profile{% endtrans %}{% endspaceless %}{% endblock %}
{% block content %}
<h1 class="section-title">
    {{ request.user.username|escape }} - {% trans %}edit profile{% endtrans %}
</h1>
<div class='avatar'>
    {{ macros.gravatar(view_user, 128) }}
    {% if request.user.pk == view_user.pk %}
        <p><a
            {% if support_custom_avatars %}
                href="{% url askbot_avatar_show_list view_user.pk %}"
            {% else %}
                href="{% url faq %}#gravatar"
            {% endif %}
        >{% trans %}change picture{% endtrans %}</a></p>
    {% endif %}
</div>
<form name="" action="{% url edit_user view_user.id %}" method="post">{% csrf_token %}
    <table class="user-details">
        <tr>
            <td><label for="id_username">{% trans %}Screen Name{% endtrans %}:<label></td>
            <td>
                {% if settings.EDITABLE_SCREEN_NAME %}
                    {{ form.username }}
                    <span class="form-error"> {{ form.username.errors }} </span>
                {% else %}
                    {{ view_user.username|escape }}
                {% endif %}
            </td>
        </tr>
        <tr>
            <td>
                {{ form.email.label_tag() }}:
            </td>
            <td>
                {% if settings.EDITABLE_EMAIL %}
                    {{ form.email }}
                    <span class="form-error">{{ form.email.errors }}</span>
                {% else %}
                    {{ view_user.email }}
                    {% trans %}(cannot be changed){% endtrans %}
                {% endif %}
            </td>
        </tr>
        <tr>
            <td>{{ form.realname.label_tag() }}:</td>
            <td>{{ form.realname }} <span class="form-error"> {{ form.realname.errors }} </span></td>
        </tr>
        <tr>
            <td>{{ form.website.label_tag() }}:</td>
            <td>{{ form.website }} <span class="form-error"> {{ form.website.errors }} </span></td>
        </tr>
        <tr>
            <td>{{ form.city.label_tag() }}:</td>
            <td>{{ form.city }} <span class="form-error"> {{ form.city.errors }} </span></td>
        </tr>
        <tr>
            <td>{{ form.country.label_tag() }}:</td>
            <td>{{ form.country }} <span class="form-error"> {{ form.country.errors }} </span></td>
        </tr>
        <tr>
            <td>{{ form.show_country.label_tag() }}:</td>
            <td>{{ form.show_country }} <span class="form-error"> {{ form.show_country.errors }} </span></td>
        </tr>
        <tr>
            <td>{{ form.birthday.label_tag() }}:</td>
            <td>{{ form.birthday }} <span class="form-error"> {{ form.birthday.errors }} </span></td>
        </tr>
        <tr>
            <td></td>
            <td class="title-desc">{{ form.birthday.help_text }}</td>
        </tr>
        <tr>
            <td class="about-label">{{ form.about.label_tag() }}:</td>
            <td>{{ form.about }} <span class="form-error"> {{ form.about.errors }} </span></td>
        </tr>
        {% if marked_tags_setting == 'when-user-wants' %}
        <tr>
            <td>{{ form.show_marked_tags.label_tag() }}:</td>
            <td>{{ form.show_marked_tags }}
                <span class="form-error">{{ form.show_marked_tags.errors }}</span>
            </td>
        </tr>
        {% endif %}
    </table>
    <input type="submit" value="{% trans %}Update{% endtrans %}"/>
    <input id="cancel" type="button" value="{% trans %}Cancel{% endtrans %}"/>
</form>
{% endblock %}
{% block endjs %}
    <script type="text/javascript">
        $().ready(function(){
            $("#nav_profile").attr('className',"on");
            $("#cancel").bind('click', function(){history.go(-1);})
        });
    </script>
    {% block userjs %}
    {% endblock %}
{% endblock %}
<!-- end user_edit.html -->
