Remove the need of inline scripting

This commit is contained in:
2026-01-15 12:42:12 +01:00
parent 650a93676e
commit d1e741ebfd
7 changed files with 59 additions and 5 deletions

View File

@@ -7,7 +7,7 @@ from urllib.parse import unquote
from django.conf import settings
from django.views import View
from django.urls import Resolver404
from django.http import Http404, HttpResponseBadRequest
from django.http import Http404, HttpResponse, HttpResponseBadRequest
from django.db.utils import OperationalError, ProgrammingError
from django.db.models import F, Q, Count
from django.db.models.functions import Lower
@@ -78,6 +78,16 @@ class Render404(View):
)
class RenderExtraJS(View):
def get(self, request):
try:
extra_js = get_site_conf().extra_js
except (OperationalError, ProgrammingError):
extra_js = ""
return HttpResponse(extra_js, content_type="application/javascript")
class GetData(View):
title = None
template = "pagination.html"