introduce django compressor
This commit is contained in:
parent
67e1b4cab1
commit
a4a0fa4f8b
7 changed files with 121 additions and 2 deletions
|
@ -1,12 +1,36 @@
|
|||
{% extends 'base.html' %}
|
||||
{% load static %}
|
||||
{% load compress %}
|
||||
{% load contact_tags %}
|
||||
{% load json_ld_tags %}
|
||||
|
||||
{% block title %}Managed {{ offering.service.name }} on {{ offering.cloud_provider.name }}{% endblock %}
|
||||
|
||||
{% block extra_js %}
|
||||
<script defer src="{% static "js/price-calculator.js" %}"></script>
|
||||
{% if debug %}
|
||||
<!-- Development: Load individual modules for easier debugging -->
|
||||
<script defer src="{% static 'js/price-calculator.js' %}"></script>
|
||||
{% else %}
|
||||
<!-- Production: Load compressed bundle -->
|
||||
{% compress js %}
|
||||
<script src="{% static 'js/price-calculator/dom-manager.js' %}"></script>
|
||||
<script src="{% static 'js/price-calculator/pricing-data-manager.js' %}"></script>
|
||||
<script src="{% static 'js/price-calculator/plan-manager.js' %}"></script>
|
||||
<script src="{% static 'js/price-calculator/addon-manager.js' %}"></script>
|
||||
<script src="{% static 'js/price-calculator/ui-manager.js' %}"></script>
|
||||
<script src="{% static 'js/price-calculator/order-manager.js' %}"></script>
|
||||
<script src="{% static 'js/price-calculator/price-calculator.js' %}"></script>
|
||||
<script>
|
||||
// Initialize calculator when DOM is loaded
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
// Check if we're on a page that needs the price calculator
|
||||
if (document.getElementById('cpuRange')) {
|
||||
window.priceCalculator = new PriceCalculator();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{% endcompress %}
|
||||
{% endif %}
|
||||
<link rel="stylesheet" type="text/css" href='{% static "css/price-calculator.css" %}'>
|
||||
|
||||
{% json_ld_structured_data %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue