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, - }, ], }), ],