{% load i18n %}
<form method="POST" class="access-permissions-form">
    {% csrf_token %}
    {{ access_permission_form.non_field_errors }}
    {{ access_permission_form.access_permissions.errors }}
    {{ access_permission_form.expires.errors }}
    <div class="fields">
        <div class="field">
            {{ access_permission_form.access_restrictions }}
        </div>
        <div class="field">
            {{ access_permission_form.expires }}
        </div>
        {% if access_permission_form.can_grant %}
            <div class="field">
                {{ access_permission_form.can_grant }}
            </div>
        {% endif %}
        {% if access_permission_form.unlimited %}
            <div class="field">
                {{ access_permission_form.unlimited }}
            </div>
        {% endif %}
        <div class="field">
            <button type="submit" name="submit_access_permissions" value="1">{{ button_label }}</button>
        </div>
    </div>
</form>
