manage_groups.html 1.03 KB
{% extends "base.html" %}
{% load ingroup version_static i18n %}

{% block extrahead %}
    <script type="text/javascript"
            src="{% version_static 'js/manage-groups.js' %}"></script>
{% endblock %}

{% block title %}{% trans 'Role użytkowników' %}{% endblock %}

{% block content %}
    <h3>{% trans 'Role użytkowników' %}</h3>
    <table id="user-groups">
        <tr>
            <th>{% trans 'nazwa' %}</th>
            {% for group in groups %}
                <th>{{ group.name }}</th>
            {% endfor %}
        </tr>
        {% for u in users %}
            <tr>
                <td>{{ u.username }}</td>
                {% for group in groups %}
                    <td>
                        <input
                                type="checkbox"
                                id="group-{{ group.pk }}-{{ u.pk }}"
                                {% if u|ingroup:group %}checked="checked"{% endif %}/>
                    </td>
                {% endfor %}
            </tr>
        {% endfor %}
    </table>
{% endblock %}