{% extends "base.html" %} {% block content %}

ESP Vouchers

Vouchers issued by your sub-vendo ESPs. New ones are created on each ESP's own page.

{% if flash_msg %}
{{ flash_msg }}
{% endif %} {% if error_msg %}
{{ error_msg }}
{% endif %}

Search

{% if search %} Clear {% endif %}

Filter by Status

{% set chips = [('all', 'All'), ('active', 'Active'), ('idle', 'Idle'), ('paused', 'Paused'), ('expired', 'Expired'), ('revoked', 'Revoked')] %} {% for slug, label in chips %} {{ label }} {{ counts[slug] }} {% endfor %}
{% if rows %}
{% for v in rows %} {% endfor %}
Code Status Vendo Time left Device Created Actions
{{ v.code }} {{ v.status }} {{ v.segment }} {% if v.status in ['active', 'paused'] %} {% if v.minutes_remaining is not none %}{{ v.minutes_remaining }} min left{% else %}no time limit{% endif %}
{{ v.minutes_used }}/{{ v.minutes_total }}m used{% if v.validity_left is not none %} · {{ v.validity_left }}m validity{% endif %}
{% elif v.status == 'idle' %} not started
{{ v.minutes_total }}m granted
{% else %} {{ 'revoked' if v.status == 'revoked' else 'ended' }}
{{ v.minutes_used }}/{{ v.minutes_total }}m used
{% endif %}
{{ v.ip or v.mac or '—' }} {{ v.created }} {% if v.status == 'active' %}
{% else %}
{% endif %}
{% if total > 0 %} {% set page_start = offset + 1 %} {% set page_end = offset + (rows|length) %} {% set base_qs = '?status=' ~ status_filter %} {% if search %}{% set base_qs = base_qs ~ '&q=' ~ search %}{% endif %} {% endif %} {% else %}
{% if search %} No ESP vouchers match "{{ search }}"{% if status_filter != 'all' %} in {{ status_filter }}{% endif %}.
Try a different code prefix or MAC fragment. {% elif status_filter == 'all' %} No ESP vouchers yet.
They'll appear here as sub-vendo customers insert coins on their ESP. {% else %} No {{ status_filter }} ESP vouchers right now. {% endif %}
{% endif %}
{% endblock %}