{% extends 'layouts/app.html' %} {% import 'macros/items.html' as items %} {% import 'macros/form.html' as f with context %} {% import 'billing/macros/billing.html' as billing with context %} {% block title %}Admin - Coupons / List{% endblock %} {% block body %}
{{ f.search('admin.coupons') }}
{% if coupons.total == 0 %}

No results found

{% if request.args.get('q') %}

Try limiting or removing your search terms.

{% else %}

There are no coupons present, you should create one.

{% endif %} {% else %} {% call f.form_tag('admin.coupons_bulk_delete') %} {% for coupon in coupons.items %} {% endfor %}
{{ items.sort('created_on', 'Created') }} {{ items.sort('code') }} {{ items.sort('duration') }} {{ items.sort('redeem_by', 'Expires') }} {{ items.sort('times_redeemed', 'Redeemed') }}
{{ f.field(bulk_form.scope, inline=True) }}
{{ coupon.code }}

{{ billing.coupon_discount(coupon.amount_off, coupon.percent_off) }} discount

{{ billing.coupon_duration_tag_for(coupon) }} {{ billing.coupon_expiration(coupon) }} {{ billing.coupon_redeemed(coupon.times_redeemed, coupon.max_redemptions) }}
{% endcall %} {{ items.paginate(coupons) }} {% endif %}
{% endblock %}