{% extends 'pybb/base.html' %}
{% load i18n thumbnail pybb_tags %}

{% block title %}{% trans "Profile editing" %}{% endblock title %}

{% block content %}
    <h1>{% trans "Profile editing" %}</h1>
    <div class="avatar">
    {% thumbnail form.instance.avatar "80x80" as avatar %}
        <img src="{{ avatar.url }}" alt="avatar">
    {% empty %}
        <img src="{{ PYBB_DEFAULT_AVATAR_URL }}" alt="avatar">
    {% endthumbnail %}
    </div>
    <p><a href="{% url auth_password_change %}">{% trans "Change the password" %}</a></p>
    <form method="post" enctype="multipart/form-data" class="profile-edit">
        {% csrf_token %}
        <fieldset>
            <legend>{% trans "Profile editing" %}</legend>
            {{ form.as_p }}
            <p>
            {% if PYBB_BUTTONS.save %}
                <input type='image' src="{{ STATIC_URL }}{{ PYBB_BUTTONS.save }}" alt='{% trans "Save" %}'>
            {% else %}
               <input type="submit" value="{% trans 'Save' %}" />
            {% endif %}
            </p>
        </fieldset>
    </form>
    <h1>{% trans "Subscriptions on topics" %}</h1>
    <ul>
        {% for sub in user.subscriptions.all %}
            <li>
                {% pybb_link sub %}
                &mdash;
                <strong>
                    <a href="{% url pybb:delete_subscription sub.id %}">{% trans "delete" %}</a>
                </strong>
            </li>
        {% endfor %}
    </ul>
{% endblock content %}
