{% import 'macros/form.html' as f with context %} {% if request.endpoint.endswith('new') %} {% set endpoint = 'admin.coupons_new' %} {% set form_kwargs = {} %} {% set legend = 'Add a new coupon' %} {% set button = 'Add' %} {% else %} {% set endpoint = 'admin.coupons_edit' %} {% set form_kwargs = {'id': coupon.id} %} {% set legend = 'Update this coupon' %} {% set button = 'Save' %} {% endif %}
You may pick either a percent or amount off.