Part-DB-server/templates
Sebastian Almberg 0bfbbc961d Fix update confirmation dialog not blocking form submission
The previous implementation used inline onsubmit handlers with return
confirmVersionChange(...), which could fail silently if any JavaScript
error occurred on the page, causing the form to submit without confirmation.

Fixes:
- Use event.preventDefault() FIRST to ensure form never submits by default
- Use DOMContentLoaded event listeners instead of inline handlers
- Properly escape translation strings using json_encode filter
- Wrap in IIFE with 'use strict' for better error handling
- Use data-attributes to identify forms and pass isDowngrade state

Fix DOMContentLoaded race condition in update form handlers

The event listener was not attaching if DOMContentLoaded had already
fired by the time the script executed. Now checks document.readyState
and attaches handlers immediately if DOM is already ready.

Added console.log statements to help debug form handler attachment.

Use Stimulus controller for update confirmation dialogs

The inline script was blocked by Content Security Policy (CSP).
Stimulus controllers are bundled with webpack and properly allowed by CSP.

- Create update_confirm_controller.js Stimulus controller
- Remove inline script from template
- Pass translation strings via data-* attributes
2026-01-30 23:24:48 +01:00
..
admin Fix update confirmation dialog not blocking form submission 2026-01-30 23:24:48 +01:00
bundles/TwigBundle/Exception Allow to show what permissions a user is lacking in case of access denied message 2025-09-06 00:10:50 +02:00
components Properly disable the id search by default 2026-01-18 23:48:04 +01:00
form Fixed multi translation of env var tooltip to remove clutter in translation editor 2025-11-30 15:28:22 +01:00
info_providers Bring provider capabilities into a fixed order for better comparison 2026-01-04 17:36:53 +01:00
label_system Increase default height of the PDF preview container from 250px to 280px and so Chromium-based browsers display the PDF toolbar by default. Fixes #1165. (#1171) 2026-01-04 17:14:27 +01:00
log_system Include the query part of the request, when generating the url for the datatables via a custom twig function. 2024-10-16 23:57:02 +02:00
mail Use new settings system to configure the instance Name and homepage banner 2024-05-20 21:14:32 +02:00
maintenance Add Update Manager for automated Part-DB updates 2026-01-30 21:36:33 +01:00
parts Added feature for part IPN suggest with category prefixes (#1054) 2025-11-03 00:31:47 +01:00
projects Use yellow alert box for notifying of empty bom on build, show infinite correclty and added translations 2025-10-18 23:32:20 +02:00
security Fixed login CSFR token error 2025-08-04 23:50:25 +02:00
settings Implemented the ability to set user-defined synonyms/labels for internal element types 2025-11-12 21:35:02 +01:00
tools Merge branch 'master' into settings-bundle 2025-01-17 22:06:18 +01:00
users Use new settings system to configure the instance Name and homepage banner 2024-05-20 21:14:32 +02:00
_navbar.html.twig Add Update Manager for automated Part-DB updates 2026-01-30 21:36:33 +01:00
_sidebar.html.twig Allow to configure sidebar menu via the new settings system 2024-08-07 00:41:06 +02:00
_toast.html.twig Improved styling of a info level flash toast in darkmode 2023-07-03 22:01:39 +02:00
_toast_container.html.twig Fixed toast position on large screens 2023-02-06 22:47:41 +01:00
_turbo_control.html.twig Added an settings option to control what languages to show in the dropdown menu 2025-10-17 22:34:27 +02:00
attachment_list.html.twig Added additional filters to attachment datatable 2025-02-22 17:48:26 +01:00
base.html.twig Made sidebar toggle button smaller 2025-11-30 14:20:50 +01:00
helper.twig Better align the part parameter tables to each other 2025-10-19 15:56:18 +02:00
homepage.html.twig Allow to hide the version number on homepage 2025-09-07 19:43:23 +02:00
main_card.html.twig Added a very basic import dialog for Parts 2023-03-12 19:53:55 +01:00
vars.macro.twig Fixed old usages of base_currency 2024-08-03 23:19:09 +02:00