-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
218 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,5 @@ __pycache__ | |
.coverage | ||
/coverage.xml | ||
alliance_auth.sqlite3 | ||
|
||
/aa_bulletin_board/locale/en/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
""" | ||
Constants used in this app | ||
""" | ||
|
||
# Standard Library | ||
import os | ||
|
||
AA_BULLETIN_BOARD_BASE_DIR = os.path.join(os.path.dirname(__file__)) | ||
AA_BULLETIN_BOARD_STATIC_DIR = os.path.join( | ||
AA_BULLETIN_BOARD_BASE_DIR, "static", "aa_bulletin_board" | ||
) |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
""" | ||
Helper functions for static integrity calculations | ||
""" | ||
|
||
# Standard Library | ||
import os | ||
from pathlib import Path | ||
|
||
# Third Party | ||
from sri import Algorithm, calculate_integrity | ||
|
||
# Alliance Auth | ||
from allianceauth.services.hooks import get_extension_logger | ||
|
||
# Alliance Auth (External Libs) | ||
from app_utils.logging import LoggerAddTag | ||
|
||
# AA Bulletin Board | ||
from aa_bulletin_board import __title__ | ||
from aa_bulletin_board.constants import AA_BULLETIN_BOARD_STATIC_DIR | ||
|
||
logger = LoggerAddTag(my_logger=get_extension_logger(__name__), prefix=__title__) | ||
|
||
|
||
def calculate_integrity_hash(relative_file_path: str) -> str: | ||
""" | ||
Calculates the integrity hash for a given static file | ||
:param self: | ||
:type self: | ||
:param relative_file_path: The file path relative to the `aa-timezones/timezones/static/timezones` folder | ||
:type relative_file_path: str | ||
:return: The integrity hash | ||
:rtype: str | ||
""" | ||
|
||
file_path = os.path.join(AA_BULLETIN_BOARD_STATIC_DIR, relative_file_path) | ||
integrity_hash = calculate_integrity(Path(file_path), Algorithm.SHA512) | ||
|
||
return integrity_hash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
aa_bulletin_board/templates/aa_bulletin_board/bundles/aa-bulletin-board-css.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{% load aa_bulletin_board %} | ||
|
||
<link rel="stylesheet" href="{% aa_bulletin_board_static 'aa_bulletin_board/css/aa-bulletin-board.min.css' %}"> | ||
{% aa_bulletin_board_static "css/aa-bulletin-board.min.css" %} |
2 changes: 1 addition & 1 deletion
2
aa_bulletin_board/templates/aa_bulletin_board/bundles/aa-bulletin-board-equal-height-js.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{% load aa_bulletin_board %} | ||
|
||
<script src="{% aa_bulletin_board_static 'aa_bulletin_board/javascript/aa-bulletin-board-equal-height.min.js' %}"></script> | ||
{% aa_bulletin_board_static "javascript/aa-bulletin-board-equal-height.min.js" %} |
2 changes: 1 addition & 1 deletion
2
aa_bulletin_board/templates/aa_bulletin_board/bundles/aa-bulletin-board-oembed-js.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{% load aa_bulletin_board %} | ||
|
||
<script src="{% aa_bulletin_board_static 'aa_bulletin_board/javascript/aa-bulletin-board-oembed.min.js' %}"></script> | ||
{% aa_bulletin_board_static "javascript/aa-bulletin-board-oembed.min.js" %} |
4 changes: 2 additions & 2 deletions
4
aa_bulletin_board/templates/aa_bulletin_board/bundles/ckeditor5-css.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{% load static %} | ||
{% load sri %} | ||
|
||
<link href="{% static 'django_ckeditor_5/dist/styles.css' %}" media="all" rel="stylesheet"> | ||
{% sri_static "django_ckeditor_5/dist/styles.css" %} |
4 changes: 2 additions & 2 deletions
4
aa_bulletin_board/templates/aa_bulletin_board/bundles/ckeditor5-js.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{% load static %} | ||
{% load sri %} | ||
|
||
<script src="{% static 'django_ckeditor_5/dist/bundle.js' %}"></script> | ||
{% sri_static "django_ckeditor_5/dist/bundle.js" %} |
4 changes: 2 additions & 2 deletions
4
aa_bulletin_board/templates/aa_bulletin_board/bundles/sumoselect-css.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{% load static %} | ||
{% load aa_bulletin_board %} | ||
|
||
<link rel="stylesheet" href="{% static 'aa_bulletin_board/libs/sumoselect/3.4.9/sumoselect.min.css' %}"> | ||
{% aa_bulletin_board_static "libs/sumoselect/3.4.9/sumoselect.min.css" %} |
4 changes: 2 additions & 2 deletions
4
aa_bulletin_board/templates/aa_bulletin_board/bundles/sumoselect-js.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{% load static %} | ||
{% load aa_bulletin_board %} | ||
|
||
<script src="{% static 'aa_bulletin_board/libs/sumoselect/3.4.9/jquery.sumoselect.min.js' %}"></script> | ||
{% aa_bulletin_board_static 'libs/sumoselect/3.4.9/jquery.sumoselect.min.js' %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters