move code to static files
Some checks failed
Django Tests / test (push) Failing after 1m13s
Django Tests / test (pull_request) Failing after 1m3s

This commit is contained in:
Tobias Brunner 2025-06-23 13:25:46 +02:00
parent 4aebccbc7b
commit 0e88a8d13e
No known key found for this signature in database
4 changed files with 64 additions and 75 deletions

View file

@ -34,3 +34,36 @@
opacity: 1; opacity: 1;
} }
} }
/* Subtle styling for the best plan */
.card.border-success.border-2 {
box-shadow: 0 0.25rem 0.75rem rgba(25, 135, 84, 0.1) !important;
transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.card.border-success.border-2:hover {
transform: translateY(-2px);
box-shadow: 0 0.5rem 1rem rgba(25, 135, 84, 0.15) !important;
}
/* Best choice badge styling */
.badge.bg-success {
background: linear-gradient(135deg, #198754 0%, #20c997 100%) !important;
border: 2px solid white;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
white-space: nowrap;
font-size: 0.75rem;
padding: 0.5rem 0.75rem;
min-width: max-content;
}
/* Subtle enhancement for best plan button */
.btn-success.shadow {
transition: all 0.2s ease-in-out;
}
.btn-success.shadow:hover {
transform: translateY(-1px);
box-shadow: 0 0.25rem 0.75rem rgba(25, 135, 84, 0.2) !important;
}

View file

@ -1835,3 +1835,21 @@ document.addEventListener('DOMContentLoaded', () => {
new PriceCalculator(); new PriceCalculator();
} }
}); });
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;
}
}
}
}

View file

@ -9,62 +9,7 @@
<script defer src="{% static "js/price-calculator.js" %}"></script> <script defer src="{% static "js/price-calculator.js" %}"></script>
<link rel="stylesheet" type="text/css" href='{% static "css/price-calculator.css" %}'> <link rel="stylesheet" type="text/css" href='{% static "css/price-calculator.css" %}'>
<!-- JSON-LD Structured Data -->
{% json_ld_structured_data %} {% json_ld_structured_data %}
<style>
/* Subtle styling for the best plan */
.card.border-success.border-2 {
box-shadow: 0 0.25rem 0.75rem rgba(25, 135, 84, 0.1) !important;
transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.card.border-success.border-2:hover {
transform: translateY(-2px);
box-shadow: 0 0.5rem 1rem rgba(25, 135, 84, 0.15) !important;
}
/* Best choice badge styling */
.badge.bg-success {
background: linear-gradient(135deg, #198754 0%, #20c997 100%) !important;
border: 2px solid white;
text-shadow: 0 1px 2px rgba(0,0,0,0.1);
white-space: nowrap;
font-size: 0.75rem;
padding: 0.5rem 0.75rem;
min-width: max-content;
}
/* Subtle enhancement for best plan button */
.btn-success.shadow {
transition: all 0.2s ease-in-out;
}
.btn-success.shadow:hover {
transform: translateY(-1px);
box-shadow: 0 0.25rem 0.75rem rgba(25, 135, 84, 0.2) !important;
}
</style>
<script>
// Function to select a plan in the dropdown when clicking "Select This Plan"
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;
}
}
}
}
</script>
{% endblock %} {% endblock %}
{% block content %} {% block content %}

View file

@ -225,7 +225,9 @@ def json_ld_structured_data(context):
# Add offers if available # Add offers if available
if hasattr(offering, "plans") and offering.plans.exists(): if hasattr(offering, "plans") and offering.plans.exists():
# Get all plans with pricing # Get all plans with pricing
plans_with_prices = offering.plans.filter(plan_prices__isnull=False).distinct() plans_with_prices = offering.plans.filter(
plan_prices__isnull=False
).distinct()
if plans_with_prices.exists(): if plans_with_prices.exists():
# Create individual offers for each plan # Create individual offers for each plan
@ -245,10 +247,7 @@ def json_ld_structured_data(context):
"priceCurrency": first_price.currency, "priceCurrency": first_price.currency,
"availability": "https://schema.org/InStock", "availability": "https://schema.org/InStock",
"url": offering_url + "#plan-order-form", "url": offering_url + "#plan-order-form",
"seller": { "seller": {"@type": "Organization", "name": "VSHN"},
"@type": "Organization",
"name": "VSHN"
}
} }
offers.append(offer) offers.append(offer)
@ -258,10 +257,7 @@ def json_ld_structured_data(context):
"availability": "https://schema.org/InStock", "availability": "https://schema.org/InStock",
"offerCount": len(offers), "offerCount": len(offers),
"offers": offers, "offers": offers,
"seller": { "seller": {"@type": "Organization", "name": "VSHN"},
"@type": "Organization",
"name": "VSHN"
}
} }
# Add lowPrice, highPrice and priceCurrency if we have prices # Add lowPrice, highPrice and priceCurrency if we have prices
@ -289,10 +285,7 @@ def json_ld_structured_data(context):
"@type": "AggregateOffer", "@type": "AggregateOffer",
"availability": "https://schema.org/InStock", "availability": "https://schema.org/InStock",
"offerCount": offering.plans.count(), "offerCount": offering.plans.count(),
"seller": { "seller": {"@type": "Organization", "name": "VSHN"},
"@type": "Organization",
"name": "VSHN"
}
} }
else: else: