diff --git a/allianceauth/theme/bootstrap/auth_hooks.py b/allianceauth/theme/bootstrap/auth_hooks.py index 5d159de4..4203df9f 100644 --- a/allianceauth/theme/bootstrap/auth_hooks.py +++ b/allianceauth/theme/bootstrap/auth_hooks.py @@ -2,6 +2,20 @@ from allianceauth import hooks from allianceauth.theme.hooks import ThemeHook +CSS_STATICS = [{ + "url": "https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.2/css/bootstrap.min.css", + "integrity": "sha512-b2QcS5SsA8tZodcDtGRELiGv5SaKSk1vDHDaQRda0htPYWZ6046lr3kJ5bAAQdpV2mmA/4v0wQF9MyU6/pDIAg==" +}] + +JS_STATICS = [{ + "url": "https://cdnjs.cloudflare.com/ajax/libs/popper.js/2.11.8/umd/popper.min.js", + "integrity": "sha512-TPh2Oxlg1zp+kz3nFA0C5vVC6leG/6mm1z9+mA81MI5eaUVqasPLO8Cuk4gMF4gUfP5etR73rgU/8PNMsSesoQ==" +}, { + "url": "https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.2/js/bootstrap.min.js", + "integrity": "sha512-WW8/jxkELe2CAiE4LvQfwm1rajOS8PHasCCx+knHG0gBHt8EXxS6T6tJRTGuDQVnluuAvMxWF4j8SNFDKceLFg==" +}] + + class BootstrapThemeHook(ThemeHook): """ Bootstrap in all its glory! @@ -13,21 +27,35 @@ class BootstrapThemeHook(ThemeHook): self, "Bootstrap", "Powerful, extensible, and feature-packed frontend toolkit.", - css=[{ - "url": "https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.2/css/bootstrap.min.css", - "integrity": "sha512-b2QcS5SsA8tZodcDtGRELiGv5SaKSk1vDHDaQRda0htPYWZ6046lr3kJ5bAAQdpV2mmA/4v0wQF9MyU6/pDIAg==" - }], - js=[{ - "url": "https://cdnjs.cloudflare.com/ajax/libs/popper.js/2.11.8/umd/popper.min.js", - "integrity": "sha512-TPh2Oxlg1zp+kz3nFA0C5vVC6leG/6mm1z9+mA81MI5eaUVqasPLO8Cuk4gMF4gUfP5etR73rgU/8PNMsSesoQ==" - }, { - "url": "https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.2/js/bootstrap.min.js", - "integrity": "sha512-WW8/jxkELe2CAiE4LvQfwm1rajOS8PHasCCx+knHG0gBHt8EXxS6T6tJRTGuDQVnluuAvMxWF4j8SNFDKceLFg==" - }], + css=CSS_STATICS, + js=JS_STATICS, + header_padding="3.5em" + ) + + +class BootstrapDarkThemeHook(ThemeHook): + """ + Bootstrap in all its glory!, but _dark_ + https://getbootstrap.com/ + """ + + def __init__(self): + ThemeHook.__init__( + self, + "Bootstrap Dark", + "Powerful, extensible, and feature-packed frontend toolkit.", + css=CSS_STATICS, + js=JS_STATICS, + html_tags="data-bs-theme=dark", header_padding="3.5em" ) +@hooks.register('theme_hook') +def register_bootstrap_dark_hook(): + return BootstrapDarkThemeHook() + + @hooks.register('theme_hook') def register_bootstrap_hook(): return BootstrapThemeHook() diff --git a/allianceauth/theme/bootstrap_dark/__init__.py b/allianceauth/theme/bootstrap_dark/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/allianceauth/theme/bootstrap_dark/apps.py b/allianceauth/theme/bootstrap_dark/apps.py deleted file mode 100644 index f0055e03..00000000 --- a/allianceauth/theme/bootstrap_dark/apps.py +++ /dev/null @@ -1,11 +0,0 @@ -from django.apps import AppConfig - - -class BootstrapDarkThemeConfig(AppConfig): - name = "allianceauth.theme.bootstrap_dark" - label = "bootstrap_dark" - version = "5.3.0" - verbose_name = f"Bootstrap Dark v{version}" - - def ready(self): - pass diff --git a/allianceauth/theme/bootstrap_dark/auth_hooks.py b/allianceauth/theme/bootstrap_dark/auth_hooks.py deleted file mode 100644 index 4e6b7447..00000000 --- a/allianceauth/theme/bootstrap_dark/auth_hooks.py +++ /dev/null @@ -1,34 +0,0 @@ -from allianceauth import hooks -from allianceauth.theme.hooks import ThemeHook - - -class BootstrapDarkThemeHook(ThemeHook): - """ - Bootstrap in all its glory!, but _dark_ - https://getbootstrap.com/ - """ - - def __init__(self): - ThemeHook.__init__( - self, - "Bootstrap Dark", - "Powerful, extensible, and feature-packed frontend toolkit.", - css=[{ - "url": "https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.2/css/bootstrap.min.css", - "integrity": "sha512-b2QcS5SsA8tZodcDtGRELiGv5SaKSk1vDHDaQRda0htPYWZ6046lr3kJ5bAAQdpV2mmA/4v0wQF9MyU6/pDIAg==" - }], - js=[{ - "url": "https://cdnjs.cloudflare.com/ajax/libs/popper.js/2.11.8/umd/popper.min.js", - "integrity": "sha512-TPh2Oxlg1zp+kz3nFA0C5vVC6leG/6mm1z9+mA81MI5eaUVqasPLO8Cuk4gMF4gUfP5etR73rgU/8PNMsSesoQ==" - }, { - "url": "https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.2/js/bootstrap.min.js", - "integrity": "sha512-WW8/jxkELe2CAiE4LvQfwm1rajOS8PHasCCx+knHG0gBHt8EXxS6T6tJRTGuDQVnluuAvMxWF4j8SNFDKceLFg==" - }], - html_tags="data-bs-theme=dark", - header_padding="3.5em" - ) - - -@hooks.register('theme_hook') -def register_bootstrap_dark_hook(): - return BootstrapDarkThemeHook()