{% extends "base.html" %}

{% block title %} | Administrators{% endblock %}
{% block bodydata %} data-project-id="{{project.id}}""{% endblock %}

{% block main %}
        <div class="page-header">
            <div class="container">
                <div class="row">
                    <div class="col-sm-6">
                        <h1 class="smaller"><a href="{% url 'admin:project_overview' project.id %}">{{project.name}}</a></h1>
                        <a href="{% url 'admin:project_overview' project.id %}"><span class="glyphicon glyphicon-arrow-left"></span> Project home page</a>
                    </div>
                    <ul class="header-nav">
                        <li><a href="{% url 'admin:category_list' project.id %}">Categories <span class="badge">{{ project.categories.count }}</span></a></li>
                        <li class="active"><a href="{% url 'admin:usergroup_list' project.id %}">User groups <span class="badge">{{ project.usergroups.count }}</span></a></li>
                    </ul>
                </div>
            </div>
        </div>

        <div class="container">
            {% include 'snippets/messages.html' %}

            <div class="row">
                <div class="col-sm-4">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <h6 class="item-info">User group</h6>
                            <h3>Administrators</h3>
                            <p>Administrators for the project {{ project.name }}</p>
                        </div>
                        <div class="panel-body bg-info text-info">
                            <h5>Special settings for administrators</h5>
                            <p>Project administrators can access all data groupings as well as contribute and moderate all data.</p>
                            <p>They further can change the settings of this project. </p>
                        </div>
                    </div>
                </div>
                <div class="col-sm-8">
                    {% include 'snippets/usergroup-editor.html' with users=project.admins.all admins=True %}
                </div>
            </div>
        </div>
{% endblock %}

{% block libraries %}
            <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 %}
