From 2dd4fd5c710775be9409d1e3fc42077c4aef1675 Mon Sep 17 00:00:00 2001 From: Sli Date: Sun, 15 Jun 2025 15:04:07 +0200 Subject: [PATCH 1/5] Initial tab concept --- .../bundled/core/components/tabs-index.ts | 100 ++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 core/static/bundled/core/components/tabs-index.ts diff --git a/core/static/bundled/core/components/tabs-index.ts b/core/static/bundled/core/components/tabs-index.ts new file mode 100644 index 00000000..de6ff4f2 --- /dev/null +++ b/core/static/bundled/core/components/tabs-index.ts @@ -0,0 +1,100 @@ +import { registerComponent } from "#core:utils/web-components"; +import { html, render } from "lit-html"; +import { unsafeHTML } from "lit-html/directives/unsafe-html.js"; + +@registerComponent("ui-tab") +export class Tab extends HTMLElement { + static observedAttributes = ["title", "active"]; + private description = ""; + private inner = ""; + private initialized = false; + private active = false; + + attributeChangedCallback(name: string, _oldValue?: string, newValue?: string) { + const activeOld = this.active; + this.active = this.hasAttribute("active"); + if (this.active !== activeOld && this.active) { + this.dispatchEvent( + new CustomEvent("ui-tab-activated", { detail: this, bubbles: true }), + ); + } + + if (name === "title") { + this.description = newValue; + } + + this.render(); + } + + render() { + if (!this.initialized) { + return; + } + const active = this.active ? "active" : ""; + const tabContent = this.getContentHtml(); + const content = html` + +
+ ${unsafeHTML(tabContent)} +
+ `; + render(content, this); + } + + setActive(value: boolean) { + if (value) { + this.setAttribute("active", ""); + } else { + this.removeAttribute("active"); + } + } + + connectedCallback() { + this.inner = this.innerHTML; + this.innerHTML = ""; + this.initialized = true; + this.render(); + } + + getContentHtml() { + const content = this.getElementsByClassName("tab-content")[0]; + if (content !== undefined) { + return content.innerHTML; + } + return this.inner; + } + + setContentHtml(value: string) { + const content = this.getElementsByClassName("tab-content")[0]; + if (content !== undefined) { + content.innerHTML = value; + } + this.inner = value; + this.render(); + } +} + +@registerComponent("ui-tab-group") +export class TabGroup extends HTMLElement { + connectedCallback() { + this.classList.add("tabs", "shadow"); + this.addEventListener("ui-tab-activated", (event: CustomEvent) => { + const target = event.detail as Tab; + for (const tab of this.getElementsByTagName("ui-tab") as HTMLCollectionOf) { + if (tab !== target) { + tab.setActive(false); + } + } + }); + } +} From c904e41ea3ee00f6ca78daefe573773822c7c367 Mon Sep 17 00:00:00 2001 From: Sli Date: Sun, 15 Jun 2025 16:11:08 +0200 Subject: [PATCH 2/5] Replace tab macro with new tab web component --- .../bundled/core/components/tabs-index.ts | 64 ++++++++++++------- core/static/core/components/tabs.scss | 53 +++++++++++++++ core/static/core/style.scss | 46 ------------- core/templates/core/macros.jinja | 62 ------------------ .../templates/subscription/subscription.jinja | 18 +++--- 5 files changed, 105 insertions(+), 138 deletions(-) create mode 100644 core/static/core/components/tabs.scss diff --git a/core/static/bundled/core/components/tabs-index.ts b/core/static/bundled/core/components/tabs-index.ts index de6ff4f2..94dbe544 100644 --- a/core/static/bundled/core/components/tabs-index.ts +++ b/core/static/bundled/core/components/tabs-index.ts @@ -7,7 +7,6 @@ export class Tab extends HTMLElement { static observedAttributes = ["title", "active"]; private description = ""; private inner = ""; - private initialized = false; private active = false; attributeChangedCallback(name: string, _oldValue?: string, newValue?: string) { @@ -22,33 +21,30 @@ export class Tab extends HTMLElement { if (name === "title") { this.description = newValue; } - - this.render(); + this.dispatchEvent(new CustomEvent("ui-tab-updated", { bubbles: true })); } - render() { - if (!this.initialized) { - return; - } - const active = this.active ? "active" : ""; - const tabContent = this.getContentHtml(); - const content = html` + getButtonTemplate() { + return html` + `; + } + getContentTemplate() { + return html`
- ${unsafeHTML(tabContent)} + ${unsafeHTML(this.getContentHtml())}
`; - render(content, this); } setActive(value: boolean) { @@ -62,12 +58,10 @@ export class Tab extends HTMLElement { connectedCallback() { this.inner = this.innerHTML; this.innerHTML = ""; - this.initialized = true; - this.render(); } getContentHtml() { - const content = this.getElementsByClassName("tab-content")[0]; + const content = this.getElementsByClassName("tab-section")[0]; if (content !== undefined) { return content.innerHTML; } @@ -75,19 +69,23 @@ export class Tab extends HTMLElement { } setContentHtml(value: string) { - const content = this.getElementsByClassName("tab-content")[0]; + const content = this.getElementsByClassName("tab-section")[0]; if (content !== undefined) { content.innerHTML = value; } this.inner = value; - this.render(); } } @registerComponent("ui-tab-group") export class TabGroup extends HTMLElement { + private node: HTMLDivElement; + connectedCallback() { - this.classList.add("tabs", "shadow"); + this.node = document.createElement("div"); + this.node.classList.add("tabs", "shadow"); + this.appendChild(this.node); + this.addEventListener("ui-tab-activated", (event: CustomEvent) => { const target = event.detail as Tab; for (const tab of this.getElementsByTagName("ui-tab") as HTMLCollectionOf) { @@ -96,5 +94,27 @@ export class TabGroup extends HTMLElement { } } }); + this.addEventListener("ui-tab-updated", () => { + this.render(); + }); + + this.render(); + } + + render() { + const tabs = Array.prototype.slice.call( + this.getElementsByTagName("ui-tab"), + ) as Tab[]; + render( + html` +
+ ${tabs.map((tab) => tab.getButtonTemplate())} +
+
+ ${tabs.map((tab) => tab.getContentTemplate())} +
+ `, + this.node, + ); } } diff --git a/core/static/core/components/tabs.scss b/core/static/core/components/tabs.scss new file mode 100644 index 00000000..e8665967 --- /dev/null +++ b/core/static/core/components/tabs.scss @@ -0,0 +1,53 @@ +@import "core/static/core/colors"; + +ui-tab-group { + *[hidden] { + display: none; + } + + .tabs { + border-radius: 5px; + + .tab-headers { + display: flex; + flex-flow: row wrap; + background-color: $primary-neutral-light-color; + padding: 3px 12px 12px; + column-gap: 20px; + border-top-left-radius: 5px; + border-top-right-radius: 5px; + + .tab-header { + border: none; + padding-right: 0; + padding-left: 0; + font-size: 120%; + background-color: unset; + position: relative; + + &:after { + content: ''; + position: absolute; + bottom: 0; + left: 0; + width: 100%; + border-bottom: 4px solid darken($primary-neutral-light-color, 10%); + border-radius: 2px; + transition: all 0.2s ease-in-out; + } + + &:hover:after { + border-bottom-color: darken($primary-neutral-light-color, 20%); + } + + &.active:after { + border-bottom-color: $primary-dark-color; + } + } + } + + section { + padding: 20px; + } + } +} \ No newline at end of file diff --git a/core/static/core/style.scss b/core/static/core/style.scss index 107126ec..cbc125d7 100644 --- a/core/static/core/style.scss +++ b/core/static/core/style.scss @@ -352,52 +352,6 @@ body { text-align: center; } - .tabs { - border-radius: 5px; - - .tab-headers { - display: flex; - flex-flow: row wrap; - background-color: $primary-neutral-light-color; - padding: 3px 12px 12px; - column-gap: 20px; - border-top-left-radius: 5px; - border-top-right-radius: 5px; - - .tab-header { - border: none; - padding-right: 0; - padding-left: 0; - font-size: 120%; - background-color: unset; - position: relative; - - &:after { - content: ''; - position: absolute; - bottom: 0; - left: 0; - width: 100%; - border-bottom: 4px solid darken($primary-neutral-light-color, 10%); - border-radius: 2px; - transition: all 0.2s ease-in-out; - } - - &:hover:after { - border-bottom-color: darken($primary-neutral-light-color, 20%); - } - - &.active:after { - border-bottom-color: $primary-dark-color; - } - } - } - - section { - padding: 20px; - } - } - .tool_bar { overflow: auto; padding: 4px; diff --git a/core/templates/core/macros.jinja b/core/templates/core/macros.jinja index 40676258..ba42046f 100644 --- a/core/templates/core/macros.jinja +++ b/core/templates/core/macros.jinja @@ -245,65 +245,3 @@ {% endmacro %} - -{% macro tabs(tab_list, attrs = "") %} - {# Tab component - - Parameters: - tab_list: list[tuple[str, str]] The list of tabs to display. - Each element of the list is a tuple which first element - is the title of the tab and the second element its content - attrs: str Additional attributes to put on the enclosing div - - Example: - A basic usage would be as follow : - - {{ tabs([("title 1", "content 1"), ("title 2", "content 2")]) }} - - If you want to display more complex logic, you can define macros - and use those macros in parameters : - - {{ tabs([("title", my_macro())]) }} - - It's also possible to get and set the currently selected tab using Alpine. - Here, the title of the currently selected tab will be displayed. - Moreover, on page load, the tab will be opened on "tab 2". - -
-

- {{ tabs([("tab 1", "Hello"), ("tab 2", "World")], "x-model=current_tab") }} -
- - If you want to have translated tab titles, you can enclose the macro call - in a with block : - - {% with title=_("title"), content=_("Content") %} - {{ tabs([(tab1, content)]) }} - {% endwith %} - #} -
-
- {% for title, _ in tab_list %} - - {% endfor %} -
-
- {% for title, content in tab_list %} -
- {{ content }} -
- {% endfor %} -
-
-{% endmacro %} diff --git a/subscription/templates/subscription/subscription.jinja b/subscription/templates/subscription/subscription.jinja index 98916827..9046c296 100644 --- a/subscription/templates/subscription/subscription.jinja +++ b/subscription/templates/subscription/subscription.jinja @@ -12,6 +12,7 @@ So we give them here. If the aforementioned bug is resolved, you can remove this. #} {% block additional_js %} + {% endblock %} {% block additional_css %} + @@ -34,12 +36,12 @@ {% block content %}

{% trans %}New subscription{% endtrans %}

-
- {% with title1=_("Existing member"), title2=_("New member") %} - {{ tabs([ - (title1, form_fragment(existing_user_form, existing_user_post_url)), - (title2, form_fragment(new_user_form, new_user_post_url)), - ]) }} - {% endwith %} -
+ + + {{ form_fragment(existing_user_form, existing_user_post_url) }} + + + {{ form_fragment(new_user_form, new_user_post_url) }} + + {% endblock %} From 42434d10ca6e738013c3774e5911ac0f35e86d40 Mon Sep 17 00:00:00 2001 From: Sli Date: Sun, 15 Jun 2025 16:33:22 +0200 Subject: [PATCH 3/5] Remove jquery-ui tabs from counter --- .../bundled/counter/counter-click-index.ts | 5 -- counter/templates/counter/counter_click.jinja | 55 +++++++++---------- 2 files changed, 27 insertions(+), 33 deletions(-) diff --git a/counter/static/bundled/counter/counter-click-index.ts b/counter/static/bundled/counter/counter-click-index.ts index 296c6003..99f6bdb7 100644 --- a/counter/static/bundled/counter/counter-click-index.ts +++ b/counter/static/bundled/counter/counter-click-index.ts @@ -137,8 +137,3 @@ document.addEventListener("alpine:init", () => { }, })); }); - -$(() => { - // biome-ignore lint/suspicious/noExplicitAny: dealing with legacy jquery - ($("#products") as any).tabs(); -}); diff --git a/counter/templates/counter/counter_click.jinja b/counter/templates/counter/counter_click.jinja index 24e1c6ae..c1ecbe16 100644 --- a/counter/templates/counter/counter_click.jinja +++ b/counter/templates/counter/counter_click.jinja @@ -9,12 +9,14 @@ + {% endblock %} {% block additional_js %} + {% endblock %} {% block info_boxes %} @@ -205,35 +207,32 @@ {% trans %}No products available on this counter for this user{% endtrans %} {% else %} -
    + {% for category in categories.keys() -%} -
  • {{ category }}
  • - {%- endfor %} -
- {% for category in categories.keys() -%} -
-
{{ category }}
-
- {% for product in categories[category] -%} - - {%- endfor %} -
-
- {%- endfor %} + +
{{ category }}
+
+ {% for product in categories[category] -%} + + {%- endfor %} +
+
+ {% endfor %} + {% endif %} From 17129af1bb6f92bfd941b212bcb6bac01225fc12 Mon Sep 17 00:00:00 2001 From: Sli Date: Sun, 15 Jun 2025 17:08:44 +0200 Subject: [PATCH 4/5] Remove unused popup system and jquery-ui --- core/static/bundled/jquery-ui-index.js | 2 - core/static/core/js/script.js | 38 --------- core/static/core/style.scss | 25 ------ core/templates/core/base.jinja | 82 ++++++++----------- core/templates/core/file.jinja | 12 +-- core/templates/core/file_detail.jinja | 17 +--- core/templates/core/file_list.jinja | 2 +- core/templates/core/user_edit.jinja | 2 +- core/tests/test_files.py | 2 +- core/urls.py | 10 +-- core/views/__init__.py | 2 - core/views/files.py | 36 +------- core/views/forms.py | 24 ------ counter/templates/counter/stats.jinja | 4 - .../templates/eboutic/eboutic_checkout.jinja | 4 - eboutic/templates/eboutic/eboutic_main.jinja | 4 - package-lock.json | 16 +--- package.json | 1 - vite.config.mts | 4 - 19 files changed, 56 insertions(+), 231 deletions(-) delete mode 100644 core/static/bundled/jquery-ui-index.js diff --git a/core/static/bundled/jquery-ui-index.js b/core/static/bundled/jquery-ui-index.js deleted file mode 100644 index 92da2271..00000000 --- a/core/static/bundled/jquery-ui-index.js +++ /dev/null @@ -1,2 +0,0 @@ -// This is only used to import jquery-ui css files -import "jquery-ui/themes/base/all.css"; diff --git a/core/static/core/js/script.js b/core/static/core/js/script.js index 71748ffb..9be232dd 100644 --- a/core/static/core/js/script.js +++ b/core/static/core/js/script.js @@ -1,42 +1,4 @@ $(() => { - // const buttons = $('.choose_file_button') - const popups = $(".choose_file_widget"); - popups.dialog({ - autoOpen: false, - modal: true, - width: "90%", - create: (event) => { - const target = $(event.target); - target.parent().css({ - position: "fixed", - top: "5%", - bottom: "5%", - }); - target.css("height", "300px"); - }, - buttons: [ - { - text: "Choose", - click: function () { - $(`input[name=${$(this).attr("name")}]`).attr( - "value", - $("#file_id").attr("value"), - ); - $(this).dialog("close"); - }, - disabled: true, - }, - ], - }); - $(".choose_file_button") - .button() - .on("click", function () { - const popup = popups.filter(`[name=${$(this).attr("name")}]`); - popup.html( - '
', - ); - popup.dialog({ title: $(this).text() }).dialog("open"); - }); $("#quick_notif li").click(function () { $(this).hide(); }); diff --git a/core/static/core/style.scss b/core/static/core/style.scss index cbc125d7..2cff3dff 100644 --- a/core/static/core/style.scss +++ b/core/static/core/style.scss @@ -111,12 +111,6 @@ body { /*--------------------------------HEADER-------------------------------*/ -#popupheader { - width: 88%; - margin: 0 auto; - padding: 0.3em 1%; -} - #info_boxes { display: flex; flex-wrap: wrap; @@ -802,25 +796,6 @@ footer { } /*--------------------------------JQuery-------------------------------*/ - -.ui-state-active, -.ui-widget-content .ui-state-active, -.ui-widget-header .ui-state-active, -a.ui-button:active, -.ui-button:active, -.ui-button.ui-state-active:hover { - background: $primary-color; - border-color: $primary-color; -} - -.ui-corner-all, -.ui-corner-bottom, -.ui-corner-right, -.ui-corner-top, -.ui-corner-left { - border-radius: 0; -} - #club_detail { .club_logo { float: right; diff --git a/core/templates/core/base.jinja b/core/templates/core/base.jinja index a3afb49f..819ec222 100644 --- a/core/templates/core/base.jinja +++ b/core/templates/core/base.jinja @@ -14,10 +14,6 @@ - {% block jquery_css %} - {# Thile file is quite heavy (around 250kb), so declaring it in a block allows easy removal #} - - {% endblock %} @@ -30,11 +26,8 @@ - - - {% block additional_css %}{% endblock %} {% block additional_js %}{% endblock %} {% endblock %} @@ -47,35 +40,28 @@ {% csrf_token %} {% block header %} - {% if not popup %} - {% include "core/base/header.jinja" %} + {% include "core/base/header.jinja" %} - {% block info_boxes %} -
- {% set sith = get_sith() %} - {% if sith.alert_msg %} -
- {{ sith.alert_msg|markdown }} -
- {% endif %} - {% if sith.info_msg %} -
- {{ sith.info_msg|markdown }} -
- {% endif %} -
- {% endblock %} - - {% else %} -
{{ user.get_display_name() }}
- {% endif %} + {% block info_boxes %} +
+ {% set sith = get_sith() %} + {% if sith.alert_msg %} +
+ {{ sith.alert_msg|markdown }} +
+ {% endif %} + {% if sith.info_msg %} +
+ {{ sith.info_msg|markdown }} +
+ {% endif %} +
+ {% endblock %} {% endblock %} {% block nav %} - {% if not popup %} - {% include "core/base/navbar.jinja" %} - {% endif %} + {% include "core/base/navbar.jinja" %} {% endblock %}
@@ -102,24 +88,22 @@
- {% if not popup %} - - {% endif %} + {% block script %} -{% endblock %} - - - diff --git a/core/templates/core/file_list.jinja b/core/templates/core/file_list.jinja index 077a2bf9..5bb08d08 100644 --- a/core/templates/core/file_list.jinja +++ b/core/templates/core/file_list.jinja @@ -12,7 +12,7 @@ {% else %} {% endif %} - {{ f.name }} + {{ f.name }} {% endfor %} {% else %} diff --git a/core/templates/core/user_edit.jinja b/core/templates/core/user_edit.jinja index 64227d8e..8d015467 100644 --- a/core/templates/core/user_edit.jinja +++ b/core/templates/core/user_edit.jinja @@ -74,7 +74,7 @@ {%- if this_picture -%} {% set default_picture = this_picture.get_download_url()|tojson %} {% set delete_url = ( - url('core:file_delete', file_id=this_picture.id, popup='') + url('core:file_delete', file_id=this_picture.id) + "?next=" + url('core:user_edit', user_id=profile.id) )|tojson %} {%- else -%} diff --git a/core/tests/test_files.py b/core/tests/test_files.py index 70a01c7a..ac62d88a 100644 --- a/core/tests/test_files.py +++ b/core/tests/test_files.py @@ -146,7 +146,7 @@ class TestUserProfilePicture: return client.post( reverse( "core:file_delete", - kwargs={"file_id": user.profile_pict.pk, "popup": ""}, + kwargs={"file_id": user.profile_pict.pk}, query={"next": user.get_absolute_url()}, ), ) diff --git a/core/urls.py b/core/urls.py index 8f8d6b58..07719f34 100644 --- a/core/urls.py +++ b/core/urls.py @@ -193,24 +193,24 @@ urlpatterns = [ name="user_gift_delete", ), # File views - re_path(r"^file/(?Ppopup)?$", FileListView.as_view(), name="file_list"), + re_path(r"^file/$", FileListView.as_view(), name="file_list"), re_path( - r"^file/(?P[0-9]+)/(?Ppopup)?$", + r"^file/(?P[0-9]+)/$", FileView.as_view(), name="file_detail", ), re_path( - r"^file/(?P[0-9]+)/edit/(?Ppopup)?$", + r"^file/(?P[0-9]+)/edit/$", FileEditView.as_view(), name="file_edit", ), re_path( - r"^file/(?P[0-9]+)/prop/(?Ppopup)?$", + r"^file/(?P[0-9]+)/prop/$", FileEditPropView.as_view(), name="file_prop", ), re_path( - r"^file/(?P[0-9]+)/delete/(?Ppopup)?$", + r"^file/(?P[0-9]+)/delete/$", FileDeleteView.as_view(), name="file_delete", ), diff --git a/core/views/__init__.py b/core/views/__init__.py index daf84693..288a28e8 100644 --- a/core/views/__init__.py +++ b/core/views/__init__.py @@ -37,8 +37,6 @@ from core.views.forms import LoginForm def forbidden(request, exception): context = {"next": request.path, "form": LoginForm()} - if popup := request.resolver_match.kwargs.get("popup"): - context["popup"] = popup return HttpResponseForbidden(render(request, "core/403.jinja", context=context)) diff --git a/core/views/files.py b/core/views/files.py index cd9103d9..886e0ba9 100644 --- a/core/views/files.py +++ b/core/views/files.py @@ -198,9 +198,6 @@ class FileListView(ListView): def get_context_data(self, **kwargs): kwargs = super().get_context_data(**kwargs) - kwargs["popup"] = "" - if self.kwargs.get("popup") is not None: - kwargs["popup"] = "popup" return kwargs @@ -217,20 +214,7 @@ class FileEditView(CanEditMixin, UpdateView): return modelform_factory(SithFile, fields=fields) def get_success_url(self): - if self.kwargs.get("popup") is not None: - return reverse( - "core:file_detail", kwargs={"file_id": self.object.id, "popup": "popup"} - ) - return reverse( - "core:file_detail", kwargs={"file_id": self.object.id, "popup": ""} - ) - - def get_context_data(self, **kwargs): - kwargs = super().get_context_data(**kwargs) - kwargs["popup"] = "" - if self.kwargs.get("popup") is not None: - kwargs["popup"] = "popup" - return kwargs + return reverse("core:file_detail", kwargs={"file_id": self.object.id}) class FileEditPropForm(forms.ModelForm): @@ -268,16 +252,9 @@ class FileEditPropView(CanEditPropMixin, UpdateView): def get_success_url(self): return reverse( "core:file_detail", - kwargs={"file_id": self.object.id, "popup": self.kwargs.get("popup", "")}, + kwargs={"file_id": self.object.id}, ) - def get_context_data(self, **kwargs): - kwargs = super().get_context_data(**kwargs) - kwargs["popup"] = "" - if self.kwargs.get("popup") is not None: - kwargs["popup"] = "popup" - return kwargs - class FileView(CanViewMixin, DetailView, FormMixin): """Handle the upload of new files into a folder.""" @@ -353,15 +330,12 @@ class FileView(CanViewMixin, DetailView, FormMixin): def get_success_url(self): return reverse( "core:file_detail", - kwargs={"file_id": self.object.id, "popup": self.kwargs.get("popup", "")}, + kwargs={"file_id": self.object.id}, ) def get_context_data(self, **kwargs): kwargs = super().get_context_data(**kwargs) - kwargs["popup"] = "" kwargs["form"] = self.form - if self.kwargs.get("popup") is not None: - kwargs["popup"] = "popup" kwargs["clipboard"] = SithFile.objects.filter( id__in=self.request.session["clipboard"] ) @@ -380,19 +354,17 @@ class FileDeleteView(AllowFragment, CanEditPropMixin, DeleteView): return self.request.GET["next"] if self.object.parent is None: return reverse( - "core:file_list", kwargs={"popup": self.kwargs.get("popup", "")} + "core:file_list", ) return reverse( "core:file_detail", kwargs={ "file_id": self.object.parent.id, - "popup": self.kwargs.get("popup", ""), }, ) def get_context_data(self, **kwargs): kwargs = super().get_context_data(**kwargs) - kwargs["popup"] = "" if self.kwargs.get("popup") is None else "popup" kwargs["next"] = self.request.GET.get("next", None) kwargs["previous"] = self.request.GET.get("previous", None) kwargs["current"] = self.request.path diff --git a/core/views/forms.py b/core/views/forms.py index 312d0819..02f2ae26 100644 --- a/core/views/forms.py +++ b/core/views/forms.py @@ -86,30 +86,6 @@ class NFCTextInput(TextInput): return context -class SelectFile(TextInput): - def render(self, name, value, attrs=None, renderer=None): - if attrs: - attrs["class"] = "select_file" - else: - attrs = {"class": "select_file"} - output = ( - '%(content)s
' - % { - "content": super().render(name, value, attrs, renderer), - "title": _("Choose file"), - "name": name, - } - ) - output += ( - '' - + gettext("Choose file") - + "" - ) - return output - - class SelectUser(TextInput): def render(self, name, value, attrs=None, renderer=None): if attrs: diff --git a/counter/templates/counter/stats.jinja b/counter/templates/counter/stats.jinja index 4eddccfa..5534175a 100644 --- a/counter/templates/counter/stats.jinja +++ b/counter/templates/counter/stats.jinja @@ -5,10 +5,6 @@ {% trans counter_name=counter %}{{ counter_name }} stats{% endtrans %} {% endblock %} -{% block jquery_css %} - {# Remove jquery_css #} -{% endblock %} - {% block content %}

{% trans counter_name=counter %}{{ counter_name }} stats{% endtrans %}

diff --git a/eboutic/templates/eboutic/eboutic_checkout.jinja b/eboutic/templates/eboutic/eboutic_checkout.jinja index 5ceeafc2..bf467222 100644 --- a/eboutic/templates/eboutic/eboutic_checkout.jinja +++ b/eboutic/templates/eboutic/eboutic_checkout.jinja @@ -4,10 +4,6 @@ {% trans %}Basket state{% endtrans %} {% endblock %} -{% block jquery_css %} - {# Remove jquery css #} -{% endblock %} - {% block additional_js %} {% endblock %} diff --git a/eboutic/templates/eboutic/eboutic_main.jinja b/eboutic/templates/eboutic/eboutic_main.jinja index 97b4c8c4..db5bf7ed 100644 --- a/eboutic/templates/eboutic/eboutic_main.jinja +++ b/eboutic/templates/eboutic/eboutic_main.jinja @@ -4,10 +4,6 @@ {% trans %}Eboutic{% endtrans %} {% endblock %} -{% block jquery_css %} - {# Remove jquery css #} -{% endblock %} - {% block additional_js %} {# This script contains the code to perform requests to manipulate the user basket without having to reload the page #} diff --git a/package-lock.json b/package-lock.json index 0aea6a29..b78cd6c8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -32,7 +32,6 @@ "glob": "^11.0.0", "htmx.org": "^2.0.3", "jquery": "^3.7.1", - "jquery-ui": "^1.14.0", "js-cookie": "^3.0.5", "lit-html": "^3.3.0", "native-file-system-adapter": "^3.0.1", @@ -3090,9 +3089,9 @@ } }, "node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" @@ -4356,15 +4355,6 @@ "integrity": "sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg==", "license": "MIT" }, - "node_modules/jquery-ui": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/jquery-ui/-/jquery-ui-1.14.1.tgz", - "integrity": "sha512-DhzsYH8VeIvOaxwi+B/2BCsFFT5EGjShdzOcm5DssWjtcpGWIMsn66rJciDA6jBruzNiLf1q0KvwMoX1uGNvnQ==", - "license": "MIT", - "dependencies": { - "jquery": ">=1.12.0 <5.0.0" - } - }, "node_modules/js-cookie": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/js-cookie/-/js-cookie-3.0.5.tgz", diff --git a/package.json b/package.json index 474e0cc6..a32c735f 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,6 @@ "glob": "^11.0.0", "htmx.org": "^2.0.3", "jquery": "^3.7.1", - "jquery-ui": "^1.14.0", "js-cookie": "^3.0.5", "lit-html": "^3.3.0", "native-file-system-adapter": "^3.0.1", diff --git a/vite.config.mts b/vite.config.mts index 015465e5..604d9d78 100644 --- a/vite.config.mts +++ b/vite.config.mts @@ -93,10 +93,6 @@ export default defineConfig((config: UserConfig) => { src: resolve(nodeModules, "jquery/dist/jquery.min.js"), dest: vendored, }, - { - src: resolve(nodeModules, "jquery-ui/dist/jquery-ui.min.js"), - dest: vendored, - }, ], }), ], From b19973ec9c8e536ac0faa04150753b006ddabe27 Mon Sep 17 00:00:00 2001 From: Sli Date: Sun, 15 Jun 2025 17:12:53 +0200 Subject: [PATCH 5/5] Move ts files at the wrong place in com module --- .../bundled/com/{components => }/moderation-alert-index.ts | 0 .../com/{components => }/upcoming-news-loader-index.ts | 0 com/templates/com/news_detail.jinja | 2 +- com/templates/com/news_list.jinja | 4 ++-- locale/fr/LC_MESSAGES/djangojs.po | 2 +- 5 files changed, 4 insertions(+), 4 deletions(-) rename com/static/bundled/com/{components => }/moderation-alert-index.ts (100%) rename com/static/bundled/com/{components => }/upcoming-news-loader-index.ts (100%) diff --git a/com/static/bundled/com/components/moderation-alert-index.ts b/com/static/bundled/com/moderation-alert-index.ts similarity index 100% rename from com/static/bundled/com/components/moderation-alert-index.ts rename to com/static/bundled/com/moderation-alert-index.ts diff --git a/com/static/bundled/com/components/upcoming-news-loader-index.ts b/com/static/bundled/com/upcoming-news-loader-index.ts similarity index 100% rename from com/static/bundled/com/components/upcoming-news-loader-index.ts rename to com/static/bundled/com/upcoming-news-loader-index.ts diff --git a/com/templates/com/news_detail.jinja b/com/templates/com/news_detail.jinja index fc45d24e..9ab6acff 100644 --- a/com/templates/com/news_detail.jinja +++ b/com/templates/com/news_detail.jinja @@ -18,7 +18,7 @@ {% endblock %} {% block additional_js %} - + {% endblock %} {% block content %} diff --git a/com/templates/com/news_list.jinja b/com/templates/com/news_list.jinja index e4b31e26..92e4dd71 100644 --- a/com/templates/com/news_list.jinja +++ b/com/templates/com/news_list.jinja @@ -15,8 +15,8 @@ {% block additional_js %} - - + + {% endblock %} {% block content %} diff --git a/locale/fr/LC_MESSAGES/djangojs.po b/locale/fr/LC_MESSAGES/djangojs.po index ce90c30b..a6e211d0 100644 --- a/locale/fr/LC_MESSAGES/djangojs.po +++ b/locale/fr/LC_MESSAGES/djangojs.po @@ -45,7 +45,7 @@ msgstr "Comment utiliser le lien du calendrier" msgid "Link copied" msgstr "Lien copié" -#: com/static/bundled/com/components/moderation-alert-index.ts +#: com/static/bundled/com/moderation-alert-index.ts #, javascript-format msgid "" "This event will take place every week for %s weeks. If you publish or delete "