_manage_access.html 2.68 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
{% load i18n %}
<form action="{{ acl.url }}" method="post">{% csrf_token %}
    <table class="table table-striped table-with-form-fields" id="{{table_id}}">
    <thead>
        <tr>
        <th></th>
        <th>{% trans "Who" %}</th>
        <th>{% trans "What" %}</th>
        <th><i class="fa fa-times"></i></th>
        </tr>
    </thead>
    <tbody>
        {% for i in acl.users %}
        <tr>
        <td>
            <i class="fa fa-user"></i>
        </td>
        <td>
            <a href="{% url "dashboard.views.profile" username=i.user.username %}"
            title="{{ i.user.username }}">
            {% include "dashboard/_display-name.html" with user=i.user show_org=True %}
            </a>
        </td>
        <td>
            <select class="form-control" name="perm-u-{{i.user.id}}"{% if i.level not in acl.allowed_levels %} disabled{% endif %}>
            {% for id, name in acl.levels %}
            <option{%if id = i.level%} selected="selected"{%endif%}
            {% if id not in acl.allowed_levels %} disabled{% endif %}
                value="{{id}}">{{name}}</option>
            {% endfor %}
            </select>
        </td>
        <td>
            <input type="checkbox" name="remove-u-{{i.user.id}}" title="{% trans "Remove" %}"/>
        </td>
        </tr>
        {% endfor %}
        {% for i in acl.groups %}
        <tr>
        <td><i class="fa fa-group"></i></td>
        <td>
            <a href="{% url "dashboard.views.group-detail" pk=i.group.pk %}">
            {{i.group}}
            </a>
        </td>
        <td>
            <select class="form-control" name="perm-g-{{i.group.id}}{% if i.level not in acl.allowed_levels %} disabled{% endif %}">
            {% for id, name in acl.levels %}
            <option{%if id = i.level%} selected="selected"{%endif%}
            {% if id not in acl.allowed_levels %} disabled{% endif %}
                value="{{id}}">{{name}}</option>
            {% endfor %}
            </select>
        </td>
        <td>
            <input type="checkbox" name="remove-g-{{i.group.id}}" title="{% trans "Remove" %}"/>
        </td>
        </tr>
        {% endfor %}
        <tr><td><i class="fa fa-plus"></i></td>
            <td>{{aclform.name }}</td>
            <td><select class="form-control" name="level">
                    {% for id, name in acl.levels %}
                    {% if id in acl.allowed_levels %}
                    <option value="{{id}}">{{name}}</option>
                    {% endif %}
                    {% endfor %}
            </select></td><td></td>
        </tr>
    </tbody>
    </table>
    <div class="form-actions">
    <button type="submit" class="btn btn-success">{% trans "Save" %}</button>
    </div>
</form>