mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-27 13:12:29 +02:00
Compare commits
No commits in common. "147858801632e3c3a52750a601a13b60d4d5d5a5" and "702564d15e2fa692d80c796f0ed45ccd0c37b72d" have entirely different histories.
1478588016
...
702564d15e
@ -13,15 +13,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
/* Image overflow fix
|
||||
------------------------------------------------------------------------------------- */
|
||||
@media all {
|
||||
img {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
}
|
||||
|
||||
/* Side Navigation
|
||||
------------------------------------------------------------------------------------- */
|
||||
@media all {
|
||||
|
@ -8,16 +8,14 @@ class ThemeHook:
|
||||
"""
|
||||
|
||||
def __init__(self,
|
||||
name: str,
|
||||
description: str,
|
||||
css: List[dict],
|
||||
js: List[dict],
|
||||
css_template: Optional[str] = None,
|
||||
js_template: Optional[str] = None,
|
||||
js_type: Optional[str] = None,
|
||||
html_tags: Optional[Union[dict, str]] = None,
|
||||
header_padding: Optional[str] = "4em"
|
||||
):
|
||||
name: str,
|
||||
description: str,
|
||||
css: List[dict],
|
||||
js: List[dict],
|
||||
css_template: Optional[str] = None,
|
||||
js_template: Optional[str] = None,
|
||||
html_tags: Optional[Union[dict, str]] = None,
|
||||
header_padding: Optional[str] = "4em"):
|
||||
"""
|
||||
:param name: Theme python name
|
||||
:type name: str
|
||||
@ -31,14 +29,11 @@ class ThemeHook:
|
||||
:type css_template: Optional[str], optional
|
||||
:param js_template: _description_, defaults to None
|
||||
:type js_template: Optional[str], optional
|
||||
:param js_type: The type of the JS (e.g.: 'module'), defaults to None
|
||||
:type js_type: Optional[str], optional
|
||||
:param html_tags: Attributes added to the `<html>` tag, defaults to None
|
||||
:type html_tags: Optional[dict|str], optional
|
||||
:param header_padding: Top padding, defaults to "4em"
|
||||
:type header_padding: Optional[str], optional
|
||||
"""
|
||||
|
||||
self.name = name
|
||||
self.description = description
|
||||
|
||||
@ -50,15 +45,11 @@ class ThemeHook:
|
||||
self.css_template = css_template
|
||||
self.js_template = js_template
|
||||
|
||||
# Define the JS type (e.g.: 'module')
|
||||
self.js_type = js_type
|
||||
|
||||
self.html_tags = (
|
||||
" ".join([f"{key}={value}" for key, value in html_tags.items()])
|
||||
if isinstance(html_tags, dict)
|
||||
else html_tags
|
||||
)
|
||||
self.header_padding = header_padding
|
||||
|
||||
def get_name(self):
|
||||
return f"{self.__class__.__module__}.{self.__class__.__name__}"
|
||||
|
@ -4,13 +4,7 @@
|
||||
{% include theme.js_template %}
|
||||
{% else %}
|
||||
{% for x in theme.js %}
|
||||
<script
|
||||
{% if x.js_type %}type="{{ x.js_type }}"{% endif %}
|
||||
src="{{ x.url }}"
|
||||
integrity="{{ x.integrity }}"
|
||||
crossorigin="anonymous"
|
||||
referrerpolicy="no-referrer"
|
||||
></script>
|
||||
<script src="{{ x.url }}" integrity="{{ x.integrity }}" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
<!-- allianceauth.theme.{{ theme.name }} JS Ends-->
|
||||
|
Loading…
x
Reference in New Issue
Block a user