Introduce htmx in sith files

* Convert FileModerationView into ListView and add pagination with htmx
* Don't allow sas moderation in file moderation view
* Split up base.jinja and introduce base_fragment.jinja
* Improve FileModerationView performances and make it root only
* Add permissions tests for file modération
This commit is contained in:
2024-10-13 23:26:18 +02:00
parent c7a8a1a91c
commit 3af5d96bf5
16 changed files with 429 additions and 249 deletions

View File

@ -326,6 +326,12 @@ class DetailFormView(SingleObjectMixin, FormView):
return super().get_object()
class AllowFragment:
def get_context_data(self, **kwargs):
kwargs["is_fragment"] = self.request.headers.get("HX-Request", False)
return super().get_context_data(**kwargs)
# F403: those star-imports would be hellish to refactor
# E402: putting those import at the top of the file would also be difficult
from .files import * # noqa: F403 E402