mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-12 14:00:17 +02:00
[FIX] Datatable in permission audit templates
This commit is contained in:
parent
f0fe3929d4
commit
0a6a6e0bf9
@ -1,18 +1,29 @@
|
||||
{% extends "allianceauth/base-bs5.html" %}
|
||||
|
||||
{% load i18n %}
|
||||
|
||||
{% block page_title %}
|
||||
{{ permission.permission.codename }} - {% translate "Permissions Audit" %}
|
||||
{% endblock page_title %}
|
||||
|
||||
{% block header_nav_brand %}
|
||||
{% translate "Permissions Audit" %}
|
||||
{% endblock header_nav_brand %}
|
||||
|
||||
{% block content %}
|
||||
<div>
|
||||
<h1 class="page-header">{% translate "Permissions Audit" %}: {{ permission.permission.codename }}</h1>
|
||||
<h1 class="page-header md-3">
|
||||
{% translate "Permissions Audit" %}: {{ permission.permission.codename }}
|
||||
</h1>
|
||||
|
||||
<p>
|
||||
<a href="{% url 'permissions_tool:overview' %}" class="btn btn-primary">
|
||||
<i class="fa-solid fa-chevron-left"></i> {% translate "Back" %}
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped" id="tab_permissions_audit">
|
||||
<table class="table table-striped" id="tab_permissions_audit" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">{% translate "Group" %}</th>
|
||||
@ -44,14 +55,11 @@
|
||||
{% endblock content %}
|
||||
{% block extra_javascript %}
|
||||
{% include "bundles/datatables-js-bs5.html" %}
|
||||
{% include "bundles/filterdropdown-js.html" %}
|
||||
{% endblock extra_javascript %}
|
||||
{% block extra_css %}
|
||||
{% include "bundles/datatables-css-bs5.html" %}
|
||||
{% endblock extra_css %}
|
||||
{% block extra_script %}
|
||||
{# {% include "bundles/filterdropdown-js.html" %}#}
|
||||
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
let groupColumn = 0;
|
||||
const groupColumn = 0;
|
||||
|
||||
$('#tab_permissions_audit').DataTable({
|
||||
columnDefs: [{
|
||||
@ -72,8 +80,8 @@
|
||||
"stateSave": true,
|
||||
"stateDuration": 0,
|
||||
drawCallback: function (settings) {
|
||||
let api = this.api();
|
||||
let rows = api.rows({
|
||||
const api = this.api();
|
||||
const rows = api.rows({
|
||||
page: 'current'
|
||||
}).nodes();
|
||||
let last = null;
|
||||
@ -82,9 +90,7 @@
|
||||
page: 'current'
|
||||
}).data().each(function (group, i) {
|
||||
if (last !== group) {
|
||||
$(rows).eq(i).before(
|
||||
'<tr class="h4 table-secondary"><td colspan="3">' + group + '</td></tr>'
|
||||
);
|
||||
$(rows).eq(i).before(`<tr class="h4 table-secondary"><td colspan="3">${group}</td></tr>`;
|
||||
|
||||
last = group;
|
||||
}
|
||||
@ -92,4 +98,9 @@
|
||||
}
|
||||
});
|
||||
});
|
||||
{% endblock extra_script %}
|
||||
</script>
|
||||
{% endblock extra_javascript %}
|
||||
|
||||
{% block extra_css %}
|
||||
{% include "bundles/datatables-css-bs5.html" %}
|
||||
{% endblock extra_css %}
|
||||
|
@ -1,10 +1,14 @@
|
||||
{% load evelinks %}
|
||||
{% load i18n %}
|
||||
|
||||
<tr>
|
||||
<td>{{ type }}: {{ name }}</td>
|
||||
<td class="text-end">
|
||||
<img src="{{ user.profile.main_character|character_portrait_url:32 }}" class="img-circle" alt="{{ user.profile.main_character.character_name }}"></td>
|
||||
<td><strong>{{ user }}<br></strong>{{ user.profile.main_character.character_name }}</td>
|
||||
<img src="{{ user.profile.main_character|character_portrait_url:32 }}" class="img-circle" alt="{{ user.profile.main_character.character_name }}">
|
||||
</td>
|
||||
<td>
|
||||
<strong>{{ user }}<br></strong>{{ user.profile.main_character.character_name }}
|
||||
</td>
|
||||
<td class="text-start">
|
||||
{% if user.profile.main_character %}
|
||||
<a href="{{ user.profile.main_character|dotlan_corporation_url }}" target="_blank">{{ user.profile.main_character.corporation_name }}</a>
|
||||
|
@ -1,11 +1,17 @@
|
||||
{% extends "allianceauth/base-bs5.html" %}
|
||||
|
||||
{% load i18n %}
|
||||
|
||||
{% block page_title %}
|
||||
{% translate "Permissions Overview" %}
|
||||
{% endblock page_title %}
|
||||
|
||||
{% block header_nav_brand %}
|
||||
{% translate "Permissions Audit" %}
|
||||
{% endblock header_nav_brand %}
|
||||
|
||||
{% block content %}
|
||||
<div class="col-sm-12">
|
||||
<h1 class="page-header">{% translate "Permissions Overview" %}</h1>
|
||||
<div>
|
||||
<p>
|
||||
{% if request.GET.all != 'yes' %}
|
||||
{% translate "Showing only applied permissions" %}
|
||||
@ -15,6 +21,7 @@
|
||||
<a href="{% url 'permissions_tool:overview' %}?all=no" class="btn btn-primary">{% translate "Show Applied" %}</a>
|
||||
{% endif %}
|
||||
</p>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped" id="tab_permissions_overview">
|
||||
<thead>
|
||||
@ -28,6 +35,7 @@
|
||||
<th scope="col">{% translate "States" %}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{% for perm in permissions %}
|
||||
<tr>
|
||||
@ -49,16 +57,15 @@
|
||||
</div>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
|
||||
{% block extra_javascript %}
|
||||
{% include "bundles/datatables-js-bs5.html" %}
|
||||
{% include "bundles/filterdropdown-js.html" %}
|
||||
{% endblock extra_javascript %}
|
||||
{% block extra_css %}
|
||||
{% include "bundles/datatables-css-bs5.html" %}
|
||||
{% endblock extra_css %}
|
||||
{% block extra_script %}
|
||||
$(document).ready(function () {
|
||||
let groupColumn = 0;
|
||||
{# {% include "bundles/filterdropdown-js.html" %}#}
|
||||
|
||||
<script>
|
||||
$(document).ready(() => {
|
||||
const groupColumn = 0;
|
||||
|
||||
$('#tab_permissions_overview').DataTable({
|
||||
columnDefs: [{
|
||||
"visible": false,
|
||||
@ -81,27 +88,28 @@
|
||||
},
|
||||
"stateSave": true,
|
||||
"stateDuration": 0,
|
||||
drawCallback: function (settings) {
|
||||
let api = this.api();
|
||||
let rows = api.rows({
|
||||
drawCallback: (settings) => {
|
||||
const api = this.api();
|
||||
const rows = api.rows({
|
||||
page: 'current'
|
||||
}).nodes();
|
||||
let last = null;
|
||||
|
||||
api.column(groupColumn, {
|
||||
page: 'current'
|
||||
}).data().each(function (group, i) {
|
||||
}).data().each((group, i) => {
|
||||
if (last !== group) {
|
||||
$(rows).eq(i).before(
|
||||
'
|
||||
<tr class="h4 table-secondary">
|
||||
<td colspan="6">' + group + '</td>
|
||||
</tr>
|
||||
'
|
||||
);
|
||||
$(rows).eq(i).before(`<tr class="h4 table-secondary"><td colspan="6">${group}</td></tr>`);
|
||||
|
||||
last = group;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
{% endblock extra_script %}
|
||||
</script>
|
||||
{% endblock extra_javascript %}
|
||||
|
||||
{% block extra_css %}
|
||||
{% include "bundles/datatables-css-bs5.html" %}
|
||||
{% endblock extra_css %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user