{% load object_permission_tags %}

<style>
    table.permissions {margin-bottom:25px !important;}
    table.permissions td, table.permissions th {text-align:left !important;}
    table.permissions td.obj {color:black; width:200px;}
    table.permissions td.perms {color:#555;}
</style>

{% for class_name, objs in perm_dict.items %}
    {% if persona|is_user %}
        <a class="button add permission" href="{% url user-add-permissions persona.pk class_name %}">
    {% else %}
        <a class="button add permission" href="{% url group-add-permissions persona.pk class_name %}">
    {% endif %}
        Add {{class_name}}</a>
    <table id="{{class_name}}" class="permissions object_permissions">
        <tr><th colspan="100%">{{class_name}}</th></tr>
        {% for obj in objs %}
            {% include "object_permissions/permissions/object_row.html" %}
        {% endfor %}
    </table>
{% endfor %}

<script type="text/javascript">
    var is_user = {% if persona|is_user %}true{% else %}false{% endif %};
    var persona_pk = {{persona.pk}};
</script>
<script type="text/javascript" src="{{SITE_ROOT}}/object_permissions_media/js/jquery.form.js"></script>
<script type="text/javascript" src="{{SITE_ROOT}}/object_permissions_media/js/objects.js"></script>
