{% extends "layout.html" %}
{% block title %}{{ user.username }} :: {{ config.SITE_NAME }}{% endblock %}
{% block body %}
{% from "_formhelpers.html" import render_menu_with_button %}

{% if g.user and g.user.is_moderator %}
    <h2>User Information</h2><br>
    <dl class="dl-horizontal">
        <dt>User ID:</dt>
        <dd>{{ user.id }}</dd>
        <dt>Account created on:</dt>
        <dd>{{ user.created_time }}</dd>
        <dt>Email address:</dt>
        <dd>{{ user.email }}</dd>
        <dt>User class:</dt>
        <dd>{{ level }}</dd>
        {%- if g.user.is_superadmin -%}
        <dt>Last login IP:</dt>
        <dd>{{ user.ip_string }}</dd><br>
        {%- endif -%}
    </dl>
    {% if admin_form %}
    <form method="POST">
        {{ admin_form.csrf_token }}

        <div class="form-group row">
            <div class="col-md-6">
                {{ render_menu_with_button(admin_form.user_class) }}
            </div>
        </div>
    </form>
    <br>
    {% endif %}
{% endif %}

<h3>
    Browsing {{ user.username }}'s torrents
</h3>

{% include "search_results.html" %}

{% endblock %}