Pass params in form pricing
This commit is contained in:
parent
506fbca204
commit
c383156c42
4 changed files with 119 additions and 16 deletions
|
@ -528,6 +528,10 @@ h6 {
|
||||||
position: relative;
|
position: relative;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
.price-calc-section .text .description{
|
||||||
|
font-size: 20px;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
.price-calc-section .text .section-heading::before{
|
.price-calc-section .text .section-heading::before{
|
||||||
content: "";
|
content: "";
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
@ -565,9 +569,13 @@ h6 {
|
||||||
padding: 12px;
|
padding: 12px;
|
||||||
border-bottom: 1px solid rgba(128, 128, 128, 0.3);
|
border-bottom: 1px solid rgba(128, 128, 128, 0.3);
|
||||||
position: relative;
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
}
|
}
|
||||||
.price-calc-section .card .description span{
|
.price-calc-section .card .description span{
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
|
margin-left: 4px;
|
||||||
}
|
}
|
||||||
.price-calc-section .card .description i{
|
.price-calc-section .card .description i{
|
||||||
color: #29427A;
|
color: #29427A;
|
||||||
|
@ -588,6 +596,25 @@ h6 {
|
||||||
}
|
}
|
||||||
.price-calc-section .card .btn{
|
.price-calc-section .card .btn{
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
|
font-size: 20px;
|
||||||
|
width: 200px;
|
||||||
|
}
|
||||||
|
.price-calc-section .card .select-configuration select{
|
||||||
|
outline: none;
|
||||||
|
background: #fff;
|
||||||
|
border-color: #d0d0d0;
|
||||||
|
height: 40px;
|
||||||
|
width: 200px;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 18px;
|
||||||
|
}
|
||||||
|
.price-calc-section .card .check-ip{
|
||||||
|
font-size: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.price-calc-section .card .check-ip input[type=checkbox]{
|
||||||
|
font-size: 17px;
|
||||||
|
margin: 0 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media(max-width:990px) {
|
@media(max-width:990px) {
|
||||||
|
|
|
@ -5,7 +5,23 @@
|
||||||
/* ---------------------------------------------
|
/* ---------------------------------------------
|
||||||
Scripts initialization
|
Scripts initialization
|
||||||
--------------------------------------------- */
|
--------------------------------------------- */
|
||||||
|
var cardPricing ={
|
||||||
|
'cpu': {
|
||||||
|
'id': 'coreValue',
|
||||||
|
'value': 1,
|
||||||
|
'limit': 48
|
||||||
|
},
|
||||||
|
'ram': {
|
||||||
|
'id': 'ramValue',
|
||||||
|
'value': 1,
|
||||||
|
'limit': 200
|
||||||
|
},
|
||||||
|
'storage': {
|
||||||
|
'id': 'storageValue',
|
||||||
|
'value': 1,
|
||||||
|
'limit': 500
|
||||||
|
}
|
||||||
|
}
|
||||||
$(window).load(function(){
|
$(window).load(function(){
|
||||||
|
|
||||||
|
|
||||||
|
@ -16,6 +32,7 @@
|
||||||
_navScroll();
|
_navScroll();
|
||||||
_initScroll();
|
_initScroll();
|
||||||
_initNavUrl();
|
_initNavUrl();
|
||||||
|
_initPricing();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -41,7 +58,6 @@
|
||||||
|
|
||||||
function _navScroll(){
|
function _navScroll(){
|
||||||
if($(window).scrollTop() > 10 ){
|
if($(window).scrollTop() > 10 ){
|
||||||
console.log($(window).scrollTop());
|
|
||||||
$(".navbar").removeClass("navbar-transparent");
|
$(".navbar").removeClass("navbar-transparent");
|
||||||
$(".navbar-default .btn-link").css("color", "#777");
|
$(".navbar-default .btn-link").css("color", "#777");
|
||||||
}else{
|
}else{
|
||||||
|
@ -65,6 +81,39 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function _initPricing(){
|
||||||
|
_fetchPricing();
|
||||||
|
|
||||||
|
$('.fa-minus-circle.left').click(function(event){
|
||||||
|
var data = $(this).data('minus');
|
||||||
|
|
||||||
|
if(cardPricing[data].value > 1){
|
||||||
|
cardPricing[data].value --;
|
||||||
|
}
|
||||||
|
_fetchPricing();
|
||||||
|
});
|
||||||
|
$('.fa-plus-circle.right').click(function(event){
|
||||||
|
var data = $(this).data('plus');
|
||||||
|
if(cardPricing[data].value < cardPricing[data].limit){
|
||||||
|
cardPricing[data].value ++;
|
||||||
|
}
|
||||||
|
_fetchPricing();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function _fetchPricing(){
|
||||||
|
Object.keys(cardPricing).map(function(element){
|
||||||
|
$('#'+cardPricing[element].id).text(cardPricing[element].value);
|
||||||
|
$('input[name='+element+']').val(cardPricing[element].value);
|
||||||
|
});
|
||||||
|
_calcPricing();
|
||||||
|
}
|
||||||
|
|
||||||
|
function _calcPricing(){
|
||||||
|
var total = (cardPricing['cpu'].value * 5) + (2* cardPricing['ram'].value) + (0.6* cardPricing['storage'].value)
|
||||||
|
|
||||||
|
$("#total").text(total);
|
||||||
|
$('input[name=total]').val(total);
|
||||||
|
}
|
||||||
function form_success(){
|
function form_success(){
|
||||||
$('#sucessModal').modal('show');
|
$('#sucessModal').modal('show');
|
||||||
}
|
}
|
||||||
|
|
|
@ -243,7 +243,7 @@
|
||||||
<p>{% trans "15 GiB storage(SSD)" %}</p>
|
<p>{% trans "15 GiB storage(SSD)" %}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<a href="#" class="btn btn-primary">{% trans "Buy Now!" %}</a>
|
<a href="{% url 'datacenterlight:pricing' %}" class="btn btn-primary">{% trans "Buy Now!" %}</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -52,8 +52,8 @@
|
||||||
<span class="icon-bar"></span>
|
<span class="icon-bar"></span>
|
||||||
<span class="icon-bar"></span>
|
<span class="icon-bar"></span>
|
||||||
</button>
|
</button>
|
||||||
<a id="logoBlack" class="navbar-brand topnav url" href="/datacenterlight" ><img src="{% static 'datacenterlight/img/logo_black.svg' %}"></a>
|
<a id="logoBlack" class="navbar-brand topnav url" href="{% url 'datacenterlight:index' %}" ><img src="{% static 'datacenterlight/img/logo_black.svg' %}"></a>
|
||||||
<a id="logoWhite" class="navbar-brand topnav url" href="/datacenterlight" ><img src="{% static 'datacenterlight/img/logo_white.svg' %}"></a>
|
<a id="logoWhite" class="navbar-brand topnav url" href="{% url 'datacenterlight:index' %}" ><img src="{% static 'datacenterlight/img/logo_white.svg' %}"></a>
|
||||||
</div>
|
</div>
|
||||||
<!-- Collect the nav links, forms, and other content for toggling -->
|
<!-- Collect the nav links, forms, and other content for toggling -->
|
||||||
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
|
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
|
||||||
|
@ -106,38 +106,65 @@
|
||||||
<div class="price-calc-section">
|
<div class="price-calc-section">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="caption">
|
<div class="caption">
|
||||||
|
<form action="POST">
|
||||||
|
|
||||||
<div class="title">
|
<div class="title">
|
||||||
<h3>{% trans "VM hosting" %} </h3>
|
<h3>{% trans "VM hosting" %} </h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="price">
|
<div class="price">
|
||||||
<span id="total">15CHF</span>
|
<span id="total">15</span>
|
||||||
|
<span>CHF</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="descriptions">
|
<div class="descriptions">
|
||||||
<div class="description">
|
<div class="description">
|
||||||
<p>{% trans "Based in Switzerland" %}</p>
|
<p>{% trans "Based in Switzerland" %}</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="description">
|
<div class="description">
|
||||||
<i class="left fa fa-minus-circle" aria-hidden="true"></i>
|
<i class="fa fa-minus-circle left" data-minus="cpu" aria-hidden="true"></i>
|
||||||
<span id="coreValue">1</span> <span>core</span>
|
<span id="coreValue">1</span><span> core</span>
|
||||||
<i class="right fa fa-plus-circle" aria-hidden="true"></i>
|
<i class="fa fa-plus-circle right" data-plus="cpu" aria-hidden="true"></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="description">
|
<div class="description">
|
||||||
<i class="left fa fa-minus-circle" aria-hidden="true"></i>
|
<i class="fa fa-minus-circle left" data-minus="ram" aria-hidden="true"></i>
|
||||||
<span id="ramValue">2</span><span> GiB RAM,</span>
|
<span id="ramValue">2</span><span> GiB RAM</span>
|
||||||
<i class="right fa fa-plus-circle" aria-hidden="true"></i>
|
<i class="fa fa-plus-circle right" data-plus="ram" aria-hidden="true"></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="description">
|
<div class="description">
|
||||||
<i class="left fa fa-minus-circle" aria-hidden="true"></i>
|
<i class="fa fa-minus-circle left" data-minus="storage" aria-hidden="true"></i>
|
||||||
<span id="storageValue">15</span><span>{% trans "GiB storage(SSD)" %}</span>
|
<span id="storageValue">15</span><span>{% trans "GiB storage(SSD)" %}</span>
|
||||||
<i class="right fa fa-plus-circle" aria-hidden="true"></i>
|
<i class="fa fa-plus-circle right" data-plus="storage" aria-hidden="true"></i>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="description select-configuration">
|
||||||
|
<select name="config" id="">
|
||||||
|
<option value="" disabled selected>Configuration</option>
|
||||||
|
<option value="CentOS 7">CentOS 7</option>
|
||||||
|
<option value="Debian 8">Debian 8</option>
|
||||||
|
<option value="Ubuntu 14.04">Ubuntu 14.04</option>
|
||||||
|
<option value="Ubuntu 16.04">Ubuntu 16.04</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<input type="hidden" name="cpu">
|
||||||
|
<input type="hidden" name="ram">
|
||||||
|
<input type="hidden" name="storage">
|
||||||
|
<input type="hidden" name="total">
|
||||||
|
<div class="description check-ip">
|
||||||
|
<input type="checkbox" name="ipv6"> Ipv6 Only<br>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<a href="#" class="btn btn-primary">{% trans "Buy Now!" %}</a>
|
<input type="submit" class="btn btn-primary" value="{% trans 'Buy Now!' %}"></input>
|
||||||
|
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="text">
|
<div class="text">
|
||||||
<h2 class="section-heading">{% trans "We are cutting down the costs significantly!" %}</h2>
|
<h2 class="section-heading">{% trans "Simple and affordable: Try our virtual machine with featherlight price." %}</h2>
|
||||||
|
|
||||||
|
<div class="description">
|
||||||
|
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ab laudantium quis quam nostrum ipsum est nisi asperiores provident recusandae aliquid, reiciendis vitae quisquam error, porro fuga obcaecati maiores dolores repudiandae?</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue