[ADD] Locale mapping for DataTables and Moment.JS

This commit is contained in:
Peter Pfeufer
2025-01-20 04:35:10 +01:00
parent 1b6cf98885
commit 856e939c21
39 changed files with 4459 additions and 22 deletions

View File

@@ -1,5 +1,6 @@
{% extends "allianceauth/base-bs5.html" %}
{% load aa_i18n %}
{% load static %}
{% load i18n %}
{% load navactive %}
@@ -73,6 +74,8 @@
{% include 'bundles/moment-js.html' with locale=True %}
{% include 'bundles/filterdropdown-js.html' %}
{% get_datatables_language_static LANGUAGE_CODE as DT_LANG_PATH %}
<script>
$.fn.dataTable.moment = (format, locale) => {
const types = $.fn.dataTable.ext.type;
@@ -94,6 +97,7 @@
$.fn.dataTable.moment('YYYY-MMM-D, HH:mm');
$('#log-entries').DataTable({
language: {url: '{{ DT_LANG_PATH }}'},
order: [[0, 'desc'], [1, 'asc']],
filterDropDown:
{

View File

@@ -1,6 +1,7 @@
{% extends "allianceauth/base-bs5.html" %}
{% load static %}
{% load aa_i18n %}
{% load i18n %}
{% load evelinks %}
{% load navactive %}
@@ -86,9 +87,12 @@
{% block extra_javascript %}
{% include 'bundles/datatables-js-bs5.html' %}
{% get_datatables_language_static LANGUAGE_CODE as DT_LANG_PATH %}
<script>
$(document).ready(() => {
$('#tab_group_members').DataTable({
language: {url: '{{ DT_LANG_PATH }}'},
order: [[0, "asc"]],
columnDefs: [
{

View File

@@ -1,6 +1,7 @@
{% extends "allianceauth/base-bs5.html" %}
{% load static %}
{% load aa_i18n %}
{% load i18n %}
{% block page_title %}
@@ -103,9 +104,13 @@
{% block extra_javascript %}
{% include 'bundles/datatables-js-bs5.html' %}
{% get_datatables_language_static LANGUAGE_CODE as DT_LANG_PATH %}
<script>
$(document).ready(() => {
$('#groupsTable').DataTable();
$('#groupsTable').DataTable({
language: {url: '{{ DT_LANG_PATH }}'},
});
});
</script>
{% endblock %}