aa-ledger 0.3.3__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 (77) hide show
  1. aa_ledger-0.3.3/.gitignore +11 -0
  2. aa_ledger-0.3.3/LICENSE +21 -0
  3. aa_ledger-0.3.3/PKG-INFO +187 -0
  4. aa_ledger-0.3.3/README.md +130 -0
  5. aa_ledger-0.3.3/ledger/__init__.py +8 -0
  6. aa_ledger-0.3.3/ledger/admin.py +110 -0
  7. aa_ledger-0.3.3/ledger/api/__init__.py +24 -0
  8. aa_ledger-0.3.3/ledger/api/character/__init__.py +7 -0
  9. aa_ledger-0.3.3/ledger/api/character/helpers.py +193 -0
  10. aa_ledger-0.3.3/ledger/api/character/ledger.py +295 -0
  11. aa_ledger-0.3.3/ledger/api/character/template.py +427 -0
  12. aa_ledger-0.3.3/ledger/api/corporation/__init__.py +7 -0
  13. aa_ledger-0.3.3/ledger/api/corporation/helpers.py +93 -0
  14. aa_ledger-0.3.3/ledger/api/corporation/ledger.py +197 -0
  15. aa_ledger-0.3.3/ledger/api/corporation/template.py +180 -0
  16. aa_ledger-0.3.3/ledger/api/helpers.py +216 -0
  17. aa_ledger-0.3.3/ledger/api/schema.py +70 -0
  18. aa_ledger-0.3.3/ledger/app_settings.py +43 -0
  19. aa_ledger-0.3.3/ledger/apps.py +17 -0
  20. aa_ledger-0.3.3/ledger/auth_hooks.py +46 -0
  21. aa_ledger-0.3.3/ledger/decorators.py +48 -0
  22. aa_ledger-0.3.3/ledger/errors.py +23 -0
  23. aa_ledger-0.3.3/ledger/hooks.py +33 -0
  24. aa_ledger-0.3.3/ledger/managers/charaudit_manager.py +89 -0
  25. aa_ledger-0.3.3/ledger/managers/corpaudit_manager.py +52 -0
  26. aa_ledger-0.3.3/ledger/managers/general_manager.py +71 -0
  27. aa_ledger-0.3.3/ledger/migrations/__init__.py +0 -0
  28. aa_ledger-0.3.3/ledger/models/__init__.py +12 -0
  29. aa_ledger-0.3.3/ledger/models/characteraudit.py +192 -0
  30. aa_ledger-0.3.3/ledger/models/corporationaudit.py +103 -0
  31. aa_ledger-0.3.3/ledger/models/events.py +32 -0
  32. aa_ledger-0.3.3/ledger/models/general.py +123 -0
  33. aa_ledger-0.3.3/ledger/providers.py +7 -0
  34. aa_ledger-0.3.3/ledger/static/ledger/css/billboards_dark.css +275 -0
  35. aa_ledger-0.3.3/ledger/static/ledger/css/cards.css +197 -0
  36. aa_ledger-0.3.3/ledger/static/ledger/css/custom.css +74 -0
  37. aa_ledger-0.3.3/ledger/static/ledger/guides/ledger-1.png +0 -0
  38. aa_ledger-0.3.3/ledger/static/ledger/guides/ledger-2.png +0 -0
  39. aa_ledger-0.3.3/ledger/static/ledger/guides/ledger-3.png +0 -0
  40. aa_ledger-0.3.3/ledger/static/ledger/images/Spinner-1s-64px-dark.gif +0 -0
  41. aa_ledger-0.3.3/ledger/static/ledger/images/Spinner-1s-64px-light.gif +0 -0
  42. aa_ledger-0.3.3/ledger/static/ledger/js/charledger.js +447 -0
  43. aa_ledger-0.3.3/ledger/static/ledger/js/corpledger.js +373 -0
  44. aa_ledger-0.3.3/ledger/static/ledger/js/img.js +29 -0
  45. aa_ledger-0.3.3/ledger/task_helpers/__init__.py +3 -0
  46. aa_ledger-0.3.3/ledger/task_helpers/char_helpers.py +210 -0
  47. aa_ledger-0.3.3/ledger/task_helpers/core_helpers.py +52 -0
  48. aa_ledger-0.3.3/ledger/task_helpers/corp_helpers.py +250 -0
  49. aa_ledger-0.3.3/ledger/task_helpers/etag_helpers.py +248 -0
  50. aa_ledger-0.3.3/ledger/tasks.py +162 -0
  51. aa_ledger-0.3.3/ledger/templates/ledger/base.html +41 -0
  52. aa_ledger-0.3.3/ledger/templates/ledger/bundles/ledger-css.html +2 -0
  53. aa_ledger-0.3.3/ledger/templates/ledger/error.html +27 -0
  54. aa_ledger-0.3.3/ledger/templates/ledger/ledger/base.html +41 -0
  55. aa_ledger-0.3.3/ledger/templates/ledger/ledger/charledger/char_ledger.html +83 -0
  56. aa_ledger-0.3.3/ledger/templates/ledger/ledger/charledger/month.html +87 -0
  57. aa_ledger-0.3.3/ledger/templates/ledger/ledger/charledger/year.html +71 -0
  58. aa_ledger-0.3.3/ledger/templates/ledger/ledger/corpledger/corp_ledger.html +83 -0
  59. aa_ledger-0.3.3/ledger/templates/ledger/ledger/corpledger/month.html +72 -0
  60. aa_ledger-0.3.3/ledger/templates/ledger/ledger/corpledger/year.html +57 -0
  61. aa_ledger-0.3.3/ledger/templates/ledger/ledger/index.html +57 -0
  62. aa_ledger-0.3.3/ledger/templates/ledger/ledger/menu.html +32 -0
  63. aa_ledger-0.3.3/ledger/templates/ledger/modals/modal-full.html +16 -0
  64. aa_ledger-0.3.3/ledger/templates/ledger/modals/modal-xl.html +16 -0
  65. aa_ledger-0.3.3/ledger/templates/ledger/modals/modal.html +16 -0
  66. aa_ledger-0.3.3/ledger/templates/ledger/modals/modal_dialog.html +29 -0
  67. aa_ledger-0.3.3/ledger/templates/ledger/modals/pve/view_character_content.html +284 -0
  68. aa_ledger-0.3.3/ledger/urls.py +49 -0
  69. aa_ledger-0.3.3/ledger/view_helpers/__init__.py +3 -0
  70. aa_ledger-0.3.3/ledger/view_helpers/core.py +163 -0
  71. aa_ledger-0.3.3/ledger/views/__init__.py +3 -0
  72. aa_ledger-0.3.3/ledger/views/character/char_audit.py +86 -0
  73. aa_ledger-0.3.3/ledger/views/corporation/corp_audit.py +36 -0
  74. aa_ledger-0.3.3/ledger/views/corporation/corp_events.py +144 -0
  75. aa_ledger-0.3.3/ledger/views/corporation/corp_tax.py +260 -0
  76. aa_ledger-0.3.3/ledger/views/pve.py +35 -0
  77. aa_ledger-0.3.3/pyproject.toml +81 -0
@@ -0,0 +1,11 @@
1
+ *.log
2
+ .tox/
3
+ *.old
4
+ __pycache__
5
+ node_modules/
6
+
7
+ /build/
8
+ /dist/
9
+ .coverage
10
+ .env
11
+ .pypirc
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) [2024] [Geuthur]
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,187 @@
1
+ Metadata-Version: 2.3
2
+ Name: aa-ledger
3
+ Version: 0.3.3
4
+ Dynamic: Summary
5
+ Project-URL: Changelog, https://github.com/Geuthur/aa-ledger/blob/master/CHANGELOG.md
6
+ Project-URL: Homepage, https://github.com/Geuthur/aa-ledger
7
+ Project-URL: Source, https://github.com/Geuthur/aa-ledger
8
+ Project-URL: Tracker, https://github.com/Geuthur/aa-ledger/issues
9
+ Author-email: Geuthur <devgeuthur@gmail.com>
10
+ License: MIT License
11
+
12
+ Copyright (c) [2024] [Geuthur]
13
+
14
+ Permission is hereby granted, free of charge, to any person obtaining a copy
15
+ of this software and associated documentation files (the "Software"), to deal
16
+ in the Software without restriction, including without limitation the rights
17
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18
+ copies of the Software, and to permit persons to whom the Software is
19
+ furnished to do so, subject to the following conditions:
20
+
21
+ The above copyright notice and this permission notice shall be included in all
22
+ copies or substantial portions of the Software.
23
+
24
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30
+ SOFTWARE.
31
+ License-File: LICENSE
32
+ Classifier: Environment :: Web Environment
33
+ Classifier: Framework :: Django
34
+ Classifier: Framework :: Django :: 4.0
35
+ Classifier: Intended Audience :: Developers
36
+ Classifier: License :: OSI Approved :: MIT License
37
+ Classifier: Operating System :: OS Independent
38
+ Classifier: Programming Language :: Python
39
+ Classifier: Programming Language :: Python :: 3 :: Only
40
+ Classifier: Programming Language :: Python :: 3.8
41
+ Classifier: Programming Language :: Python :: 3.9
42
+ Classifier: Programming Language :: Python :: 3.10
43
+ Classifier: Programming Language :: Python :: 3.11
44
+ Classifier: Programming Language :: Python :: 3.12
45
+ Classifier: Topic :: Internet :: WWW/HTTP
46
+ Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
47
+ Requires-Python: >=3.8
48
+ Requires-Dist: allianceauth-app-utils>=1.19
49
+ Requires-Dist: allianceauth>=4
50
+ Requires-Dist: dacite
51
+ Requires-Dist: django-eveuniverse>=1.3
52
+ Requires-Dist: django-ninja
53
+ Provides-Extra: tests-allianceauth-latest
54
+ Requires-Dist: coverage; extra == 'tests-allianceauth-latest'
55
+ Requires-Dist: django-webtest; extra == 'tests-allianceauth-latest'
56
+ Description-Content-Type: text/markdown
57
+
58
+ # Ledger module for AllianceAuth.<a name="aa-ledger"></a>
59
+
60
+ [![pre-commit.ci status](https://results.pre-commit.ci/badge/github/Geuthur/aa-ledger/master.svg)](https://results.pre-commit.ci/latest/github/Geuthur/aa-ledger/master)
61
+ [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
62
+ [![Tests](https://github.com/Geuthur/aa-ledger/actions/workflows/autotester.yml/badge.svg)](https://github.com/Geuthur/aa-ledger/actions/workflows/autotester.yml)
63
+
64
+ - [AA Ledger](#aa-ledger)
65
+ - [Features](#features)
66
+ - [Upcoming](#upcoming)
67
+ - [Installation](#features)
68
+ - [Step 1 - Install the Package](#step1)
69
+ - [Step 2 - Configure Alliance Auth](#step2)
70
+ - [Step 3 - Add the Scheduled Tasks](#step3)
71
+ - [Step 4 - Migration to AA](#step4)
72
+ - [Step 5 - Setting up Permissions](#step5)
73
+ - [Step 6 - (Optional) Setting up Compatibilies](#step6)
74
+ - [Highlights](#highlights)
75
+
76
+ ## Features<a name="features"></a>
77
+
78
+ - Graphical Overview
79
+ - Ratting,Mining,Trading
80
+ - Character Ledger
81
+ - Corporation Ledger
82
+
83
+ ## Upcoming<a name="upcoming"></a>
84
+
85
+ - Corp Tax System (Tracks specific amount that transfer'd to specific division)
86
+ - Events Calender
87
+
88
+ ## Installation<a name="installation"></a>
89
+
90
+ ### Step 1 - Install the Package<a name="step1"></a>
91
+
92
+ Make sure you're in your virtual environment (venv) of your Alliance Auth then install the pakage.
93
+
94
+ ```shell
95
+ pip install aa-ledger
96
+ ```
97
+
98
+ ### Step 2 - Configure Alliance Auth<a name="step2"></a>
99
+
100
+ Configure your Alliance Auth settings (`local.py`) as follows:
101
+
102
+ - Add `'allianceauth.corputils',` to `INSTALLED_APPS`
103
+ - Add `'eveuniverse',` to `INSTALLED_APPS`
104
+ - Add `'ledger',` to `INSTALLED_APPS`
105
+
106
+ ### Step 3 - Add the Scheduled Tasks<a name="step3"></a>
107
+
108
+ To set up the Scheduled Tasks add following code to your `local.py`
109
+
110
+ ```python
111
+ CELERYBEAT_SCHEDULE["ledger_character_audit_update_all"] = {
112
+ "task": "ledger.tasks.update_all_characters",
113
+ "schedule": crontab(hour="*/1"),
114
+ }
115
+ CELERYBEAT_SCHEDULE["ledger_corporation_audit_update_all"] = {
116
+ "task": "ledger.tasks.update_all_corps",
117
+ "schedule": crontab(hour="*/1"),
118
+ }
119
+ ```
120
+
121
+ ### Step 4 - Migration to AA<a name="step4"></a>
122
+
123
+ ```shell
124
+ python manage.py collectstatic
125
+ python manage.py migrate
126
+ ```
127
+
128
+ ### Step 5 - Setting up Permissions<a name="step5"></a>
129
+
130
+ With the Following IDs you can set up the permissions for the Ledger
131
+
132
+ | ID | Description | |
133
+ | :------------------------ | :------------------------------------- | :-------------------------------------------------------------------------------------- |
134
+ | `basic_access` | Can access the Ledger module | All Members with the Permission can access the Ledger. |
135
+ | `moderator_access` | Has access to moderation tools | Not Implemented yet. |
136
+ | `admin_access` | Has access to all Administration tools | Not Implemented yet. |
137
+ | `char_audit_admin_access` | Can Manage Character Audit Module | Can Manage Character Audit Module, Like Add Memeberaudit Chars, View Character Journals |
138
+ | `corp_audit_admin_access` | Can Manage Corporation Audit Module | Can Manage Corporation Audit Module, Like Add Corp, View Corporation Journals |
139
+
140
+ ### Step 6 - (Optional) Setting up Compatibilies<a name="step6"></a>
141
+
142
+ The Following Settings can be setting up in the `local.py`
143
+
144
+ - LEDGER_LOGGER_USE: `True / False`
145
+ - LEDGER_MEMBERAUDIT_USE: `True / False`
146
+ - LEDGER_CORPSTATS_TWO: `True / False`
147
+
148
+ If you set up LEDGER_LOGGER_USE to `True` you need to add the following code below:
149
+
150
+ ```python
151
+ LOGGING_LEDGER = {
152
+ "handlers": {
153
+ "ledger_file": {
154
+ "level": "DEBUG",
155
+ "class": "logging.handlers.RotatingFileHandler",
156
+ "filename": os.path.join(BASE_DIR, "log/ledger.log"),
157
+ "formatter": "verbose",
158
+ "maxBytes": 1024 * 1024 * 5,
159
+ "backupCount": 5,
160
+ },
161
+ },
162
+ "loggers": {
163
+ "ledger": {
164
+ "handlers": ["ledger_file", "console"],
165
+ "level": "DEBUG",
166
+ },
167
+ },
168
+ }
169
+ LOGGING["handlers"].update(LOGGING_LEDGER["handlers"])
170
+ LOGGING["loggers"].update(LOGGING_LEDGER["loggers"])
171
+ ```
172
+
173
+ ## Highlights<a name="highlights"></a>
174
+
175
+ ![Screenshot 2024-05-14 121014](https://github.com/Geuthur/aa-ledger/assets/761682/d0604260-b672-4bf5-a16a-d1b90557744d)
176
+
177
+ ![Screenshot 2024-05-14 121025](https://github.com/Geuthur/aa-ledger/assets/761682/f8f20e6a-d37d-4a50-a1aa-8615c0f8e88b)
178
+
179
+ ![Screenshot 2024-05-14 120944](https://github.com/Geuthur/aa-ledger/assets/761682/2d695369-1331-4be9-8adf-9c6dabf80dda)
180
+
181
+ ![Screenshot 2024-05-14 121001](https://github.com/Geuthur/aa-ledger/assets/761682/463b9921-150c-42c1-8c3e-eee0f5cfc2bb)
182
+
183
+ > \[!NOTE\]
184
+ > Contributing
185
+ > You want to improve the project?
186
+ > Just Make a [Pull Request](https://github.com/Geuthur/aa-ledger/pulls) with the Guidelines.
187
+ > We Using pre-commit
@@ -0,0 +1,130 @@
1
+ # Ledger module for AllianceAuth.<a name="aa-ledger"></a>
2
+
3
+ [![pre-commit.ci status](https://results.pre-commit.ci/badge/github/Geuthur/aa-ledger/master.svg)](https://results.pre-commit.ci/latest/github/Geuthur/aa-ledger/master)
4
+ [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
5
+ [![Tests](https://github.com/Geuthur/aa-ledger/actions/workflows/autotester.yml/badge.svg)](https://github.com/Geuthur/aa-ledger/actions/workflows/autotester.yml)
6
+
7
+ - [AA Ledger](#aa-ledger)
8
+ - [Features](#features)
9
+ - [Upcoming](#upcoming)
10
+ - [Installation](#features)
11
+ - [Step 1 - Install the Package](#step1)
12
+ - [Step 2 - Configure Alliance Auth](#step2)
13
+ - [Step 3 - Add the Scheduled Tasks](#step3)
14
+ - [Step 4 - Migration to AA](#step4)
15
+ - [Step 5 - Setting up Permissions](#step5)
16
+ - [Step 6 - (Optional) Setting up Compatibilies](#step6)
17
+ - [Highlights](#highlights)
18
+
19
+ ## Features<a name="features"></a>
20
+
21
+ - Graphical Overview
22
+ - Ratting,Mining,Trading
23
+ - Character Ledger
24
+ - Corporation Ledger
25
+
26
+ ## Upcoming<a name="upcoming"></a>
27
+
28
+ - Corp Tax System (Tracks specific amount that transfer'd to specific division)
29
+ - Events Calender
30
+
31
+ ## Installation<a name="installation"></a>
32
+
33
+ ### Step 1 - Install the Package<a name="step1"></a>
34
+
35
+ Make sure you're in your virtual environment (venv) of your Alliance Auth then install the pakage.
36
+
37
+ ```shell
38
+ pip install aa-ledger
39
+ ```
40
+
41
+ ### Step 2 - Configure Alliance Auth<a name="step2"></a>
42
+
43
+ Configure your Alliance Auth settings (`local.py`) as follows:
44
+
45
+ - Add `'allianceauth.corputils',` to `INSTALLED_APPS`
46
+ - Add `'eveuniverse',` to `INSTALLED_APPS`
47
+ - Add `'ledger',` to `INSTALLED_APPS`
48
+
49
+ ### Step 3 - Add the Scheduled Tasks<a name="step3"></a>
50
+
51
+ To set up the Scheduled Tasks add following code to your `local.py`
52
+
53
+ ```python
54
+ CELERYBEAT_SCHEDULE["ledger_character_audit_update_all"] = {
55
+ "task": "ledger.tasks.update_all_characters",
56
+ "schedule": crontab(hour="*/1"),
57
+ }
58
+ CELERYBEAT_SCHEDULE["ledger_corporation_audit_update_all"] = {
59
+ "task": "ledger.tasks.update_all_corps",
60
+ "schedule": crontab(hour="*/1"),
61
+ }
62
+ ```
63
+
64
+ ### Step 4 - Migration to AA<a name="step4"></a>
65
+
66
+ ```shell
67
+ python manage.py collectstatic
68
+ python manage.py migrate
69
+ ```
70
+
71
+ ### Step 5 - Setting up Permissions<a name="step5"></a>
72
+
73
+ With the Following IDs you can set up the permissions for the Ledger
74
+
75
+ | ID | Description | |
76
+ | :------------------------ | :------------------------------------- | :-------------------------------------------------------------------------------------- |
77
+ | `basic_access` | Can access the Ledger module | All Members with the Permission can access the Ledger. |
78
+ | `moderator_access` | Has access to moderation tools | Not Implemented yet. |
79
+ | `admin_access` | Has access to all Administration tools | Not Implemented yet. |
80
+ | `char_audit_admin_access` | Can Manage Character Audit Module | Can Manage Character Audit Module, Like Add Memeberaudit Chars, View Character Journals |
81
+ | `corp_audit_admin_access` | Can Manage Corporation Audit Module | Can Manage Corporation Audit Module, Like Add Corp, View Corporation Journals |
82
+
83
+ ### Step 6 - (Optional) Setting up Compatibilies<a name="step6"></a>
84
+
85
+ The Following Settings can be setting up in the `local.py`
86
+
87
+ - LEDGER_LOGGER_USE: `True / False`
88
+ - LEDGER_MEMBERAUDIT_USE: `True / False`
89
+ - LEDGER_CORPSTATS_TWO: `True / False`
90
+
91
+ If you set up LEDGER_LOGGER_USE to `True` you need to add the following code below:
92
+
93
+ ```python
94
+ LOGGING_LEDGER = {
95
+ "handlers": {
96
+ "ledger_file": {
97
+ "level": "DEBUG",
98
+ "class": "logging.handlers.RotatingFileHandler",
99
+ "filename": os.path.join(BASE_DIR, "log/ledger.log"),
100
+ "formatter": "verbose",
101
+ "maxBytes": 1024 * 1024 * 5,
102
+ "backupCount": 5,
103
+ },
104
+ },
105
+ "loggers": {
106
+ "ledger": {
107
+ "handlers": ["ledger_file", "console"],
108
+ "level": "DEBUG",
109
+ },
110
+ },
111
+ }
112
+ LOGGING["handlers"].update(LOGGING_LEDGER["handlers"])
113
+ LOGGING["loggers"].update(LOGGING_LEDGER["loggers"])
114
+ ```
115
+
116
+ ## Highlights<a name="highlights"></a>
117
+
118
+ ![Screenshot 2024-05-14 121014](https://github.com/Geuthur/aa-ledger/assets/761682/d0604260-b672-4bf5-a16a-d1b90557744d)
119
+
120
+ ![Screenshot 2024-05-14 121025](https://github.com/Geuthur/aa-ledger/assets/761682/f8f20e6a-d37d-4a50-a1aa-8615c0f8e88b)
121
+
122
+ ![Screenshot 2024-05-14 120944](https://github.com/Geuthur/aa-ledger/assets/761682/2d695369-1331-4be9-8adf-9c6dabf80dda)
123
+
124
+ ![Screenshot 2024-05-14 121001](https://github.com/Geuthur/aa-ledger/assets/761682/463b9921-150c-42c1-8c3e-eee0f5cfc2bb)
125
+
126
+ > \[!NOTE\]
127
+ > Contributing
128
+ > You want to improve the project?
129
+ > Just Make a [Pull Request](https://github.com/Geuthur/aa-ledger/pulls) with the Guidelines.
130
+ > We Using pre-commit
@@ -0,0 +1,8 @@
1
+ """Initialize the app"""
2
+
3
+ from ledger.app_settings import LEDGER_APP_NAME
4
+
5
+ __version__ = "0.3.3"
6
+ __title__ = "Ledger"
7
+
8
+ USER_AGENT_TEXT = f"{LEDGER_APP_NAME} v{__version__}"
@@ -0,0 +1,110 @@
1
+ """Admin models"""
2
+
3
+ from django.contrib import admin
4
+ from django.utils.html import format_html
5
+
6
+ from allianceauth.eveonline.evelinks import eveimageserver
7
+
8
+ from ledger.models.characteraudit import CharacterAudit
9
+ from ledger.models.corporationaudit import CorporationAudit
10
+
11
+
12
+ @admin.register(CorporationAudit)
13
+ class CorporationAuditAdmin(admin.ModelAdmin):
14
+ list_display = (
15
+ "_entity_pic",
16
+ "_corporation__corporation_id",
17
+ "_last_update_wallet",
18
+ )
19
+
20
+ list_display_links = (
21
+ "_entity_pic",
22
+ "_corporation__corporation_id",
23
+ )
24
+
25
+ list_select_related = ("corporation",)
26
+
27
+ ordering = ["corporation__corporation_name"]
28
+
29
+ search_fields = ["corporation__corporation_name", "corporation__corporation_id"]
30
+
31
+ actions = [
32
+ "delete_objects",
33
+ ]
34
+
35
+ @admin.display(description="")
36
+ def _entity_pic(self, obj: CorporationAudit):
37
+ eve_id = obj.corporation.corporation_id
38
+ return format_html(
39
+ '<img src="{}" class="img-circle">',
40
+ eveimageserver._eve_entity_image_url("corporation", eve_id, 32),
41
+ )
42
+
43
+ @admin.display(description="Corporation ID", ordering="corporation__corporation_id")
44
+ def _corporation__corporation_id(self, obj: CorporationAudit):
45
+ return obj.corporation.corporation_id
46
+
47
+ @admin.display(description="Last Update Wallet", ordering="last_update_wallet")
48
+ def _last_update_wallet(self, obj: CorporationAudit):
49
+ return obj.last_update_wallet
50
+
51
+ # pylint: disable=unused-argument
52
+ def has_add_permission(self, request):
53
+ return False
54
+
55
+ # pylint: disable=unused-argument
56
+ def has_change_permission(self, request, obj=None):
57
+ return False
58
+
59
+
60
+ @admin.register(CharacterAudit)
61
+ class CharacterAuditAdmin(admin.ModelAdmin):
62
+ list_display = (
63
+ "_entity_pic",
64
+ "_character__character_name",
65
+ "_last_update_wallet",
66
+ "_last_update_mining",
67
+ )
68
+
69
+ list_display_links = (
70
+ "_entity_pic",
71
+ "_character__character_name",
72
+ )
73
+
74
+ list_select_related = ("character",)
75
+
76
+ ordering = ["character__character_name"]
77
+
78
+ search_fields = ["character__character_name"]
79
+
80
+ actions = [
81
+ "delete_objects",
82
+ ]
83
+
84
+ @admin.display(description="")
85
+ def _entity_pic(self, obj: CharacterAudit):
86
+ eve_id = obj.character.character_id
87
+ return format_html(
88
+ '<img src="{}" class="img-circle">',
89
+ eveimageserver._eve_entity_image_url("character", eve_id, 32),
90
+ )
91
+
92
+ @admin.display(description="Character Name", ordering="character__character_name")
93
+ def _character__character_name(self, obj: CharacterAudit):
94
+ return obj.character.character_name
95
+
96
+ @admin.display(description="Last Update Wallet", ordering="last_update_wallet")
97
+ def _last_update_wallet(self, obj: CharacterAudit):
98
+ return obj.last_update_wallet
99
+
100
+ @admin.display(description="Last Update Mining", ordering="last_update_mining")
101
+ def _last_update_mining(self, obj: CharacterAudit):
102
+ return obj.last_update_mining
103
+
104
+ # pylint: disable=unused-argument
105
+ def has_add_permission(self, request):
106
+ return False
107
+
108
+ # pylint: disable=unused-argument
109
+ def has_change_permission(self, request, obj=None):
110
+ return False
@@ -0,0 +1,24 @@
1
+ from ninja import NinjaAPI
2
+ from ninja.security import django_auth
3
+
4
+ from django.conf import settings
5
+
6
+ from ledger.api import character, corporation
7
+ from ledger.hooks import get_extension_logger
8
+
9
+ logger = get_extension_logger(__name__)
10
+
11
+ api = NinjaAPI(
12
+ title="Geuthur API",
13
+ version="0.1.0",
14
+ urls_namespace="ledger:new_api",
15
+ auth=django_auth,
16
+ csrf=True,
17
+ openapi_url=settings.DEBUG and "/openapi.json" or "",
18
+ )
19
+
20
+ # Add the character endpoints
21
+ character.setup(api)
22
+
23
+ # Add the corporation endpoints
24
+ corporation.setup(api)
@@ -0,0 +1,7 @@
1
+ from .ledger import LedgerApiEndpoints
2
+ from .template import LedgerTemplateApiEndpoints
3
+
4
+
5
+ def setup(api):
6
+ LedgerApiEndpoints(api)
7
+ LedgerTemplateApiEndpoints(api)