From e2b43ba01f4c7be604ac719b4675dea9cdfc2184 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Sun, 22 Feb 2026 21:46:55 +0100 Subject: [PATCH] Use native turbo reload mechanism instead of our own global_reload controller --- .../turbo/global_reload_controller.js | 27 ------------------- templates/_turbo_control.html.twig | 5 +--- templates/base.html.twig | 5 ++++ 3 files changed, 6 insertions(+), 31 deletions(-) delete mode 100644 assets/controllers/turbo/global_reload_controller.js diff --git a/assets/controllers/turbo/global_reload_controller.js b/assets/controllers/turbo/global_reload_controller.js deleted file mode 100644 index ce8a6c72..00000000 --- a/assets/controllers/turbo/global_reload_controller.js +++ /dev/null @@ -1,27 +0,0 @@ -/* - * This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony). - * - * Copyright (C) 2019 - 2022 Jan Böhmer (https://github.com/jbtronics) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -import { Controller } from '@hotwired/stimulus'; - -export default class extends Controller { - connect() { - //If we encounter an element with global reload controller, then reload the whole page - window.location.reload(); - } -} \ No newline at end of file diff --git a/templates/_turbo_control.html.twig b/templates/_turbo_control.html.twig index 236aaf2c..aad3d051 100644 --- a/templates/_turbo_control.html.twig +++ b/templates/_turbo_control.html.twig @@ -16,10 +16,7 @@ {% endblock %} -{# Allow pages to request a fully reload of everything #} -{% if global_reload_needed is defined and global_reload_needed %} -
-{% endif %} + {# Insert info about when the sidebar trees were updated last time, so the sidebar_tree_controller can decide if it needs to reload the tree #} diff --git a/templates/base.html.twig b/templates/base.html.twig index 2db726ee..8dc87239 100644 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -26,6 +26,11 @@ + {# Allow pages to request a fully reload of everything #} + {% if global_reload_needed is defined and global_reload_needed %} + + {% endif %} +