{% extends "base.html" %}

{% block title %} | Superuser tools{% endblock %}

{% block main %}
<div class="page-header">
    <div class="container">
        <div class="row">
            <div class="col-sm-12">
                <h1>Superuser tools</h1>
            </div>
        </div>

    </div>
</div>


<div class="container">
    {% include 'snippets/messages.html' %}
    <div class="row">
        <div class="col-md-4">
            <div class="panel panel-default">
                <div class="list-group">
                    <a href="{% url 'admin:superuser_index' %}" class="list-group-item">Platform settings</a>
                    <a href="{% url 'admin:superuser_projects' %}" class="list-group-item">Manage all projects</a>
                    <a href="{% url 'admin:superuser_manage_users' %}" class="list-group-item active">Add + remove super users</a>
                </div>
            </div>
        </div>

        <div class="col-sm-8" id="members">
            <div class="header">
                <div class="row">
                    <div class="col-sm-6"><h3>Add + remove super users</h3></div>
                    <div class="col-sm-6 dropdown">
                        <input type="text" id="find-users" class="pull-right form-control" placeholder="Search for users to add to the group">
                        <ul class="dropdown-menu type-away">
                            <li role="presentation" class="dropdown-header">Click on item to add user</li>
                        </ul>
                    </div>
                </div>
            </div>

            {% if superusers %}
            <ul class="user-list">
                {% for user in superusers %}
                <li>
                    {{user.display_name}}
                    {% if superusers|length > 1 %}<a class="text-danger remove" data-user-id="{{ user.id }}" href="#"><small>remove</small></a>{% endif %}
                </li>
                {% endfor %}
            </ul>
            {% endif %}
        </div>
    </div>
</div>
{% endblock %}

{% block libraries %}
<script>
url = 'superusers/';
</script>
<script src="/static/lib/handlebars/handlebars.js"></script>
<script src="/static/js/templates.js"></script>

<script src="/static/js/admin.control.ajax.js"></script>
<script src="/static/js/admin.ui.usergroup.users.js"></script>
{% endblock %}
