Change tables to datatables

master
DjVinnii 4 years ago
parent cdfa94c243
commit 7d3c9d412d

@ -1,10 +1,17 @@
require('./app.css'); require('./app.css');
import 'select2'; import 'select2';
import 'admin-lte/plugins/datatables/jquery.dataTables.js';
import 'admin-lte/plugins/datatables-bs4/js/dataTables.bootstrap4.js';
import 'admin-lte/plugins/datatables-responsive/js/dataTables.responsive.js';
import 'admin-lte/plugins/datatables-responsive/js/responsive.bootstrap4.js';
jQuery("document").ready(function() { jQuery("document").ready(function() {
jQuery(".mailselect").select2({ jQuery(".mailselect").select2({
tags: true, tags: true,
tokenSeparators: [',', ' '] tokenSeparators: [',', ' ']
})
}); });
jQuery(".table").DataTable({
"responsive": true,
});
});

@ -14,6 +14,8 @@ import 'admin-lte/plugins/fontawesome-free/css/solid.css';
// AdminLTE // AdminLTE
import 'admin-lte/build/scss/adminlte.scss'; import 'admin-lte/build/scss/adminlte.scss';
import 'admin-lte/plugins/datatables-bs4/css/dataTables.bootstrap4.css';
import 'admin-lte/plugins/datatables-responsive/css/responsive.bootstrap4.css';
// import 'admin-lte/build/less/AdminLTE-without-plugins.less'; // doesn't exist // import 'admin-lte/build/less/AdminLTE-without-plugins.less'; // doesn't exist
// import 'admin-lte/build/less/select2.less'; // doesn't exist // import 'admin-lte/build/less/select2.less'; // doesn't exist
// import 'admin-lte/build/less/skins/skin-blue.less'; // doesn't exist // import 'admin-lte/build/less/skins/skin-blue.less'; // doesn't exist

@ -12,10 +12,13 @@
{% block content %} {% block content %}
{% call macros.table() %} {% call macros.table() %}
<thead>
<tr> <tr>
<th>{% trans %}Actions{% endtrans %}</th> <th>{% trans %}Actions{% endtrans %}</th>
<th>{% trans %}Email{% endtrans %}</th> <th>{% trans %}Email{% endtrans %}</th>
</tr> </tr>
</thead>
<tbody>
{% for admin in admins %} {% for admin in admins %}
<tr> <tr>
<td> <td>
@ -24,5 +27,6 @@
<td>{{ admin }}</td> <td>{{ admin }}</td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody>
{% endcall %} {% endcall %}
{% endblock %} {% endblock %}

@ -14,6 +14,7 @@
{% block content %} {% block content %}
{% call macros.table() %} {% call macros.table() %}
<thead>
<tr> <tr>
<th>{% trans %}Actions{% endtrans %}</th> <th>{% trans %}Actions{% endtrans %}</th>
<th>{% trans %}Email{% endtrans %}</th> <th>{% trans %}Email{% endtrans %}</th>
@ -22,6 +23,8 @@
<th>{% trans %}Created{% endtrans %}</th> <th>{% trans %}Created{% endtrans %}</th>
<th>{% trans %}Last edit{% endtrans %}</th> <th>{% trans %}Last edit{% endtrans %}</th>
</tr> </tr>
</thead>
<tbody>
{% for alias in domain.aliases %} {% for alias in domain.aliases %}
<tr> <tr>
<td> <td>
@ -35,5 +38,6 @@
<td>{{ alias.updated_at or '' }}</td> <td>{{ alias.updated_at or '' }}</td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody>
{% endcall %} {% endcall %}
{% endblock %} {% endblock %}

@ -14,11 +14,14 @@
{% block content %} {% block content %}
{% call macros.table() %} {% call macros.table() %}
<thead>
<tr> <tr>
<th>{% trans %}Actions{% endtrans %}</th> <th>{% trans %}Actions{% endtrans %}</th>
<th>{% trans %}Name{% endtrans %}</th> <th>{% trans %}Name{% endtrans %}</th>
<th>{% trans %}Created{% endtrans %}</th> <th>{% trans %}Created{% endtrans %}</th>
</tr> </tr>
</thead>
<tbody>
{% for alternative in domain.alternatives %} {% for alternative in domain.alternatives %}
<tr> <tr>
<td> <td>
@ -28,5 +31,6 @@
<td>{{ alternative.created_at }}</td> <td>{{ alternative.created_at }}</td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody>
{% endcall %} {% endcall %}
{% endblock %} {% endblock %}

@ -12,6 +12,7 @@
{% block content %} {% block content %}
{% call macros.table() %} {% call macros.table() %}
<thead>
<tr> <tr>
<th>{% trans %}Actions{% endtrans %}</th> <th>{% trans %}Actions{% endtrans %}</th>
<th>{% trans %}Manage{% endtrans %}</th> <th>{% trans %}Manage{% endtrans %}</th>
@ -22,17 +23,19 @@
<th>{% trans %}Created{% endtrans %}</th> <th>{% trans %}Created{% endtrans %}</th>
<th>{% trans %}Last edit{% endtrans %}</th> <th>{% trans %}Last edit{% endtrans %}</th>
</tr> </tr>
</thead>
<tbody>
{% for domain in current_user.get_managed_domains() %} {% for domain in current_user.get_managed_domains() %}
<tr> <tr>
<td> <td>
<a href="{{ url_for('.domain_details', domain_name=domain.name) }}" title="{% trans %}Details{% endtrans %}"><i class="fa fa-list"></i></a>&nbsp; <a href="{{ url_for('.domain_details', domain_name=domain.name) }}" title="{% trans %}Details{% endtrans %}"><i class="fa fa-list"></i></a>&nbsp;
{% if current_user.global_admin %} {% if current_user.global_admin %}
<a href="{{ url_for('.domain_edit', domain_name=domain.name) }}" title="{% trans %}Edit{% endtrans %}"><i class="fa fa-pencil"></i></a>&nbsp; <a href="{{ url_for('.domain_edit', domain_name=domain.name) }}" title="{% trans %}Edit{% endtrans %}"><i class="fas fa-pencil-alt"></i></a>&nbsp;
<a href="{{ url_for('.domain_delete', domain_name=domain.name) }}" title="{% trans %}Delete{% endtrans %}"><i class="fa fa-trash"></i></a>&nbsp; <a href="{{ url_for('.domain_delete', domain_name=domain.name) }}" title="{% trans %}Delete{% endtrans %}"><i class="fa fa-trash"></i></a>&nbsp;
{% endif %} {% endif %}
</td> </td>
<td> <td>
<a href="{{ url_for('.user_list', domain_name=domain.name) }}" title="{% trans %}Users{% endtrans %}"><i class="fa fa-envelope-o"></i></a>&nbsp; <a href="{{ url_for('.user_list', domain_name=domain.name) }}" title="{% trans %}Users{% endtrans %}"><i class="far fa-envelope"></i></a>&nbsp;
<a href="{{ url_for('.alias_list', domain_name=domain.name) }}" title="{% trans %}Aliases{% endtrans %}"><i class="fa fa-at"></i></a>&nbsp; <a href="{{ url_for('.alias_list', domain_name=domain.name) }}" title="{% trans %}Aliases{% endtrans %}"><i class="fa fa-at"></i></a>&nbsp;
<a href="{{ url_for('.manager_list', domain_name=domain.name) }}" title="{% trans %}Managers{% endtrans %}"><i class="fa fa-user"></i></a>&nbsp; <a href="{{ url_for('.manager_list', domain_name=domain.name) }}" title="{% trans %}Managers{% endtrans %}"><i class="fa fa-user"></i></a>&nbsp;
{% if current_user.global_admin %} {% if current_user.global_admin %}
@ -47,5 +50,6 @@
<td>{{ domain.updated_at or '' }}</td> <td>{{ domain.updated_at or '' }}</td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody>
{% endcall %} {% endcall %}
{% endblock %} {% endblock %}

@ -14,6 +14,7 @@
{% block content %} {% block content %}
{% call macros.table() %} {% call macros.table() %}
<thead>
<tr> <tr>
<th>{% trans %}Actions{% endtrans %}</th> <th>{% trans %}Actions{% endtrans %}</th>
<th>{% trans %}Endpoint{% endtrans %}</th> <th>{% trans %}Endpoint{% endtrans %}</th>
@ -24,6 +25,8 @@
<th>{% trans %}Created{% endtrans %}</th> <th>{% trans %}Created{% endtrans %}</th>
<th>{% trans %}Last edit{% endtrans %}</th> <th>{% trans %}Last edit{% endtrans %}</th>
</tr> </tr>
</thead>
<tbody>
{% for fetch in user.fetches %} {% for fetch in user.fetches %}
<tr> <tr>
<td> <td>
@ -39,5 +42,6 @@
<td>{{ fetch.updated_at or '' }}</td> <td>{{ fetch.updated_at or '' }}</td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody>
{% endcall %} {% endcall %}
{% endblock %} {% endblock %}

@ -86,11 +86,9 @@
{% macro table(theme="primary") %} {% macro table(theme="primary") %}
<div class="row"> <div class="row">
<div class="col-lg-12"> <div class="col-lg-12">
<div class="box box-{{ theme }}"> <div class="card card-{{ theme }}">
<table class="table table-bordered"> <table class="table table-bordered">
<tbody>
{{ caller() }} {{ caller() }}
</tbody>
</table> </table>
</div> </div>
</div> </div>

@ -14,10 +14,13 @@
{% block content %} {% block content %}
{% call macros.table() %} {% call macros.table() %}
<thead>
<tr> <tr>
<th>{% trans %}Actions{% endtrans %}</th> <th>{% trans %}Actions{% endtrans %}</th>
<th>{% trans %}Email{% endtrans %}</th> <th>{% trans %}Email{% endtrans %}</th>
</tr> </tr>
</thead>
<tbody>
{% for manager in domain.managers %} {% for manager in domain.managers %}
<tr> <tr>
<td> <td>
@ -26,5 +29,6 @@
<td>{{ manager }}</td> <td>{{ manager }}</td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody>
{% endcall %} {% endcall %}
{% endblock %} {% endblock %}

@ -12,6 +12,7 @@
{% block content %} {% block content %}
{% call macros.table() %} {% call macros.table() %}
<thead>
<tr> <tr>
<th>{% trans %}Actions{% endtrans %}</th> <th>{% trans %}Actions{% endtrans %}</th>
<th>{% trans %}Domain name{% endtrans %}</th> <th>{% trans %}Domain name{% endtrans %}</th>
@ -20,6 +21,8 @@
<th>{% trans %}Created{% endtrans %}</th> <th>{% trans %}Created{% endtrans %}</th>
<th>{% trans %}Last edit{% endtrans %}</th> <th>{% trans %}Last edit{% endtrans %}</th>
</tr> </tr>
</thead>
<tbody>
{% for relay in relays %} {% for relay in relays %}
<tr> <tr>
<td> <td>
@ -33,5 +36,6 @@
<td>{{ relay.updated_at or '' }}</td> <td>{{ relay.updated_at or '' }}</td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody>
{% endcall %} {% endcall %}
{% endblock %} {% endblock %}

@ -14,12 +14,15 @@
{% block content %} {% block content %}
{% call macros.table() %} {% call macros.table() %}
<thead>
<tr> <tr>
<th>{% trans %}Actions{% endtrans %}</th> <th>{% trans %}Actions{% endtrans %}</th>
<th>{% trans %}Comment{% endtrans %}</th> <th>{% trans %}Comment{% endtrans %}</th>
<th>{% trans %}Authorized IP{% endtrans %}</th> <th>{% trans %}Authorized IP{% endtrans %}</th>
<th>{% trans %}Created{% endtrans %}</th> <th>{% trans %}Created{% endtrans %}</th>
</tr> </tr>
</thead>
<tbody>
{% for token in user.tokens %} {% for token in user.tokens %}
<tr> <tr>
<td> <td>
@ -30,5 +33,6 @@
<td>{{ token.created_at }}</td> <td>{{ token.created_at }}</td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody>
{% endcall %} {% endcall %}
{% endblock %} {% endblock %}

@ -14,6 +14,7 @@
{% block content %} {% block content %}
{% call macros.table() %} {% call macros.table() %}
<thead>
<tr> <tr>
<th>{% trans %}Actions{% endtrans %}</th> <th>{% trans %}Actions{% endtrans %}</th>
<th>{% trans %}User settings{% endtrans %}</th> <th>{% trans %}User settings{% endtrans %}</th>
@ -24,10 +25,12 @@
<th>{% trans %}Created{% endtrans %}</th> <th>{% trans %}Created{% endtrans %}</th>
<th>{% trans %}Last edit{% endtrans %}</th> <th>{% trans %}Last edit{% endtrans %}</th>
</tr> </tr>
</thead>
<tbody>
{% for user in domain.users %} {% for user in domain.users %}
<tr {% if not user.enabled %}class="warning"{% endif %}> <tr {% if not user.enabled %}class="warning"{% endif %}>
<td> <td>
<a href="{{ url_for('.user_edit', user_email=user.email) }}" title="{% trans %}Edit{% endtrans %}"><i class="fa fa-pencil"></i></a>&nbsp; <a href="{{ url_for('.user_edit', user_email=user.email) }}" title="{% trans %}Edit{% endtrans %}"><i class="fas fa-pencil-alt"></i></a>&nbsp;
<a href="{{ url_for('.user_delete', user_email=user.email) }}" title="{% trans %}Delete{% endtrans %}"><i class="fa fa-trash"></i></a> <a href="{{ url_for('.user_delete', user_email=user.email) }}" title="{% trans %}Delete{% endtrans %}"><i class="fa fa-trash"></i></a>
</td> </td>
<td> <td>
@ -46,5 +49,6 @@
<td>{{ user.updated_at or '' }}</td> <td>{{ user.updated_at or '' }}</td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody>
{% endcall %} {% endcall %}
{% endblock %} {% endblock %}

Loading…
Cancel
Save