- {% include 'permissions_tool/audit_row.html' with group="Permission Granted Directly (No Group)" %}
-
+ {% for user in permission.users %}
+ {% include 'permissions_tool/audit_row.html' with type="User" name="Permission granted directlty" %}
{% endfor %}
{% for group in permission.groups %}
{% for user in group.user_set.all %}
- {% include 'permissions_tool/audit_row.html' %}
+ {% include 'permissions_tool/audit_row.html' with type="Group" name=group%}
{% endfor %}
{% endfor %}
{% for state in permission.states %}
{% for profile in state.userprofile_set.all %}
{% with profile.user as user %}
-
- {% include 'permissions_tool/audit_state_row.html' %}
-
+ {% include 'permissions_tool/audit_row.html' with type="State" name=state%}
{% endwith %}
{% endfor %}
{% endfor %}
@@ -49,3 +45,48 @@
{% endblock content %}
+{% block extra_javascript %}
+ {% include 'bundles/datatables-js.html' %}
+
+{% endblock %}
+
+{% block extra_css %}
+ {% include 'bundles/datatables-css.html' %}
+{% endblock %}
+
+{% block extra_script %}
+ $(document).ready(function() {
+ var groupColumn = 0;
+ var table = $('#tab_permissions_audit').DataTable({
+ columnDefs: [
+ { "visible": false, "targets": groupColumn }
+ ],
+ order: [[ groupColumn, 'asc' ], [ 2, 'asc' ] ],
+ filterDropDown:
+ {
+ columns: [
+ {
+ idx: 0,
+ title: 'Source'
+ }
+ ],
+ bootstrap: true
+ },
+ drawCallback: function ( settings ) {
+ var api = this.api();
+ var rows = api.rows( {page:'current'} ).nodes();
+ var last=null;
+
+ api.column(groupColumn, {page:'current'} ).data().each( function ( group, i ) {
+ if ( last !== group ) {
+ $(rows).eq( i ).before(
+ '
' + group + '
'
+ );
+
+ last = group;
+ }
+ } );
+ }
+ } );
+ } );
+{% endblock %}
\ No newline at end of file
diff --git a/allianceauth/permissions_tool/templates/permissions_tool/audit_row.html b/allianceauth/permissions_tool/templates/permissions_tool/audit_row.html
index 7431556b..390e04d7 100644
--- a/allianceauth/permissions_tool/templates/permissions_tool/audit_row.html
+++ b/allianceauth/permissions_tool/templates/permissions_tool/audit_row.html
@@ -1,10 +1,25 @@
+{% load evelinks %}
+
-
- {% if forloop.first %}
- {{ group }}
- {% endif %}
+
+ {{ type }}: {{ name }}
+
+
+
- {{ user }}
+ {{ user }}
+ {{ user.profile.main_character.character_name }}
+