fix: planner quote button — use lang-prefixed URL to prevent 404

The "Get Supplier Quotes" CTA in planner.js used a hardcoded
/leads/quote path which 404s because the route is registered at
/<lang>/leads/quote. Inject the correct URL server-side via
window.__PADELNOMICS_QUOTE_URL__ using url_for, consistent with
the existing __PADELNOMICS_CALC_URL__ / __PADELNOMICS_SAVE_URL__ pattern.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Deeman
2026-02-20 14:13:44 +01:00
parent 48587d6436
commit 3c903bad97
3 changed files with 5 additions and 1 deletions

View File

@@ -6,6 +6,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
## [Unreleased] ## [Unreleased]
### Fixed
- Planner: "Get Supplier Quotes" button now navigates to the correct lang-prefixed URL (`/en/leads/quote` etc.) — hardcoded `/leads/quote` caused a 404 on prod; URL is now injected from the server via `window.__PADELNOMICS_QUOTE_URL__`
### Added ### Added
- Nav: hamburger menu on screens < 900px — clicking opens a full-width mobile panel with all nav links; overlay click and Escape key close it - Nav: hamburger menu on screens < 900px — clicking opens a full-width mobile panel with all nav links; overlay click and Escape key close it
- Nav: mobile panel groups links under "Plan", "Explore", and "Account" section headers - Nav: mobile panel groups links under "Plan", "Explore", and "Account" section headers

View File

@@ -254,6 +254,7 @@ window.__PADELNOMICS_INITIAL_D__ = {{ initial_d | safe }};
window.__PADELNOMICS_CALC_URL__ = "{{ url_for('planner.calculate') }}"; window.__PADELNOMICS_CALC_URL__ = "{{ url_for('planner.calculate') }}";
window.__PADELNOMICS_SAVE_URL__ = "{{ url_for('planner.save_scenario') }}"; window.__PADELNOMICS_SAVE_URL__ = "{{ url_for('planner.save_scenario') }}";
window.__PADELNOMICS_SCENARIO_URL__ = "{{ url_for('planner.index') }}scenarios/"; window.__PADELNOMICS_SCENARIO_URL__ = "{{ url_for('planner.index') }}scenarios/";
window.__PADELNOMICS_QUOTE_URL__ = "{{ url_for('leads.quote_request') }}";
</script> </script>
<script src="{{ url_for('static', filename='js/planner.js') }}"></script> <script src="{{ url_for('static', filename='js/planner.js') }}"></script>
{% endblock %} {% endblock %}

View File

@@ -819,7 +819,7 @@ function goToQuoteForm(){
country: S.country, country: S.country,
}); });
if(S.budgetTarget) p.set('budget', S.budgetTarget); if(S.budgetTarget) p.set('budget', S.budgetTarget);
window.location.href = '/leads/quote?' + p.toString(); window.location.href = (window.__PADELNOMICS_QUOTE_URL__ || '/leads/quote') + '?' + p.toString();
} }
// ── Init ────────────────────────────────────────────────── // ── Init ──────────────────────────────────────────────────