{% extends 'base.html' %} {% load static %} {% block title %}Admin Portal — PickkerMarket{% endblock %} {% block content %}
Admin Portal

Catalog management

{{ product_count }}
Total products
{{ trending_count }}
Trending on homepage
{{ pending_payment_count }}
Awaiting payment approval
{% for product in products %} {% empty %} {% endfor %}
Name Category Farm Price Market Price Stock Trending Actions
{{ product.name }}{% if not product.is_active %} Hidden{% endif %}{% if not product.is_approved %} Pending approval{% endif %} {{ product.category }} TSh {{ product.farm_price|floatformat:0 }}/{{ product.unit }} TSh {{ product.market_price|floatformat:0 }}/{{ product.unit }} {{ product.stock_qty }} {% if product.is_trending %} Yes {% if product.trend_badge and product.trend_badge.change_pct != None %} ({{ product.trend_badge.direction }} {{ product.trend_badge.change_pct }}%) {% else %} (no price data recorded yet) {% endif %} {% else %}—{% endif %} Edit {% if product.is_active %}
{% csrf_token %}
{% else %}
{% csrf_token %}
{% endif %}
No products yet — add your first one above.
Orders

All orders

{% for order in orders %} {% if order.required_markets %} {% endif %} {% if order.vendor_tie %} {% endif %} {% empty %} {% endfor %}
Order Customer Picker Delivery Distance / Route Total Status Actions
#{{ order.id }} {{ order.customer_name }} {{ order.picker_name }} {% if order.is_quick %}Quick
{% endif %}{{ order.delivery_date }}
{{ order.delivery_time_slot }}
{{ order.distance_km }} km {% if order.eta_traffic_min %}
~{{ order.eta_traffic_min }} min (traffic est.){% endif %} {% if order.route_surface_label %}
{{ order.route_surface_label }}{% endif %} {% if order.picking_duration_min %}
Picked in {{ order.picking_duration_min }} min{% endif %}
TSh {{ order.total_amount|floatformat:0 }} {{ order.status|title }} {% if order.status == 'pending_payment' %}
{% csrf_token %}
{% endif %} {% if order.status == 'delivered' and not order.payment_released_at %}
{% csrf_token %}
{% endif %} {% if order.picker_id and order.delivery_lat and order.status != 'pending_payment' %} Track {% endif %}
{% csrf_token %}
{% if order.shop_payment_complete %} Shop payment recorded {% for m in order.required_markets %}{{ m.name }}{% endfor %} {% else %} Shop payment pending — picker can't start picking yet {% for m in order.unpaid_markets %}
{% csrf_token %} {{ m.name }}
{% endfor %} {% endif %}
{% if order.vendor_tie.payment_complete %} Vendor payment recorded {{ order.vendor_tie.vendor_type|title }}: {{ order.vendor_tie.name }} {% else %} Vendor payment pending — picker can't start picking yet
{% csrf_token %} {{ order.vendor_tie.vendor_type|title }}: {{ order.vendor_tie.name }}
{% endif %}
No orders yet.
{% endblock %} {% block extra_scripts %} {% endblock %}