{% extends 'base.html' %} {% from '_macros.html' import product_card, empty_state with context %} {% block title %}Dashboard ยท TradeHub{% endblock %} {% block content %}
{# ============ Listings tab ============ #} {% if tab == 'listings' %}
New listing
{% if listings %}
{% for product in listings %}
{{ product.title }} ${{ '%.2f' % product.price }}
{{ product.title }}
{{ product.status }} · {{ product.views or 0 }} views
Edit {% if product.status == 'active' %}
{% endif %}
{% endfor %}
{% else %} {{ empty_state(icon='package-plus', title='No listings yet', message='Create your first listing to start selling.', cta_url=url_for('products.publish'), cta_text='Create listing') }} {% endif %} {# ============ Buying tab ============ #} {% elif tab == 'buying' %} {% if buying %}
{% for order in buying %}
{{ order.product.title }}
{{ order.product.title }}
${{ '%.2f' % order.product.price }}
{{ order.status_label }} Seller: {{ order.product.seller.username }} {{ order.created_at.strftime('%b %d') }}
{% endfor %}
{% else %} {{ empty_state(icon='shopping-bag', title='No purchases yet', message='Browse the marketplace to find something you like.', cta_url=url_for('main.index'), cta_text='Browse items') }} {% endif %} {# ============ Selling tab ============ #} {% elif tab == 'selling' %} {% if selling %}
{% for order in selling %}
{{ order.product.title }}
{{ order.product.title }}
${{ '%.2f' % order.product.price }}
{{ order.status_label }} Buyer: {{ order.buyer.username }} {{ order.created_at.strftime('%b %d') }}
{% endfor %}
{% else %} {{ empty_state(icon='inbox', title='No incoming orders', message='When someone buys your item, it will appear here.') }} {% endif %} {# ============ Wishlist tab ============ #} {% elif tab == 'wishlist' %} {% if wishlist_items %}
{% for w in wishlist_items %} {{ product_card(w.product, is_wishlisted=true) }} {% endfor %}
{% else %} {{ empty_state(icon='heart', title='Your wishlist is empty', message='Tap the heart icon on any product to save it for later.', cta_url=url_for('main.index'), cta_text='Browse items') }} {% endif %} {% endif %}
{% endblock %}