{% extends "base.html" %}
{% load quantity %}
{% load item_views %}

{% block pagetitle %}Confirm Order{% endblock %}

{% block breadcrumbs %}
	<li><a href="/my-properties/">My Properties</a></li>
	<li>Confirm Order</li>
{% endblock %}

{% block content %}
	<p>Please check the following order details carefully before continuing.</p>
	<form class="boxed" action="/my-properties/payment" method="post">
		<h3 class="label">Package</h3>
		<table class="order nosort">
			<tr>
				<th>&nbsp;</th>
				<th>Qty</th>
				<th>Price</th>
			</tr>
			{% for i in order.items %}
			<tr>
				<td>{% item_view view-basket-item i %}</td>
				<td>{% quantity i %}</td>
				<td>£{{i.get_total_price|floatformat:2}}</td>
			</tr>
			{% endfor %}
			{% if order.items.charges %}
			<tr class="total">
				<th colspan="2">Subtotal</th>
				<td>£{{basket.get_subtotal|floatformat:2}}</td>
			</tr>
			{% for charge, value in order.items.get_charges %}
			<tr class="total">
				<th colspan="2">{{charge}}</th>
				<td>£{{value|floatformat:2}}</td>
			</tr>
			{% endfor %}
			{% endif %}
			<tr class="total">
				<th colspan="2">Total</th>
				<td>£{{order.total|floatformat:2}}</td>
			</tr>
		</table>
		<div class="buttons">
			<input type="submit" name="amend" value="Edit Package" />
		</div>
	</form>

	<form class="boxed" action="/my-properties/payment" method="post">
		<h3 class="label">Payment</h3>
		<dl>
			<dt>Card Number</dt>
			<dd>{{card.getObfuscatedPAN}}</dd>

			<dt>Billing Address</dt>
			<dd>{{card.sensitive_data.billing_address|linebreaksbr}}</dd>

			<dt>Billing Postcode</dt>
			<dd>{{card.sensitive_data.billing_postcode}}</dd>
		</dl>
		<div class="buttons">
			<input type="submit" name="amend" value="Edit Payment Details" />
		</div>
	</form>


	<p>If you are satisfied the above details are correct, please continue to place this order.</p>

	<form action="/my-properties/place-order" method="post">
		<input type="hidden" name="order_data" value="{{order_data}}" />
		<div class="buttons">
			<input type="submit" value="Place Order" />
		</div>
	</form>
{% endblock %}
