Files
shoppy/web/templates/web/orders.html
T
2026-03-17 14:03:51 +01:00

102 lines
4.9 KiB
HTML

{% extends 'theme/base.html' %}
{% load static i18n %}
{% block main %}
{% include 'components/generic/navbar.html' %}
<div class="mx-auto max-w-screen-xl px-4 2xl:px-0">
<div class="mx-auto max-w-5xl">
<div class="gap-4">
<h1 class="text-xl font-semibold sm:text-2xl my-4">
{% translate 'Mis pedidos' %}
</h1>
<div class="mt-6 flow-root sm:mt-8">
<div class="divide-y divide-gray-200 ">
{% for order in page %}
<article class="flex flex-wrap items-center gap-y-4 py-6">
<dl class="w-1/2 sm:w-1/4 lg:w-auto lg:flex-1 px-4">
<dt class="text-base font-medium ">
{% translate 'Número de pedido' %}
</dt>
<dd class="mt-1.5 text-base font-semibold ">
<a href="{% url 'web:order' uuid=order.uuid %}" class="hover:underline">
#{{ order.code }}
</a>
</dd>
</dl>
<dl class="w-1/2 sm:w-1/4 lg:w-auto lg:flex-1 px-4">
<dt class="text-base font-medium ">
{% translate 'Fecha' %}
</dt>
<dd class="mt-1.5 text-base font-semibold ">
{{ order.creation_date }}
</dd>
</dl>
<dl class="w-1/2 sm:w-1/4 lg:w-auto lg:flex-1 px-4">
<dt class="text-base font-medium ">
{% translate 'Total' %}
</dt>
<dd class="mt-1.5 text-base font-semibold ">
{{ order.total }}€
</dd>
</dl>
<dl class="w-1/2 sm:w-1/4 lg:w-auto lg:flex-1 px-4">
{% if order.status == 'PAI' %}
<dd class="inline-flex text-green-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded ">
{% translate 'Pagado' %}
</dd>
{% if order.shipping_status == 'NOT' %}
<dd class="inline-flex text-yellow-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded ">
{% translate 'Tramitado' %}
</dd>
{% elif order.shipping_status == 'RDY' %}
<dd class="inline-flex text-yellow-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded ">
{% translate 'Preparado' %}
</dd>
{% elif order.shipping_status == 'TBS' %}
<dd class="inline-flex text-yellow-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded ">
{% translate 'Listo' %}
</dd>
{% elif order.shipping_status == 'SNT' %}
<dd class="inline-flex text-blue-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded ">
{% translate 'Enviado' %}
</dd>
{% elif order.shipping_status == 'DLV' %}
<dd class="inline-flex text-green-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded ">
{% translate 'Entregado' %}
</dd>
{% endif %}
{% elif order.status == 'ERR' %}
<dd class="inline-flex text-red-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded ">
{% translate 'Error' %}
</dd>
{% elif order.status == 'RTN' %}
<dd class="inline-flex text-yellow-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded ">
{% translate 'Devuelto' %}
</dd>
{% endif %}
</dl>
<a href="{% url 'web:order' uuid=order.uuid %}"
class="w-full inline-flex justify-center rounded-lg px-3 py-2 text-sm font-medium hover: hover:text-primary-700 focus:z-10 focus:outline-none focus:ring-4 focus:ring-gray-100 : :text-white :ring-gray-700 lg:w-auto">
{% translate 'Ver pedido' %}
</a>
</article>
{% endfor %}
</div>
</div>
</div>
</div>
</div>
{% endblock %}