mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-09 19:40:19 +00:00
Add documentation for htmx
This commit is contained in:
@ -327,6 +327,8 @@ class DetailFormView(SingleObjectMixin, FormView):
|
||||
|
||||
|
||||
class AllowFragment:
|
||||
"""Add `is_fragment` to templates. It's only True if the request is emitted by htmx"""
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
kwargs["is_fragment"] = self.request.headers.get("HX-Request", False)
|
||||
return super().get_context_data(**kwargs)
|
||||
|
Reference in New Issue
Block a user