Skip to content

Commit

Permalink
add js catalog
Browse files Browse the repository at this point in the history
  • Loading branch information
nicokant committed Jan 27, 2025
1 parent afb2241 commit b8f64db
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/apps/core/templates/core/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
{% block modal %}
{% endblock modal %}
{% block body_javascript %}
<script src="{% url 'javascript-catalog' %}"></script>
<script src="//unpkg.com/alpinejs" defer></script>

<script src="{% static 'js/app.js' %}"></script>
Expand Down
6 changes: 6 additions & 0 deletions src/config/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from django.urls import include, path, reverse_lazy
from django.views import defaults as default_views
from django.views import generic
from django.views.i18n import JavaScriptCatalog


class HomeView(LoginRequiredMixin, generic.RedirectView):
Expand All @@ -23,6 +24,11 @@ def get_redirect_url(self, *args: Any, **kwargs: Any) -> str | None:
path("", include("genlab_bestilling.urls")),
path("", include("nina.urls", namespace="nina")),
path("staff/", include("genlab_bestilling.staff.urls", namespace="staff")),
path(
"jsi18n/",
(JavaScriptCatalog.as_view(packages=["formset"])),
name="javascript-catalog",
),
]


Expand Down
4 changes: 4 additions & 0 deletions src/genlab_bestilling/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,10 @@ def save(self, commit=True):
with transaction.atomic():
obj = super().save(commit=False)
obj.genrequest = self.genrequest

if obj.customize_markers:
obj.from_order = None

if obj.from_order and not obj.name and obj.from_order.name:
obj.name = obj.from_order.name + " - Analysis"
obj.save()
Expand Down

0 comments on commit b8f64db

Please sign in to comment.