Rearranged order_detail.html

This commit is contained in:
M.Ravi 2017-09-15 18:11:22 +02:00
parent fa6901e679
commit aab9464c6f

View file

@ -6,35 +6,35 @@
{% block content %} {% block content %}
<div class="order-detail-container"> <div class="order-detail-container">
{% if messages %} {% if messages %}
<div class="row"> <div class="row">
<div class="col-xs-12 col-md-8 col-md-offset-2"> <div class="col-xs-12 col-md-8 col-md-offset-2">
<br/> <br/>
<div class="alert alert-warning"> <div class="alert alert-warning">
{% for message in messages %} {% for message in messages %}
<span>{{ message }}</span> <span>{{ message }}</span>
{% endfor %} {% endfor %}
</div> </div>
</div> </div>
</div> </div>
{% endif %} {% endif %}
{% if not error %} {% if not error %}
<div class="row"> <div class="row">
<div class="col-xs-12 col-md-8 col-md-offset-2"> <div class="col-xs-12 col-md-8 col-md-offset-2">
<div class="invoice-title"> <div class="invoice-title">
<h2>{{page_header_text}}</h2> <h2>{{page_header_text}}</h2>
<h3 class="pull-right"> <h3 class="pull-right">
{% if order %} {% if order %}
{% trans "Order #"%} {{order.id}} {% trans "Order #"%} {{order.id}}
{% endif %} {% endif %}
</h3> </h3>
</div> </div>
<hr> <hr>
<div class="row"> <div class="row">
<div class="col-xs-12 col-md-6 pull-right order-confirm-date"> <div class="col-xs-12 col-md-6 pull-right order-confirm-date">
<address> <address>
<strong>{% trans "Date"%}:</strong><br> <strong>{% trans "Date"%}:</strong><br>
<span id="order-created_at"> <span id="order-created_at">
{% if order %} {% if order %}
{{order.created_at|date:'Y-m-d H:i'}} {{order.created_at|date:'Y-m-d H:i'}}
{% else %} {% else %}
@ -43,48 +43,59 @@
</span><br><br> </span><br><br>
{% if order %} {% if order %}
<strong>{% trans "Status:"%}</strong><br> <strong>{% trans "Status:"%}</strong><br>
{% if order.status == 'Approved' %} {% if order.status == 'Approved' %}
<strong class="text-success">{% trans "Approved" %}</strong> <strong class="text-success">
{% else %} {% trans "Approved" %}
<strong class="text-danger">{% trans "Declined" %}</strong> </strong>
{% endif %} {% else %}
<strong class="text-danger">
{% trans "Declined" %}
</strong>
{% endif %}
<br><br> <br><br>
{% endif %} {% endif %}
</address> </address>
</div> </div>
<div class="col-xs-12 col-md-6"> <div class="col-xs-12 col-md-6">
<address> <address>
<h3><b>{% trans "Billed To:"%}</b></h3> <h3><b>{% trans "Billed To:"%}</b></h3>
{% if order %} {% if order %}
{{user.name}}<br> {{user.name}}<br>
{{order.billing_address.street_address}},{{order.billing_address.postal_code}}<br> {{order.billing_address.street_address}},{{order.billing_address.postal_code}}<br>
{{order.billing_address.city}}, {{order.billing_address.country}}. {{order.billing_address.city}},
{{order.billing_address.country}}.
{% else %} {% else %}
{% with request.session.billing_address_data as billing_address %} {% with request.session.billing_address_data as
{{billing_address|get_value_from_dict:'cardholder_name'}}<br> {{billing_address|get_value_from_dict:'street_address'}}, {{billing_address|get_value_from_dict:'postal_code'}}<br> billing_address %}
{{billing_address|get_value_from_dict:'city'}}, {{billing_address|get_value_from_dict:'country'}}. {{billing_address|get_value_from_dict:'cardholder_name'}}<br>
{% endwith %} {{billing_address|get_value_from_dict:'street_address'}},
{{billing_address|get_value_from_dict:'postal_code'}}<br>
{{billing_address|get_value_from_dict:'city'}},
{{billing_address|get_value_from_dict:'country'}}.
{% endwith %}
{% endif %} {% endif %}
</address> </address>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-xs-6"> <div class="col-xs-6">
<address> <address>
<strong>{% trans "Payment Method:"%}</strong><br> <strong>{% trans "Payment Method:"%}</strong><br>
{% if order %} {% if order %}
{{order.cc_brand}} {% trans "ending in" %} **** {{order.last4}}<br> {{order.cc_brand}} {% trans "ending in" %} ****
{{user.email}} {{order.last4}}<br>
{{user.email}}
{% else %} {% else %}
{{cc_brand}} {% trans "ending in" %} **** {{cc_last4}}<br> {{cc_brand}} {% trans "ending in" %} ****
{{request.session.user.email}} {{cc_last4}}<br>
{{request.session.user.email}}
{% endif %} {% endif %}
</address> </address>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
@ -93,25 +104,48 @@
<hr> <hr>
<div class="content"> <div class="content">
{% if request.session.specs %} {% if request.session.specs %}
{% with request.session.specs as vm %} {% with request.session.specs as vm %}
<p><b>{% trans "Cores"%}</b> <span class="pull-right">{{vm.cpu}}</span></p> <p><b>{% trans "Cores"%}</b>
<hr> <span class="pull-right">{{vm.cpu}}</span>
<p><b>{% trans "Memory"%}</b> <span class="pull-right">{{vm.memory}} GB</span></p> </p>
<hr> <hr>
<p><b>{% trans "Disk space"%}</b> <span class="pull-right">{{vm.disk_size}} GB</span></p> <p><b>{% trans "Memory"%}</b>
<hr> <span class="pull-right">{{vm.memory}} GB</span>
<p><b>{% trans "Configuration"%}</b> <span class="pull-right">{{request.session.template.name}}</span></p> </p>
<hr> <hr>
<h4>{% trans "Total"%}<p class="pull-right"><b>{{vm.price}} CHF</b><span class="dcl-price-month"> /{% trans "Month" %}</span></p></h4> <p><b>{% trans "Disk space"%}</b>
{% endwith %} <span class="pull-right">{{vm.disk_size}} GB</span>
</p>
<hr>
<p><b>{% trans "Configuration"%}</b>
<span class="pull-right">{{request.session.template.name}}</span>
</p>
<hr>
<h4>{% trans "Total"%}
<p class="pull-right">
<b>{{vm.price}}CHF</b>
<span class="dcl-price-month"> /{% trans "Month" %}
</span>
</p>
</h4>
{% endwith %}
{% else %} {% else %}
<p><b>{% trans "Cores"%}</b> <span class="pull-right">{{vm.cores}}</span></p> <p><b>{% trans "Cores"%}</b>
<hr> <span class="pull-right">{{vm.cores}}</span>
<p><b>{% trans "Memory"%}</b> <span class="pull-right">{{vm.memory}} GB</span></p> </p>
<hr> <hr>
<p><b>{% trans "Disk space"%}</b> <span class="pull-right">{{vm.disk_size}} GB</span></p> <p><b>{% trans "Memory"%}</b>
<hr> <span class="pull-right">{{vm.memory}} GB</span>
<h4>{% trans "Total"%}<p class="pull-right"><b>{{vm.price}} CHF</b><span class="dcl-price-month"> /{% trans "Month" %}</span></p></h4> </p>
<hr>
<p><b>{% trans "Disk space"%}</b>
<span class="pull-right">{{vm.disk_size}} GB</span>
</p>
<hr>
<h4>{% trans "Total"%}<p class="pull-right"><b>{{vm.price}}
CHF</b><span
class="dcl-price-month"> /{% trans "Month" %}</span>
</p></h4>
{% endif %} {% endif %}
</div> </div>
<br/> <br/>
@ -127,18 +161,12 @@
id="btn-create-vm" id="btn-create-vm"
data-href="{% url 'hosting:order-confirmation' %}" data-href="{% url 'hosting:order-confirmation' %}"
data-toggle="modal" data-toggle="modal"
data-target="#createvm-modal">{% trans "Place order"%} data-target="#createvm-modal">
{% trans "Place order"%}
</button> </button>
</div> </div>
</div> </div>
</form> </form>
{% else %}
{% url 'hosting:payment' as payment_url %}
{% if payment_url in request.META.HTTP_REFERER %}
<div class=" content pull-right">
<a href="{% url 'hosting:virtual_machines'%}" ><button class="btn btn-info">{% trans "Finish Configuration"%}</button></a>
</div>
{% endif %}
{% endif %} {% endif %}
</div> </div>
</div> </div>
@ -151,13 +179,18 @@
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close hidden" data-dismiss="modal" <button type="button" class="close hidden" data-dismiss="modal"
aria-label="create-vm-close"><span aria-hidden="true">&times;</span> aria-label="create-vm-close">
<span aria-hidden="true">&times;</span>
</button> </button>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<div class="modal-icon"><i class="fa fa-cog fa-spin fa-3x fa-fw"></i><span class="sr-only">{% trans "Processing..." %}</span> <div class="modal-icon">
<i class="fa fa-cog fa-spin fa-3x fa-fw"></i>
<span class="sr-only">{% trans "Processing..." %}</span>
</div> </div>
<h4 class="modal-title" id="createvm-modal-title">{% trans "Hold tight, we are processing your request" %}</h4> <h4 class="modal-title" id="createvm-modal-title">
{% trans "Hold tight, we are processing your request" %}
</h4>
<div class="modal-text" id="createvm-modal-body"> <div class="modal-text" id="createvm-modal-body">
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
@ -172,9 +205,9 @@
<script type="text/javascript"> <script type="text/javascript">
window.onload = function () { window.onload = function () {
var locale_date = moment.utc(document.getElementById("order-created_at").textContent,'YYYY-MM-DD HH:mm').toDate(); var locale_date = moment.utc(document.getElementById("order-created_at").textContent, 'YYYY-MM-DD HH:mm').toDate();
locale_date = moment(locale_date).format("YYYY-MM-DD h:mm:ss a"); locale_date = moment(locale_date).format("YYYY-MM-DD h:mm:ss a");
document.getElementById('order-created_at').innerHTML = locale_date; document.getElementById('order-created_at').innerHTML = locale_date;
}; };