{% extends 'base.html' %}

{% block content %}
    <h1 style="margin-bottom:30px;">User {{ object }}
        <span class="pull-right">
            <a class="btn btn-primary" href="{% url 'accounts_user_change' object.pk %}">Edit User</a>
            <a class="btn btn-danger" href="{% url 'accounts_user_delete' object.pk %}">Delete User</a>
        </span>
    </h1>

    <div class="row">
        <div class="col-md-6">
            <div class="well">
                <legend>Stats</legend>
                <dl class="dl-horizontal">
                    <dt>Name</dt>
                    <dd>{{ object.first_name }} {{ object.last_name }}</dd>
                    <dt>Status</dt>
                    <dd>{{ object.is_active|yesno:"Active,Disabled" }}</dd>
                    <dt>User Level</dt>
                    <dd>{{ object.group_strigify }}</dd>
                    <dt>Theme</dt>
                    <dd>{{ object.template|default:"Default" }}</dd>
                    <dt>Last Sign In</dt>
                    <dd>{{ object.last_login }}</dd>
                </dl>
            </div>
        </div>
        <div class="col-md-6">
            <div class="well">
                <fieldset>
                    <legend>Recent Deployments</legend>
                    {% for deployement in object.deployment_set.all %}
                        <p>{{ deployement.stage.project }} - {{ deployement.stage }}</p>
                    {% empty %}
                        <p>No deployments.</p>
                    {% endfor %}
                </fieldset>
            </div>
        </div>
    </div>
{% endblock content %}