cmShoppingList 0.11__py3-none-any.whl

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.
@@ -0,0 +1,5 @@
1
+ """Shopping List plugin app for Alliance Auth."""
2
+
3
+ # pylint: disable = invalid-name
4
+ default_app_config = "cmShoppingList.apps.DefaultConfig"
5
+ __version__ = "0.11"
@@ -0,0 +1,5 @@
1
+ """Admin site."""
2
+
3
+ # from django.contrib import admin
4
+
5
+ # Register your models for the admin site here.
@@ -0,0 +1,6 @@
1
+ """App settings."""
2
+
3
+ from django.conf import settings
4
+
5
+ CM_VERSION = "0.10"
6
+ HEADER_MESSAGE = getattr(settings, "SHOPPING_LIST_HEADER_MESSAGE", "OMG daddy, please take me shopping at JITA!")
cmShoppingList/apps.py ADDED
@@ -0,0 +1,7 @@
1
+ from django.apps import AppConfig
2
+
3
+
4
+ class DefaultConfig(AppConfig):
5
+ name = "cmShoppingList"
6
+ label = "cmShoppingList"
7
+ verbose_name = "Shopping List"
@@ -0,0 +1,34 @@
1
+ from django.utils.translation import gettext_lazy as _
2
+
3
+ from allianceauth import hooks
4
+ from allianceauth.services.hooks import MenuItemHook, UrlHook
5
+
6
+ from . import urls
7
+
8
+
9
+ class CMShoppingListMenuItem(MenuItemHook):
10
+ """This class ensures only authorized users will see the menu entry"""
11
+
12
+ def __init__(self):
13
+ # setup menu entry for sidebar
14
+ MenuItemHook.__init__(
15
+ self,
16
+ _("Shopping List"),
17
+ "fas fa-cart-shopping fa-fw",
18
+ "cmShoppingList:index"
19
+ )
20
+
21
+ def render(self, request):
22
+ if request.user.has_perm("cmShoppingList.basic_access"):
23
+ return MenuItemHook.render(self, request)
24
+ return ""
25
+
26
+
27
+ @hooks.register("menu_item_hook")
28
+ def register_menu():
29
+ return CMShoppingListMenuItem()
30
+
31
+
32
+ @hooks.register("url_hook")
33
+ def register_urls():
34
+ return UrlHook(urls, "cmShoppingList", r"^cmShoppingList/")
File without changes