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:
@@ -6,6 +6,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
||||
|
||||
## [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
|
||||
- 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
|
||||
|
||||
@@ -254,6 +254,7 @@ window.__PADELNOMICS_INITIAL_D__ = {{ initial_d | safe }};
|
||||
window.__PADELNOMICS_CALC_URL__ = "{{ url_for('planner.calculate') }}";
|
||||
window.__PADELNOMICS_SAVE_URL__ = "{{ url_for('planner.save_scenario') }}";
|
||||
window.__PADELNOMICS_SCENARIO_URL__ = "{{ url_for('planner.index') }}scenarios/";
|
||||
window.__PADELNOMICS_QUOTE_URL__ = "{{ url_for('leads.quote_request') }}";
|
||||
</script>
|
||||
<script src="{{ url_for('static', filename='js/planner.js') }}"></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -819,7 +819,7 @@ function goToQuoteForm(){
|
||||
country: S.country,
|
||||
});
|
||||
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 ──────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user