Skip to content

Commit

Permalink
fix: add htmx debugging (#407)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexCLeduc authored Dec 27, 2024
1 parent 27d8e5e commit 57fd7cc
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion server/cpho/jinja2/base.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<script src="{{ static('third_party/js/idiomorph.min.js') }}"></script>
<script src="{{ static('third_party/js/idiomorph-ext.min.js') }}"></script>
<script src="{{ static('js/tooltip_accessibility.js') }}"></script>
{% if debug %}<script src="{{ static('third_party/js/htmx-debug.js') }}"></script>{% endif %}
{% if debug %}{{ django_htmx_script() }}{% endif %}
{% block medias %}{% endblock %}
{% block extra_scripts_css %}{% endblock %}
</head>
Expand Down
2 changes: 2 additions & 0 deletions server/cpho/jinja_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from django.utils.translation import activate, get_language

import phac_aspc.django.helpers.templatetags as phac_aspc
from django_htmx.templatetags.django_htmx import django_htmx_script
from jinja2 import Environment, pass_context
from phac_aspc.rules import test_rule

Expand Down Expand Up @@ -183,6 +184,7 @@ def environment(**options):
"hasattr": hasattr,
"len": len,
"list": list,
"django_htmx_script": django_htmx_script,
"url": reverse,
"url_to_other_lang": url_to_other_lang,
"get_lang_code": get_lang_code,
Expand Down
1 change: 1 addition & 0 deletions server/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ django-debug-toolbar==4.4.2
django-data-fetcher==2.2
django-graphiql-debug-toolbar==0.2.0
django-extensions==3.2.3
django-htmx==1.21.0
django-htmx-autocomplete==1.0.5
django-phac_aspc-helpers==3.1.1
Django==5.0.9
Expand Down
2 changes: 2 additions & 0 deletions server/server/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@
),
"rules.apps.AutodiscoverRulesConfig",
"ckeditor",
"django_htmx",
]
)

Expand All @@ -218,6 +219,7 @@
"data_fetcher.middleware.GlobalRequestMiddleware",
"versionator.middleware.WhodidMiddleware",
"server.middleware.MustBeLoggedInMiddleware",
"django_htmx.middleware.HtmxMiddleware",
]
)

Expand Down

0 comments on commit 57fd7cc

Please sign in to comment.