{% extends 'oscar/dashboard/layout.html' %} {% load currency_filters %} {% load sorting_tags %} {% load i18n %} {% load widget_tweaks %} {% block title %} {% trans "Offers" %} | {{ block.super }} {% endblock %} {% block breadcrumbs %} {% endblock %} {% block header %} {% endblock header %} {% block dashboard_content %}

{% trans "Search" %}

{% for field in form %} {% if field.name in form.basic_fields %} {% if field.is_hidden %} {{ field }} {% else %}
{{ field.label_tag }} {% render_field field class+='form-control' %} {% for error in field.errors %}
  • {{ error }}
{% endfor %} {# No help text as it wraps #}
{% endif %} {% else %} {% endif %} {% endfor %} {% trans "Advanced Search" %} {% trans "Reset" %}
{# Search modal, if there are form errors the form is automatically openend #} {% include "oscar/dashboard/partials/advanced_search_modal.html" with form=advanced_form style='horizontal' %} {% if search_filters %}
{% for filter in search_filters %} {{ filter }} {% endfor %}
{% endif %}
{% csrf_token %} {% if offers %} {% if form.is_bound %} {% if form.is_voucher_offer_type or not form.cleaned_data.offer_type %} {% endif %} {% endif %} {% for offer in offers %} {% if form.is_bound %} {% if form.is_voucher_offer_type or not form.cleaned_data.offer_type %} {% endif %} {% endif %} {% endfor %} {% else %} {% endif %}
{% if search_filters %} {% trans "Offer Search Results" %} {% else %} {% trans "All Offers" %} {% endif %}
{% anchor 'name' _('Offer name') %} {% anchor 'offer_type' _('Offer type') %}{% trans "Num of vouchers" %}{% anchor 'start_datetime' _('Start date') %} {% anchor 'end_datetime' _('End date') %} {% trans "Priority" %} {% trans "Incentive" %} {% trans "Condition" %} {% trans "Is available?" %} {% trans "Restrictions" %} {% anchor 'num_applications' _('Uses') %} {% anchor 'total_discount' _('Cost') %}
{{ offer.name }} {{ offer.offer_type }} {{ offer.vouchers.count }} {{ offer.start_datetime|default:"-" }} {{ offer.end_datetime|default:"-" }} {{ offer.priority }} {{ offer.benefit.description|safe }} {{ offer.condition.description|safe }} {% if offer.is_available %} {% trans "Yes" %} {% else %} {% trans "No" %} {% endif %} {% for restriction in offer.availability_restrictions %} {% if not restriction.is_satisfied %} {% else %} {{ restriction.description }}
{% endif %} {% endfor %}
{{ offer.num_applications }} {{ offer.total_discount|currency }}
{% trans "No offers found." %}
{% include "oscar/dashboard/partials/pagination.html" %}
{% endblock dashboard_content %} {% block onbodyload %} {{ block.super }} {% if advanced_form.errors %}$('#SearchModal').modal('show');{% endif %} {% endblock onbodyload %}