Moved the calculator to the index.html template
This commit is contained in:
parent
d792c22e4e
commit
47d882d1fc
1 changed files with 102 additions and 38 deletions
|
@ -238,31 +238,69 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-xs-12 col-md-6 hero-feature">
|
<div class="col-xs-12 col-md-6 hero-feature">
|
||||||
|
<div class="price-calc-section-landing">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
|
<img class="img-beta" src="{% static 'datacenterlight/img/beta-img.png' %}" alt="">
|
||||||
<div class="caption">
|
<div class="caption">
|
||||||
|
<form id="order_form" method="POST" action="">
|
||||||
|
{% csrf_token %}
|
||||||
<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>15 CHF/month</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 "Hosted in Switzerland" %}</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="description">
|
<div class="description">
|
||||||
<p>1 Core, </p>
|
<i class="fa fa-minus-circle left" data-minus="cpu" aria-hidden="true"></i>
|
||||||
|
<input class="input-price" type="number" min="1" max="42" id="coreValue" name="cpu">
|
||||||
|
<span> Core</span>
|
||||||
|
<i class="fa fa-plus-circle right" data-plus="cpu" aria-hidden="true"></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="description">
|
<div class="description">
|
||||||
<p>2 GB RAM, </p>
|
<i class="fa fa-minus-circle left" data-minus="ram" aria-hidden="true"></i>
|
||||||
|
<input id="ramValue" class="input-price" type="number" min="2" max="200" name="ram">
|
||||||
|
<span> GB RAM</span>
|
||||||
|
<i class="fa fa-plus-circle right" data-plus="ram" aria-hidden="true"></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="description">
|
<div class="description">
|
||||||
<p>{% trans "10 GB Storage (SSD)" %}</p>
|
<i class="fa fa-minus-circle left" data-minus="storage" aria-hidden="true"></i>
|
||||||
|
<input id="storageValue" class="input-price" type="number" min="10" max="500" step="10" name="storage">
|
||||||
|
<span>{% trans "GB Storage (SSD)" %}</span>
|
||||||
|
<i class="fa fa-plus-circle right" data-plus="storage" aria-hidden="true"></i>
|
||||||
|
</div>
|
||||||
|
<div class="description select-configuration input">
|
||||||
|
<label for="config">OS</label>
|
||||||
|
<select name="config" id="">
|
||||||
|
{% for template in templates %}
|
||||||
|
<option value="{{template.id}}">{{template.name}} </option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<input type="hidden" name="total">
|
||||||
|
<!--<div class="description check-ip">
|
||||||
|
<input type="checkbox" name="ipv6"> Ipv6 Only<br>
|
||||||
|
</div>-->
|
||||||
|
<div class="description input">
|
||||||
|
<label for="name">Name</label>
|
||||||
|
<input type="text" name="name" placeholder="Your Name">
|
||||||
|
</div>
|
||||||
|
<div class="description input">
|
||||||
|
<label for="email">Email</label>
|
||||||
|
<input type="email" name="email" placeholder="Your Email">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<a href="{% url 'datacenterlight:order' %}" class="btn btn-primary">{% trans "Order Now!" %}</a>
|
<input type="submit" class="btn btn-primary" value="{% trans 'Order Now!' %}"></input>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<div id="error_message_box" class="error-message-box"></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<img class="img-beta" src="{% static 'datacenterlight/img/beta-img.png' %}" alt="">
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -366,14 +404,40 @@
|
||||||
|
|
||||||
<!-- jQuery -->
|
<!-- jQuery -->
|
||||||
<script src="{% static 'datacenterlight/js/jquery.js' %}"></script>
|
<script src="{% static 'datacenterlight/js/jquery.js' %}"></script>
|
||||||
|
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.16.0/jquery.validate.min.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){
|
||||||
|
$.validator.setDefaults({
|
||||||
|
ignore: []
|
||||||
|
});
|
||||||
|
$('#order_form').validate({
|
||||||
|
wrapper: 'div',
|
||||||
|
errorLabelContainer: "#error_message_box",
|
||||||
|
rules: {
|
||||||
|
name: {
|
||||||
|
required: true,
|
||||||
|
minlength: 3
|
||||||
|
},
|
||||||
|
email: {
|
||||||
|
required: true,
|
||||||
|
email: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
messages: {
|
||||||
|
name: "Please enter your name",
|
||||||
|
email: "Please enter a valid email address"
|
||||||
|
},
|
||||||
|
submitHandler: function (form) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
window.onload=function(){
|
window.onload=function(){
|
||||||
$('.selectpicker').selectpicker({
|
$('.selectpicker').selectpicker({
|
||||||
style: 'btn-link',
|
style: 'btn-link',
|
||||||
windowPadding: 10,
|
windowPadding: 10,
|
||||||
});
|
});
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: "{% url 'datacenterlight:beta_access' %}",
|
url: "{% url 'datacenterlight:beta_access' %}",
|
||||||
context: document.body
|
context: document.body
|
||||||
|
@ -381,7 +445,7 @@
|
||||||
$('#beta_access_form').html(response);
|
$('#beta_access_form').html(response);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.5.4/bootstrap-select.js"></script>
|
<script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.5.4/bootstrap-select.js"></script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue