{% extends "layout.html" %}

{% load currency_filters %}

{% block header %}
<h2>Profile</h2>
{% endblock header %}


{% block content %}

<h3>Account settings</h3>
<ul>
    <li><a href="{% url customer:address-list %}">Manage address book</a></li>
    <li><a href="">Change password</a></li>
</ul>

<h3>Order history</h3>

<table>
    <tr>
        <th>Order number</th>
        <th>Total inc tax</th>
        <th>Date submitted</th>
        <th></th>
    </tr>
    {% for order in orders %}
    <tr>
        <td>{{ order.number }}</td>
        <td>{{ order.total_incl_tax|currency }}</td>
        <td>{{ order.date_placed }}</td>
        <td>
            <a href="{% url customer:order order.number %}">View</a>
        </td>
    </tr>
    {% endfor %}
</table>
<p><a href="{% url customer:order-list %}">View order history</a></p>

<h3>Email history</h3>
{% if not emails %}

<p>You haven't been sent any emails yet.</p>

{% else %}

<table>
    <tr>
        <th>Date sent</th>
        <th>Subject</th>
        <th></th>
    </tr>
    {% for email in emails %}
    <tr>
        <td>{{ email.date_sent }}</td>
        <td>{{ email.subject }}</td>
        <td>
            <a href="{% url oscar-customer-email-view email.id %}">View</a>
        </td>
    </tr>
    {% endfor %}
</table>
<p><a href="{% url oscar-customer-email-history %}">View email history</a></p>
{% endif %}

{% endblock content %}