aa-sov-timer 2.3.2__tar.gz → 2.3.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/PKG-INFO +17 -18
  2. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/README.md +16 -17
  3. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/__init__.py +1 -1
  4. aa_sov_timer-2.3.4/sovtimer/app_settings.py +20 -0
  5. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/constants.py +5 -2
  6. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/helper/static_files.py +2 -1
  7. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/locale/cs_CZ/LC_MESSAGES/django.po +1 -1
  8. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/locale/de/LC_MESSAGES/django.po +1 -1
  9. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/locale/django.pot +2 -2
  10. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/locale/es/LC_MESSAGES/django.po +1 -1
  11. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/locale/fr_FR/LC_MESSAGES/django.po +1 -1
  12. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/locale/it_IT/LC_MESSAGES/django.po +1 -1
  13. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/locale/ja/LC_MESSAGES/django.po +1 -1
  14. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/locale/ko_KR/LC_MESSAGES/django.po +1 -1
  15. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/locale/nl_NL/LC_MESSAGES/django.po +1 -1
  16. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/locale/pl_PL/LC_MESSAGES/django.po +1 -1
  17. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/locale/ru/LC_MESSAGES/django.po +1 -1
  18. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/locale/sk/LC_MESSAGES/django.po +1 -1
  19. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/locale/uk/LC_MESSAGES/django.po +1 -1
  20. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/locale/zh_Hans/LC_MESSAGES/django.po +1 -1
  21. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/static/sovtimer/js/aa-sov-timer.js +4 -5
  22. aa_sov_timer-2.3.4/sovtimer/static/sovtimer/js/aa-sov-timer.min.js +2 -0
  23. aa_sov_timer-2.3.4/sovtimer/static/sovtimer/js/aa-sov-timer.min.js.map +1 -0
  24. aa_sov_timer-2.3.4/sovtimer/tasks.py +227 -0
  25. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/templates/sovtimer/base.html +1 -5
  26. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/templatetags/sovtimer.py +12 -7
  27. aa_sov_timer-2.3.4/sovtimer/tests/test_app_settings.py +37 -0
  28. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/tests/test_templatetags.py +22 -3
  29. aa_sov_timer-2.3.2/sovtimer/static/sovtimer/js/aa-sov-timer.min.js +0 -2
  30. aa_sov_timer-2.3.2/sovtimer/static/sovtimer/js/aa-sov-timer.min.js.map +0 -1
  31. aa_sov_timer-2.3.2/sovtimer/tasks.py +0 -210
  32. aa_sov_timer-2.3.2/sovtimer/templates/sovtimer/partials/header/h1.html +0 -5
  33. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/.gitignore +0 -0
  34. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/LICENSE +0 -0
  35. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/pyproject.toml +0 -0
  36. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/apps.py +0 -0
  37. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/auth_hooks.py +0 -0
  38. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/locale/.gitkeep +0 -0
  39. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/locale/cs_CZ/LC_MESSAGES/django.mo +0 -0
  40. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/locale/de/LC_MESSAGES/django.mo +0 -0
  41. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/locale/es/LC_MESSAGES/django.mo +0 -0
  42. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/locale/fr_FR/LC_MESSAGES/django.mo +0 -0
  43. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/locale/it_IT/LC_MESSAGES/django.mo +0 -0
  44. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/locale/ja/LC_MESSAGES/django.mo +0 -0
  45. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/locale/ko_KR/LC_MESSAGES/django.mo +0 -0
  46. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/locale/nl_NL/LC_MESSAGES/django.mo +0 -0
  47. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/locale/pl_PL/LC_MESSAGES/django.mo +0 -0
  48. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/locale/ru/LC_MESSAGES/django.mo +0 -0
  49. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/locale/sk/LC_MESSAGES/django.mo +0 -0
  50. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/locale/uk/LC_MESSAGES/django.mo +0 -0
  51. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/locale/zh_Hans/LC_MESSAGES/django.mo +0 -0
  52. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/management/commands/__init__.py +0 -0
  53. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/management/commands/sovtimer_load_initial_data.py +0 -0
  54. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/migrations/0001_initial.py +0 -0
  55. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/migrations/0002_aasovtimercampaigns_aasovtimerstructures.py +0 -0
  56. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/migrations/0003_auto_20201113_1033.py +0 -0
  57. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/migrations/0004_auto_20201113_1856.py +0 -0
  58. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/migrations/0005_auto_20201114_0720.py +0 -0
  59. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/migrations/0006_rename_models.py +0 -0
  60. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/migrations/0007_cleanup_models.py +0 -0
  61. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/migrations/0008_fix_campaign_attackers_score.py +0 -0
  62. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/migrations/0009_alter_campaign_options_and_more.py +0 -0
  63. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/migrations/0010_alter_campaign_event_type.py +0 -0
  64. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/migrations/__init__.py +0 -0
  65. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/models.py +0 -0
  66. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/providers.py +0 -0
  67. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/static/sovtimer/css/aa-sov-timer.css +0 -0
  68. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/static/sovtimer/css/aa-sov-timer.min.css +0 -0
  69. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/static/sovtimer/css/aa-sov-timer.min.css.map +0 -0
  70. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/static/sovtimer/font/materialicons/v143/MaterialIcons-Regular.woff2 +0 -0
  71. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/static/sovtimer/font/materialicons/v143/README.md +0 -0
  72. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/static/sovtimer/images/zkillboard.png +0 -0
  73. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/templates/sovtimer/bundles/aa-sov-timer-css.html +0 -0
  74. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/templates/sovtimer/bundles/aa-sov-timer-js.html +0 -0
  75. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/templates/sovtimer/dashboard.html +0 -0
  76. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/templates/sovtimer/partials/dashboard/table.html +0 -0
  77. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/templates/sovtimer/partials/footer/app-translation-footer.html +0 -0
  78. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/templatetags/__init__.py +0 -0
  79. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/tests/__init__.py +0 -0
  80. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/tests/fixtures/allianceauth.json +0 -0
  81. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/tests/fixtures/load_allianceauth.py +0 -0
  82. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/tests/fixtures/load_sovtimer.py +0 -0
  83. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/tests/fixtures/sovtimer.json +0 -0
  84. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/tests/fixtures/utils.py +0 -0
  85. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/tests/test_ajax_calls.py +0 -0
  86. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/tests/test_integration.py +0 -0
  87. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/tests/utils.py +0 -0
  88. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/urls.py +0 -0
  89. {aa_sov_timer-2.3.2 → aa_sov_timer-2.3.4}/sovtimer/views.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aa-sov-timer
3
- Version: 2.3.2
3
+ Version: 2.3.4
4
4
  Summary: Sov Campaign Timer for Alliance Auth
5
5
  Project-URL: Changelog, https://github.com/ppfeufer/aa-sov-timer/blob/master/CHANGELOG.md
6
6
  Project-URL: Documentation, https://github.com/ppfeufer/aa-sov-timer/blob/master/README.md
@@ -729,22 +729,21 @@ Sovereignty campaign overview for Alliance Auth.
729
729
 
730
730
  ______________________________________________________________________
731
731
 
732
- <!-- mdformat-toc start --slug=github --maxlevel=6 --minlevel=1 -->
733
-
734
- - [AA Sovereignty Timer](#aa-sovereignty-timer)
735
- - [Screenshots](#screenshots)
736
- - [AA Sov Timer Dashboard](#aa-sov-timer-dashboard)
737
- - [Installation](#installation)
738
- - [Step 1: Installing the App](#step-1-installing-the-app)
739
- - [Step 2: Update Your AA Settings](#step-2-update-your-aa-settings)
740
- - [Step 3: Finalizing the Installation](#step-3-finalizing-the-installation)
741
- - [Step 4: Preload Eve Universe Data](#step-4-preload-eve-universe-data)
742
- - [Step 5: Setting up Permission](#step-5-setting-up-permission)
743
- - [Step 6: Keep Campaigns Updated](#step-6-keep-campaigns-updated)
744
- - [Updating](#updating)
745
- - [Changelog](#changelog)
746
- - [Translation Status](#translation-status)
747
- - [Contributing](#contributing)
732
+ <!-- mdformat-toc start --slug=github --maxlevel=6 --minlevel=2 -->
733
+
734
+ - [Screenshots](#screenshots)
735
+ - [AA Sov Timer Dashboard](#aa-sov-timer-dashboard)
736
+ - [Installation](#installation)
737
+ - [Step 1: Installing the App](#step-1-installing-the-app)
738
+ - [Step 2: Update Your AA Settings](#step-2-update-your-aa-settings)
739
+ - [Step 3: Finalizing the Installation](#step-3-finalizing-the-installation)
740
+ - [Step 4: Preload Eve Universe Data](#step-4-preload-eve-universe-data)
741
+ - [Step 5: Setting up Permission](#step-5-setting-up-permission)
742
+ - [Step 6: Keep Campaigns Updated](#step-6-keep-campaigns-updated)
743
+ - [Updating](#updating)
744
+ - [Changelog](#changelog)
745
+ - [Translation Status](#translation-status)
746
+ - [Contributing](#contributing)
748
747
 
749
748
  <!-- mdformat-toc end -->
750
749
 
@@ -789,7 +788,7 @@ pip install aa-sov-timer
789
788
 
790
789
  Configure your AA settings (`local.py`) as follows:
791
790
 
792
- - Add `'eveuniverse',` to `INSTALLED_APPS`
791
+ - Add `'eveuniverse',` to `INSTALLED_APPS` if not already done for another app
793
792
  - Add `'sovtimer',` to `INSTALLED_APPS`
794
793
 
795
794
  Restart your supervisor
@@ -19,22 +19,21 @@ Sovereignty campaign overview for Alliance Auth.
19
19
 
20
20
  ______________________________________________________________________
21
21
 
22
- <!-- mdformat-toc start --slug=github --maxlevel=6 --minlevel=1 -->
23
-
24
- - [AA Sovereignty Timer](#aa-sovereignty-timer)
25
- - [Screenshots](#screenshots)
26
- - [AA Sov Timer Dashboard](#aa-sov-timer-dashboard)
27
- - [Installation](#installation)
28
- - [Step 1: Installing the App](#step-1-installing-the-app)
29
- - [Step 2: Update Your AA Settings](#step-2-update-your-aa-settings)
30
- - [Step 3: Finalizing the Installation](#step-3-finalizing-the-installation)
31
- - [Step 4: Preload Eve Universe Data](#step-4-preload-eve-universe-data)
32
- - [Step 5: Setting up Permission](#step-5-setting-up-permission)
33
- - [Step 6: Keep Campaigns Updated](#step-6-keep-campaigns-updated)
34
- - [Updating](#updating)
35
- - [Changelog](#changelog)
36
- - [Translation Status](#translation-status)
37
- - [Contributing](#contributing)
22
+ <!-- mdformat-toc start --slug=github --maxlevel=6 --minlevel=2 -->
23
+
24
+ - [Screenshots](#screenshots)
25
+ - [AA Sov Timer Dashboard](#aa-sov-timer-dashboard)
26
+ - [Installation](#installation)
27
+ - [Step 1: Installing the App](#step-1-installing-the-app)
28
+ - [Step 2: Update Your AA Settings](#step-2-update-your-aa-settings)
29
+ - [Step 3: Finalizing the Installation](#step-3-finalizing-the-installation)
30
+ - [Step 4: Preload Eve Universe Data](#step-4-preload-eve-universe-data)
31
+ - [Step 5: Setting up Permission](#step-5-setting-up-permission)
32
+ - [Step 6: Keep Campaigns Updated](#step-6-keep-campaigns-updated)
33
+ - [Updating](#updating)
34
+ - [Changelog](#changelog)
35
+ - [Translation Status](#translation-status)
36
+ - [Contributing](#contributing)
38
37
 
39
38
  <!-- mdformat-toc end -->
40
39
 
@@ -79,7 +78,7 @@ pip install aa-sov-timer
79
78
 
80
79
  Configure your AA settings (`local.py`) as follows:
81
80
 
82
- - Add `'eveuniverse',` to `INSTALLED_APPS`
81
+ - Add `'eveuniverse',` to `INSTALLED_APPS` if not already done for another app
83
82
  - Add `'sovtimer',` to `INSTALLED_APPS`
84
83
 
85
84
  Restart your supervisor
@@ -5,5 +5,5 @@ App init
5
5
  # Django
6
6
  from django.utils.translation import gettext_lazy as _
7
7
 
8
- __version__ = "2.3.2"
8
+ __version__ = "2.3.4"
9
9
  __title__ = _("Sovereignty Timers")
@@ -0,0 +1,20 @@
1
+ """
2
+ App settings
3
+ """
4
+
5
+ # Standard Library
6
+ from re import RegexFlag
7
+
8
+ # Django
9
+ from django.conf import settings
10
+
11
+
12
+ def debug_enabled() -> RegexFlag:
13
+ """
14
+ Check if DEBUG is enabled
15
+
16
+ :return:
17
+ :rtype:
18
+ """
19
+
20
+ return settings.DEBUG
@@ -12,13 +12,16 @@ from esi import __version__ as esi_version
12
12
  from sovtimer import __version__
13
13
 
14
14
  APP_NAME = "aa-sov-timer"
15
+ APP_NAME_VERBOSE = "AA Sovereignty Timer"
16
+ APP_NAME_VERBOSE_USERAGENT = "AA-Sovereignty-Timer"
17
+ PACKAGE_NAME = "sovtimer"
15
18
  GITHUB_URL = f"https://github.com/ppfeufer/{APP_NAME}"
16
- USER_AGENT = f"{APP_NAME}/{__version__} +{GITHUB_URL} via django-esi/{esi_version}"
19
+ USER_AGENT = f"{APP_NAME_VERBOSE_USERAGENT}/{__version__} (+{GITHUB_URL}) Django-ESI/{esi_version}"
17
20
 
18
21
  # aa-sov-timer/sovtimer
19
22
  APP_BASE_DIR = os.path.join(os.path.dirname(__file__))
20
23
  # aa-sov-timer/sovtimer/static/sovtimer
21
- APP_STATIC_DIR = os.path.join(APP_BASE_DIR, "static", "sovtimer")
24
+ APP_STATIC_DIR = os.path.join(APP_BASE_DIR, "static", PACKAGE_NAME)
22
25
 
23
26
  # All internal URLs need to start with this prefix
24
27
  INTERNAL_URL_PREFIX = "-"
@@ -26,9 +26,10 @@ logger = LoggerAddTag(my_logger=get_extension_logger(__name__), prefix=__title__
26
26
  def calculate_integrity_hash(relative_file_path: str) -> str:
27
27
  """
28
28
  Calculates the integrity hash for a given static file
29
+
29
30
  :param self:
30
31
  :type self:
31
- :param relative_file_path: The file path relative to the `aa-sov-timer/sovtimer/static/sovtimer` folder
32
+ :param relative_file_path: The file path relative to the `{APP_NAME}/{PACKAGE_NAME}/static/{PACKAGE_NAME}` folder
32
33
  :type relative_file_path: str
33
34
  :return: The integrity hash
34
35
  :rtype: str
@@ -6,7 +6,7 @@ msgid ""
6
6
  msgstr ""
7
7
  "Project-Id-Version: AA Sov Timer 2.2.1\n"
8
8
  "Report-Msgid-Bugs-To: https://github.com/ppfeufer/aa-sov-timer/issues\n"
9
- "POT-Creation-Date: 2025-02-26 18:42+0100\n"
9
+ "POT-Creation-Date: 2025-04-09 11:48+0200\n"
10
10
  "PO-Revision-Date: 2024-07-10 14:26+0000\n"
11
11
  "Last-Translator: Dadas Aideron <dadas.aideron@gmail.com>\n"
12
12
  "Language-Team: Czech <https://weblate.ppfeufer.de/projects/alliance-auth-apps/aa-sov-timer/cs/>\n"
@@ -6,7 +6,7 @@ msgid ""
6
6
  msgstr ""
7
7
  "Project-Id-Version: AA Sov Timer 2.2.1\n"
8
8
  "Report-Msgid-Bugs-To: https://github.com/ppfeufer/aa-sov-timer/issues\n"
9
- "POT-Creation-Date: 2025-02-26 18:42+0100\n"
9
+ "POT-Creation-Date: 2025-04-09 11:48+0200\n"
10
10
  "PO-Revision-Date: 2024-12-15 10:37+0000\n"
11
11
  "Last-Translator: Peter Pfeufer <info@ppfeufer.de>\n"
12
12
  "Language-Team: German <https://weblate.ppfeufer.de/projects/alliance-auth-apps/aa-sov-timer/de/>\n"
@@ -6,9 +6,9 @@
6
6
  #, fuzzy
7
7
  msgid ""
8
8
  msgstr ""
9
- "Project-Id-Version: AA Sov Timer 2.3.2\n"
9
+ "Project-Id-Version: AA Sov Timer 2.3.4\n"
10
10
  "Report-Msgid-Bugs-To: https://github.com/ppfeufer/aa-sov-timer/issues\n"
11
- "POT-Creation-Date: 2025-02-27 11:22+0100\n"
11
+ "POT-Creation-Date: 2025-04-09 11:48+0200\n"
12
12
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13
13
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -7,7 +7,7 @@ msgid ""
7
7
  msgstr ""
8
8
  "Project-Id-Version: AA Sov Timer 2.2.1\n"
9
9
  "Report-Msgid-Bugs-To: https://github.com/ppfeufer/aa-sov-timer/issues\n"
10
- "POT-Creation-Date: 2025-02-26 18:42+0100\n"
10
+ "POT-Creation-Date: 2025-04-09 11:48+0200\n"
11
11
  "PO-Revision-Date: 2024-12-15 10:37+0000\n"
12
12
  "Last-Translator: Peter Pfeufer <info@ppfeufer.de>\n"
13
13
  "Language-Team: Spanish <https://weblate.ppfeufer.de/projects/alliance-auth-apps/aa-sov-timer/es/>\n"
@@ -10,7 +10,7 @@ msgid ""
10
10
  msgstr ""
11
11
  "Project-Id-Version: AA Sov Timer 2.2.1\n"
12
12
  "Report-Msgid-Bugs-To: https://github.com/ppfeufer/aa-sov-timer/issues\n"
13
- "POT-Creation-Date: 2025-02-26 18:42+0100\n"
13
+ "POT-Creation-Date: 2025-04-09 11:48+0200\n"
14
14
  "PO-Revision-Date: 2024-12-15 10:37+0000\n"
15
15
  "Last-Translator: Peter Pfeufer <info@ppfeufer.de>\n"
16
16
  "Language-Team: French <https://weblate.ppfeufer.de/projects/alliance-auth-apps/aa-sov-timer/fr/>\n"
@@ -6,7 +6,7 @@ msgid ""
6
6
  msgstr ""
7
7
  "Project-Id-Version: AA Sov Timer 2.2.1\n"
8
8
  "Report-Msgid-Bugs-To: https://github.com/ppfeufer/aa-sov-timer/issues\n"
9
- "POT-Creation-Date: 2025-02-26 18:42+0100\n"
9
+ "POT-Creation-Date: 2025-04-09 11:48+0200\n"
10
10
  "PO-Revision-Date: 2024-12-22 21:15+0000\n"
11
11
  "Last-Translator: Peter Pfeufer <info@ppfeufer.de>\n"
12
12
  "Language-Team: Italian <https://weblate.ppfeufer.de/projects/alliance-auth-apps/aa-sov-timer/it/>\n"
@@ -7,7 +7,7 @@ msgid ""
7
7
  msgstr ""
8
8
  "Project-Id-Version: AA Sov Timer 2.2.1\n"
9
9
  "Report-Msgid-Bugs-To: https://github.com/ppfeufer/aa-sov-timer/issues\n"
10
- "POT-Creation-Date: 2025-02-26 18:42+0100\n"
10
+ "POT-Creation-Date: 2025-04-09 11:48+0200\n"
11
11
  "PO-Revision-Date: 2024-08-06 03:28+0000\n"
12
12
  "Last-Translator: Deleted User <noreply+44@weblate.org>\n"
13
13
  "Language-Team: Japanese <https://weblate.ppfeufer.de/projects/alliance-auth-apps/aa-sov-timer/ja/>\n"
@@ -9,7 +9,7 @@ msgid ""
9
9
  msgstr ""
10
10
  "Project-Id-Version: AA Sov Timer 2.2.1\n"
11
11
  "Report-Msgid-Bugs-To: https://github.com/ppfeufer/aa-sov-timer/issues\n"
12
- "POT-Creation-Date: 2025-02-26 18:42+0100\n"
12
+ "POT-Creation-Date: 2025-04-09 11:48+0200\n"
13
13
  "PO-Revision-Date: 2024-12-15 10:37+0000\n"
14
14
  "Last-Translator: Peter Pfeufer <info@ppfeufer.de>\n"
15
15
  "Language-Team: Korean <https://weblate.ppfeufer.de/projects/alliance-auth-apps/aa-sov-timer/ko/>\n"
@@ -7,7 +7,7 @@ msgid ""
7
7
  msgstr ""
8
8
  "Project-Id-Version: AA Sov Timer 2.2.1\n"
9
9
  "Report-Msgid-Bugs-To: https://github.com/ppfeufer/aa-sov-timer/issues\n"
10
- "POT-Creation-Date: 2025-02-26 18:42+0100\n"
10
+ "POT-Creation-Date: 2025-04-09 11:48+0200\n"
11
11
  "PO-Revision-Date: 2024-05-10 14:12+0000\n"
12
12
  "Last-Translator: Anonymous <noreply@weblate.org>\n"
13
13
  "Language-Team: Dutch <https://weblate.ppfeufer.de/projects/alliance-auth-apps/aa-sov-timer/nl/>\n"
@@ -6,7 +6,7 @@ msgid ""
6
6
  msgstr ""
7
7
  "Project-Id-Version: AA Sov Timer 2.2.1\n"
8
8
  "Report-Msgid-Bugs-To: https://github.com/ppfeufer/aa-sov-timer/issues\n"
9
- "POT-Creation-Date: 2025-02-26 18:42+0100\n"
9
+ "POT-Creation-Date: 2025-04-09 11:48+0200\n"
10
10
  "PO-Revision-Date: 2024-05-10 14:12+0000\n"
11
11
  "Last-Translator: Anonymous <noreply@weblate.org>\n"
12
12
  "Language-Team: Polish <https://weblate.ppfeufer.de/projects/alliance-auth-apps/aa-sov-timer/pl/>\n"
@@ -8,7 +8,7 @@ msgid ""
8
8
  msgstr ""
9
9
  "Project-Id-Version: AA Sov Timer 2.2.1\n"
10
10
  "Report-Msgid-Bugs-To: https://github.com/ppfeufer/aa-sov-timer/issues\n"
11
- "POT-Creation-Date: 2025-02-26 18:42+0100\n"
11
+ "POT-Creation-Date: 2025-04-09 11:48+0200\n"
12
12
  "PO-Revision-Date: 2024-12-15 10:37+0000\n"
13
13
  "Last-Translator: Peter Pfeufer <info@ppfeufer.de>\n"
14
14
  "Language-Team: Russian <https://weblate.ppfeufer.de/projects/alliance-auth-apps/aa-sov-timer/ru/>\n"
@@ -7,7 +7,7 @@ msgid ""
7
7
  msgstr ""
8
8
  "Project-Id-Version: AA Sov Timer 2.2.1\n"
9
9
  "Report-Msgid-Bugs-To: https://github.com/ppfeufer/aa-sov-timer/issues\n"
10
- "POT-Creation-Date: 2025-02-26 18:42+0100\n"
10
+ "POT-Creation-Date: 2025-04-09 11:48+0200\n"
11
11
  "PO-Revision-Date: 2024-05-10 14:12+0000\n"
12
12
  "Last-Translator: Anonymous <noreply@weblate.org>\n"
13
13
  "Language-Team: Slovak <https://weblate.ppfeufer.de/projects/alliance-auth-apps/aa-sov-timer/sk/>\n"
@@ -8,7 +8,7 @@ msgid ""
8
8
  msgstr ""
9
9
  "Project-Id-Version: AA Sov Timer 2.2.1\n"
10
10
  "Report-Msgid-Bugs-To: https://github.com/ppfeufer/aa-sov-timer/issues\n"
11
- "POT-Creation-Date: 2025-02-26 18:42+0100\n"
11
+ "POT-Creation-Date: 2025-04-09 11:48+0200\n"
12
12
  "PO-Revision-Date: 2025-02-24 15:17+0000\n"
13
13
  "Last-Translator: M <skrypets@gmail.com>\n"
14
14
  "Language-Team: Ukrainian <https://weblate.ppfeufer.de/projects/alliance-auth-apps/aa-sov-timer/uk/>\n"
@@ -10,7 +10,7 @@ msgid ""
10
10
  msgstr ""
11
11
  "Project-Id-Version: AA Sov Timer 2.2.1\n"
12
12
  "Report-Msgid-Bugs-To: https://github.com/ppfeufer/aa-sov-timer/issues\n"
13
- "POT-Creation-Date: 2025-02-26 18:42+0100\n"
13
+ "POT-Creation-Date: 2025-04-09 11:48+0200\n"
14
14
  "PO-Revision-Date: 2024-05-15 09:21+0000\n"
15
15
  "Last-Translator: SAM_FPS <sam_fps@163.com>\n"
16
16
  "Language-Team: Chinese (Simplified) <https://weblate.ppfeufer.de/projects/alliance-auth-apps/aa-sov-timer/zh_Hans/>\n"
@@ -160,13 +160,12 @@ $(document).ready(() => {
160
160
  data: 'start_time',
161
161
  render: {
162
162
  _: (data) => {
163
- return moment(data)
164
- .locale(sovtimerSettings.language.momentJS)
165
- .utc()
166
- .format(sovtimerSettings.datetimeFormat.datetimeWithSeconds);
163
+ return data === null ? '' : moment(data).utc().format(
164
+ sovtimerSettings.datetimeFormat.datetimeLong
165
+ );
167
166
  },
168
167
  sort: (data) => {
169
- return data;
168
+ return data === null ? '' : data;
170
169
  }
171
170
  }
172
171
  },
@@ -0,0 +1,2 @@
1
+ $(document).ready(()=>{function n(t){return t&&"object"==typeof t&&!Array.isArray(t)&&!(t instanceof Date)}function i(e,...t){return t.length&&t.forEach(t=>{if(n(e)&&n(t))for(var a in t)n(t[a])?"__proto__"!==a&&"constructor"!==a&&"prototype"!==a&&(e[a]&&n(e[a])||(e[a]={}),i(e[a],t[a])):e[a]=t[a]}),e}let m=sovtimerJsSettingsDefaults;"undefined"!=typeof sovtimerJsSettingsOverride&&(m=i(sovtimerJsSettingsDefaults,sovtimerJsSettingsOverride));const l=$(".aa-sovtimer-timers-total"),d=$(".aa-sovtimer-timers-upcoming"),c=$(".aa-sovtimer-timers-active"),r=t=>{let a="",e="aa-sovtimer-remaining";t<0?(e+=" aa-sovtimer-timer-elapsed",a="-",t=Math.abs(t),t++):t--;const n=Math.floor(t/86400);let i=Math.floor(t/3600)%24,r=Math.floor(t/60)%60,s=Math.floor(t)%60;return i<10&&(i="0"+i),r<10&&(r="0"+r),s<10&&(s="0"+s),{countdown:`<span class="${e}">${a}${n}d ${i}h ${r}m ${s}s</span>`,remainingTimeInSeconds:a+t}},s=$(".aa-sovtimer-campaigns").DataTable({language:m.dataTables.language,ajax:{url:m.url.ajaxUpdate,dataSrc:"",cache:!1},columns:[{data:"event_type"},{data:"solar_system_name_html"},{data:"constellation_name_html"},{data:"region_name_html"},{data:"defender_name_html"},{data:"adm"},{data:"start_time",render:{_:t=>null===t?"":moment(t).utc().format(m.datetimeFormat.datetimeLong),sort:t=>null===t?"":t}},{data:"remaining_time"},{data:"campaign_progress"},{data:"remaining_time_in_seconds"},{data:"solar_system_name"},{data:"constellation_name"},{data:"region_name"},{data:"defender_name"},{data:"active_campaign"}],columnDefs:[{visible:!1,targets:[0,9,10,11,12,13,14]},{width:"150px",targets:[8]}],order:[[6,"asc"]],filterDropDown:{columns:[{idx:10,title:m.translation.dtFilter.system},{idx:11,title:m.translation.dtFilter.constellation},{idx:12,title:m.translation.dtFilter.region},{idx:13,title:m.translation.dtFilter.owner},{idx:14,title:m.translation.dtFilter.activeCampaign}],autoSize:!1,bootstrap:!0,bootstrap_version:5},createdRow:(t,a)=>{const e=l.html(),n=parseInt(e)+1;if(l.html(n),a.active_campaign===m.translation.no&&a.remaining_time_in_seconds<=m.upcomingTimerThreshold){$(t).addClass("aa-sovtimer-upcoming-campaign");const i=d.html(),r=parseInt(i)+1;d.html(r)}if(a.active_campaign===m.translation.yes){$(t).addClass("aa-sovtimer-active-campaign");const s=c.html(),o=parseInt(s)+1;c.html(o)}},paging:!1});setInterval(()=>{s.ajax.reload(t=>{l.html("0"),d.html("0"),c.html("0"),$.each(t,(t,a)=>{const e=l.html(),n=parseInt(e)+1;if(l.html(n),a.active_campaign===m.translation.no&&a.remaining_time_in_seconds<=m.upcomingTimerThreshold){const i=d.html(),r=parseInt(i)+1;d.html(r)}if(a.active_campaign===m.translation.yes){const s=c.html(),o=parseInt(s)+1;c.html(o)}})})},3e4),setInterval(()=>{s.rows().every(t=>{const a=s.row(t).data(),e=r(a.remaining_time_in_seconds);a.remaining_time_in_seconds=e.remainingTimeInSeconds,a.remaining_time=e.countdown,s.row(t).data(a)})},1e3)});
2
+ //# sourceMappingURL=aa-sov-timer.min.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["aa-sov-timer.js"],"names":["$","document","ready","isObject","item","Array","isArray","Date","deepMerge","target","sources","length","forEach","source","key","let","sovtimerSettings","sovtimerJsSettingsDefaults","sovtimerJsSettingsOverride","elementTimerTotal","elementTimerUpcoming","elementTimerActive","secondsToRemainingTime","prefix","spanClasses","secondsRemaining","Math","abs","days","floor","hours","minutes","seconds","countdown","remainingTimeInSeconds","sovCampaignTable","DataTable","language","dataTables","ajax","url","ajaxUpdate","dataSrc","cache","columns","data","render","_","moment","utc","format","datetimeFormat","datetimeLong","sort","columnDefs","visible","targets","width","order","filterDropDown","idx","title","translation","dtFilter","system","constellation","region","owner","activeCampaign","autoSize","bootstrap","bootstrap_version","createdRow","row","currentTotal","html","newTotal","parseInt","active_campaign","no","remaining_time_in_seconds","upcomingTimerThreshold","addClass","currentUpcoming","newUpcoming","yes","currentActive","newActive","paging","setInterval","reload","each","tableData","i","rows","every","element","remaining","remaining_time"],"mappings":"AAEAA,EAAEC,QAAQ,EAAEC,MAAM,KASd,SAASC,EAAUC,GACf,OACIA,GAAwB,UAAhB,OAAOA,GAAqB,CAACC,MAAMC,QAAQF,CAAI,GAAK,EAAEA,aAAgBG,KAEtF,CAYA,SAASC,EAAWC,KAAWC,GA0B3B,OAzBKA,EAAQC,QAKbD,EAAQE,QAAQC,IACZ,GAAIV,EAASM,CAAM,GAAKN,EAASU,CAAM,EACnC,IAAK,IAAMC,KAAOD,EACVV,EAASU,EAAOC,EAAI,EACR,cAARA,GAA+B,gBAARA,GAAiC,cAARA,IAI/CL,EAAOK,IAASX,EAASM,EAAOK,EAAI,IACrCL,EAAOK,GAAO,IAGlBN,EAAUC,EAAOK,GAAMD,EAAOC,EAAI,GAElCL,EAAOK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 -0,0 +1,227 @@
1
+ """
2
+ The tasks
3
+ """
4
+
5
+ # Third Party
6
+ from celery import shared_task
7
+
8
+ # Django
9
+ from django.core.cache import cache
10
+ from django.db import transaction
11
+
12
+ # Alliance Auth
13
+ from allianceauth.services.hooks import get_extension_logger
14
+ from allianceauth.services.tasks import QueueOnce
15
+
16
+ # Alliance Auth (External Libs)
17
+ from app_utils.logging import LoggerAddTag
18
+ from eveuniverse.core.esitools import is_esi_online
19
+ from eveuniverse.models import EveEntity, EveSolarSystem
20
+
21
+ # AA Sovereignty Timer
22
+ from sovtimer import __title__
23
+ from sovtimer.models import Campaign, SovereigntyStructure
24
+
25
+ logger = LoggerAddTag(my_logger=get_extension_logger(name=__name__), prefix=__title__)
26
+
27
+
28
+ ESI_ERROR_LIMIT = 50
29
+ ESI_TIMEOUT_ONCE_ERROR_LIMIT_REACHED = 60
30
+ ESI_SOV_STRUCTURES_CACHE_KEY = "sov_structures_cache"
31
+ ESI_MAX_RETRIES = 5
32
+
33
+ TASK_TIME_LIMIT = 600 # Stop after 10 minutes
34
+
35
+ # Params for all tasks
36
+ TASK_PRIORITY = 6
37
+ TASK_ONCE_ARGS = {"graceful": True}
38
+ TASK_ONCE = {"base": QueueOnce, "once": TASK_ONCE_ARGS}
39
+
40
+ TASK_DEFAULTS = {
41
+ "time_limit": TASK_TIME_LIMIT,
42
+ "max_retries": ESI_MAX_RETRIES,
43
+ "default_retry_delay": 300,
44
+ }
45
+ TASK_DEFAULTS_ONCE = {**TASK_DEFAULTS, **TASK_ONCE}
46
+
47
+
48
+ @shared_task(**TASK_DEFAULTS_ONCE)
49
+ def run_sov_campaign_updates() -> None:
50
+ """
51
+ Update all sovereignty campaigns and structures
52
+
53
+ This task is used to update all sovereignty campaigns and structures from ESI.
54
+ It should be called by a periodic task, or in your `local.py` settings file via:
55
+
56
+ ```python
57
+ # AA Sovereignty Timer - https://github.com/ppfeufer/aa-sov-timer
58
+ if "sovtimer" in INSTALLED_APPS:
59
+ # Run campaign updates every 30 seconds
60
+ CELERYBEAT_SCHEDULE["sovtimer.tasks.run_sov_campaign_updates"] = {
61
+ "task": "sovtimer.tasks.run_sov_campaign_updates",
62
+ "schedule": 30.0,
63
+ }
64
+ ```
65
+ """
66
+
67
+ if not is_esi_online():
68
+ logger.info(
69
+ msg=(
70
+ "ESI seems to be offline, currently. "
71
+ "Can't start ESI related tasks. Aborting …"
72
+ )
73
+ )
74
+
75
+ return
76
+
77
+ logger.info(msg="Updating sovereignty structures and campaigns from ESI …")
78
+
79
+ update_sov_structures.apply_async(priority=TASK_PRIORITY, once=TASK_ONCE_ARGS)
80
+ update_sov_campaigns.apply_async(priority=TASK_PRIORITY, once=TASK_ONCE_ARGS)
81
+
82
+
83
+ @shared_task(**TASK_DEFAULTS_ONCE)
84
+ def update_sov_campaigns() -> None:
85
+ """
86
+ Update sovereignty campaigns
87
+
88
+ This task is used to update the sovereignty campaigns from ESI.
89
+ """
90
+
91
+ campaigns_from_esi = Campaign.get_sov_campaigns_from_esi()
92
+
93
+ logger.debug(
94
+ msg=f"Number of sovereignty campaigns from ESI: {len(campaigns_from_esi or [])}"
95
+ )
96
+
97
+ if not campaigns_from_esi:
98
+ logger.info(msg="No sovereignty campaigns found, nothing to update.")
99
+
100
+ return
101
+
102
+ logger.debug(msg="Updating sovereignty campaigns …")
103
+
104
+ campaigns = []
105
+ defender_ids = {campaign.get("defender_id") for campaign in campaigns_from_esi}
106
+ existing_campaigns = {c.campaign_id: c for c in Campaign.objects.all()}
107
+
108
+ EveEntity.objects.bulk_create(
109
+ [EveEntity(id=defender_id) for defender_id in defender_ids],
110
+ ignore_conflicts=True,
111
+ )
112
+
113
+ for campaign in campaigns_from_esi:
114
+ campaign_id = campaign.get("campaign_id")
115
+ campaign_current__defender_score = campaign.get("defender_score")
116
+ campaign_current__progress_previous = campaign_current__defender_score
117
+
118
+ if campaign_id in existing_campaigns:
119
+ campaign_previous = existing_campaigns[campaign_id]
120
+ campaign_previous__progress_previous = campaign_previous.progress_previous
121
+ campaign_previous__progress = campaign_previous.defender_score
122
+ campaign_current__progress_previous = campaign_previous__progress
123
+
124
+ if campaign_previous__progress == campaign_current__defender_score:
125
+ campaign_current__progress_previous = (
126
+ campaign_previous__progress_previous
127
+ )
128
+
129
+ campaigns.append(
130
+ Campaign(
131
+ attackers_score=campaign.get("attackers_score"),
132
+ campaign_id=campaign_id,
133
+ defender_score=campaign.get("defender_score"),
134
+ event_type=campaign.get("event_type"),
135
+ start_time=campaign.get("start_time"),
136
+ structure_id=campaign.get("structure_id"),
137
+ progress_current=campaign_current__defender_score,
138
+ progress_previous=campaign_current__progress_previous,
139
+ )
140
+ )
141
+
142
+ Campaign.objects.all().delete()
143
+ Campaign.objects.bulk_create(
144
+ objs=campaigns,
145
+ batch_size=500,
146
+ # ignore_conflicts=True,
147
+ )
148
+ EveEntity.objects.bulk_update_new_esi()
149
+
150
+ logger.info(msg=f"{len(campaigns)} sovereignty campaigns updated from ESI.")
151
+
152
+
153
+ @shared_task(**TASK_DEFAULTS_ONCE)
154
+ def update_sov_structures() -> None:
155
+ """
156
+ Update sovereignty structures
157
+
158
+ This task is used to update the sovereignty structures from ESI.
159
+ """
160
+
161
+ if cache.get(ESI_SOV_STRUCTURES_CACHE_KEY) is None:
162
+ logger.debug(msg="Updating sovereignty structures …")
163
+
164
+ structures_from_esi = SovereigntyStructure.get_sov_structures_from_esi()
165
+
166
+ if structures_from_esi:
167
+ with transaction.atomic():
168
+ esi_structure_ids = set()
169
+ sov_structures = []
170
+
171
+ for structure in structures_from_esi:
172
+ structure_id = structure.get("structure_id")
173
+
174
+ if structure_id not in esi_structure_ids:
175
+ esi_structure_ids.add(structure_id)
176
+
177
+ sov_holder, _ = EveEntity.objects.get_or_create(
178
+ id=structure.get("alliance_id")
179
+ )
180
+
181
+ structure_solar_system = EveSolarSystem.objects.get(
182
+ id=structure.get("solar_system_id")
183
+ )
184
+
185
+ vulnerability_occupancy_level = (
186
+ 1
187
+ if structure.get("vulnerability_occupancy_level") is None
188
+ else structure.get("vulnerability_occupancy_level")
189
+ )
190
+
191
+ vulnerable_end_time = structure.get("vulnerable_end_time")
192
+ vulnerable_start_time = structure.get("vulnerable_start_time")
193
+
194
+ sov_structures.append(
195
+ SovereigntyStructure(
196
+ alliance=sov_holder,
197
+ solar_system=structure_solar_system,
198
+ structure_id=structure_id,
199
+ structure_type_id=structure.get("structure_type_id"),
200
+ vulnerability_occupancy_level=vulnerability_occupancy_level,
201
+ vulnerable_end_time=vulnerable_end_time,
202
+ vulnerable_start_time=vulnerable_start_time,
203
+ )
204
+ )
205
+
206
+ SovereigntyStructure.objects.bulk_create(
207
+ objs=sov_structures,
208
+ batch_size=500,
209
+ update_conflicts=True,
210
+ update_fields=[
211
+ "alliance",
212
+ "solar_system",
213
+ "structure_type_id",
214
+ "vulnerability_occupancy_level",
215
+ "vulnerable_end_time",
216
+ "vulnerable_start_time",
217
+ ],
218
+ )
219
+
220
+ EveEntity.objects.bulk_update_new_esi()
221
+ SovereigntyStructure.objects.exclude(pk__in=esi_structure_ids).delete()
222
+
223
+ cache.set(key=ESI_SOV_STRUCTURES_CACHE_KEY, value=True, timeout=120)
224
+
225
+ logger.info(
226
+ msg=f"{len(sov_structures)} sovereignty structures updated from ESI."
227
+ )
@@ -19,7 +19,6 @@
19
19
 
20
20
  <div class="aa-sovtimer-body">
21
21
  {% get_datatables_language_static LANGUAGE_CODE as DT_LANG_PATH %}
22
- {% get_momentjs_language_code LANGUAGE_CODE as MOMENTJS_LCODE %}
23
22
 
24
23
  <script>
25
24
  const sovtimerJsSettingsDefaults = {
@@ -29,10 +28,7 @@
29
28
  timeWithSeconds: 'LTS',
30
29
  datetime: 'L LT',
31
30
  datetimeWithSeconds: 'L LTS',
32
- },
33
- language: {
34
- django: '{{ LANGUAGE_CODE }}',
35
- momentJS: '{{ MOMENTJS_LCODE }}',
31
+ datetimeLong: 'LL LTS',
36
32
  },
37
33
  dataTables: {
38
34
  paging: true,