From 384c626adb187b8990a002d7ed694e6627ae0af0 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Wed, 16 Jul 2025 11:07:43 +0200 Subject: [PATCH] make selectPlan available in compressed files --- .../templates/services/offering_detail.html | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/hub/services/templates/services/offering_detail.html b/hub/services/templates/services/offering_detail.html index 04d1e3e..8c33b34 100644 --- a/hub/services/templates/services/offering_detail.html +++ b/hub/services/templates/services/offering_detail.html @@ -28,6 +28,25 @@ document.addEventListener('DOMContentLoaded', () => { window.priceCalculator = new PriceCalculator(); } }); + +// Global function for traditional plan selection (used by template buttons) +function selectPlan(element) { + const planId = element.getAttribute('data-plan-id'); + const planName = element.getAttribute('data-plan-name'); + + // Find the plan dropdown in the contact form + const planDropdown = document.getElementById('id_choice'); + if (planDropdown) { + // Find the option with matching plan id and select it + for (let i = 0; i < planDropdown.options.length; i++) { + const optionValue = planDropdown.options[i].value; + if (optionValue.startsWith(planId + '|')) { + planDropdown.selectedIndex = i; + break; + } + } + } +} {% endcompress %} {% endif %}