diff --git a/datacenterlight/static/datacenterlight/css/landing-page.css b/datacenterlight/static/datacenterlight/css/landing-page.css index 064003b4..74671e1a 100755 --- a/datacenterlight/static/datacenterlight/css/landing-page.css +++ b/datacenterlight/static/datacenterlight/css/landing-page.css @@ -544,6 +544,7 @@ h6 { font-size: 20px; text-align: right; } + .price-calc-section .text .section-heading::before{ content: ""; position: absolute; @@ -592,10 +593,15 @@ h6 { justify-content: center; align-items: center; } + .price-calc-section .card .description span{ font-size: 20px; margin-left: 4px; } +.price-calc-section .card .description input{ + font-size: 20px; + text-align: center; +} .price-calc-section .card .description i{ color: #29427A; cursor: pointer; diff --git a/datacenterlight/static/datacenterlight/img/Beta.png b/datacenterlight/static/datacenterlight/img/beta-img.png similarity index 100% rename from datacenterlight/static/datacenterlight/img/Beta.png rename to datacenterlight/static/datacenterlight/img/beta-img.png diff --git a/datacenterlight/static/datacenterlight/js/main.js b/datacenterlight/static/datacenterlight/js/main.js index 0b131dc4..7761b248 100644 --- a/datacenterlight/static/datacenterlight/js/main.js +++ b/datacenterlight/static/datacenterlight/js/main.js @@ -15,8 +15,8 @@ }, 'ram': { 'id': 'ramValue', - 'value': 1, - 'min':1, + 'value': 2, + 'min':2, 'max': 200, 'interval': 1 }, @@ -94,21 +94,27 @@ var data = $(this).data('minus'); if(cardPricing[data].value > cardPricing[data].min){ - cardPricing[data].value --; + cardPricing[data].value = Number(cardPricing[data].value) - cardPricing[data].interval; } _fetchPricing(); }); $('.fa-plus-circle.right').click(function(event){ var data = $(this).data('plus'); if(cardPricing[data].value < cardPricing[data].max){ - cardPricing[data].value = cardPricing[data].value + cardPricing[data].interval; + cardPricing[data].value = Number(cardPricing[data].value) + cardPricing[data].interval; } _fetchPricing(); }); + + $('.input-price').change(function(){ + var data = $(this).attr("name"); + cardPricing[data].value = $('input[name='+data+']').val(); + _fetchPricing(); + }); } function _fetchPricing(){ Object.keys(cardPricing).map(function(element){ - $('#'+cardPricing[element].id).text(cardPricing[element].value); + //$('#'+cardPricing[element].id).val(cardPricing[element].value); $('input[name='+element+']').val(cardPricing[element].value); }); _calcPricing(); @@ -116,6 +122,7 @@ function _calcPricing(){ var total = (cardPricing['cpu'].value * 5) + (2* cardPricing['ram'].value) + (0.6* cardPricing['storage'].value) + console.log(total); total = parseFloat(total.toFixed(2)); $("#total").text(total); diff --git a/datacenterlight/templates/datacenterlight/index.html b/datacenterlight/templates/datacenterlight/index.html index caa83eab..292b233f 100755 --- a/datacenterlight/templates/datacenterlight/index.html +++ b/datacenterlight/templates/datacenterlight/index.html @@ -245,7 +245,7 @@ {% trans "Order Now!" %} - + diff --git a/datacenterlight/templates/datacenterlight/pricing.html b/datacenterlight/templates/datacenterlight/pricing.html index 03742516..1674f82e 100644 --- a/datacenterlight/templates/datacenterlight/pricing.html +++ b/datacenterlight/templates/datacenterlight/pricing.html @@ -105,7 +105,7 @@
- +
{% csrf_token %} @@ -123,17 +123,20 @@
- 1 Core + + Core
- 2 GiB RAM + + GB RAM
- 15{% trans "GB Storage (SSD)" %} + + {% trans "GB Storage (SSD)" %}
@@ -145,9 +148,6 @@ {% endfor %}
- - - + +

Cores {{request.session.specs.cpu|floatformat}}

+
+

Memory {{request.session.specs.memory|floatformat}} GiB

+
+

Disk space {{request.session.specs.disk_size|floatformat}} GiB

+
+

Total

{{request.session.specs.price }} CHF

+
+ + + + + +

Billing Address


@@ -18,7 +44,8 @@
-
+
+

Payment Details


@@ -91,32 +118,7 @@
-
- -
-
-

Billing Amount

-
-
- - -

Cores {{request.session.specs.cpu|floatformat}}

-
-

Memory {{request.session.specs.memory|floatformat}} GiB

-
-

Disk space {{request.session.specs.disk_size|floatformat}} GiB

-
-

Total

{{request.session.specs.price }} CHF

-
-
-
- - -
+