{% load i18n lfs_tags %}
<h2>{% trans "Orders" %}</h2>
<table class="lfs-manage-table">
    <tr>
        <th class="small">
            {% trans 'Number' %}
        </th>
        <th class="small">
            {% trans 'Date' %}
        </th>
        <th class="middle">
			{% trans "Name" %}
		</th>
        <th class="small">
            {% trans 'State' %}
        </th>
        <th class="tiny right-padding">
            {% trans 'Price' %}
        </th>
        <th class="small right-padding">
            {% trans 'Message' %}
        </th>
    </tr>
	{% if page.object_list %}
        {% for order in page.object_list %}
			<tr class="clickable {% cycle 'even' 'odd' %}"
			    onclick="window.location='{% url lfs.manage.views.order_view order.id %}'">
                <td>
                    {{ order.number|default_if_none:"-" }}
                </td>
                <td>
                    {{ order.created|date:_("DATETIME_FORMAT") }}
                </td>
				<td>
					{{ order.customer_firstname }}   {{ order.customer_lastname }}
				</td>
				<td>
					{{ order.get_state_display }}
				</td>
                <td class="number">
                    {{ order.price|currency:request }}
                </td>
                <td class="right-padding">
                    {% if order.message %}
                        Yes
                    {% else %}
                        No
                    {% endif %}
                </td>
            </tr>
        {% endfor %}
	{% else	%}
		<tr>
			<td colspan="4">
				{% trans "There are no orders" %}
			</td>
		</tr>
	{% endif %}
</table>
