{% extends "oscar/layout.html" %}


{% load i18n %}
{% load product_tags %}

{% block title %}
{{ offer.name }} | {{ block.super }}
{% endblock %}

{% block breadcrumbs %}
    <nav aria-label="breadcrumb">
        <ol class="breadcrumb">
            <li class="breadcrumb-item">
                <a href="{{ homepage_url }}">{% trans "Home" %}</a>
            </li>
            <li class="breadcrumb-item">
                <a href="{% url 'offer:list' %}">{% trans "Offers" %}</a>
            </li>
            <li class="breadcrumb-item active" aria-current="page">{{ offer.name }}</li>
        </ol>
    </nav>
{% endblock %}

{% block headertext %}{{ offer.name }}{% endblock %}

{% block content %}

    {% if not offer.is_available %}
        <div class="alert alert-danger">{% trans " This offer is no longer available." %}</div>
    {% endif %}

    {% if upsell_message %}
    <div class="row">
        {% if offer.description %}
            <div class="col-sm-7">
                <p>{{ offer.description|safe }}</p>
            </div>
        {% endif %}
        <div class="col-sm-5">
            <div class="card card-body bg-light">
                <h2 class="h4"><i class="fas fa-exclamation"></i> {% trans "What you need to do" %}</h2>
                <p>{{ upsell_message }}</p>
            </div>
        </div>
    </div>
    {% endif %}

    {% if products %}
        <section>
            <div>
                {% include "oscar/partials/pagination.html" %}
                <ol class="row list-unstyled ml-0 pl-0">
                    {% for product in products %}
                    <li class="col-sm-4 col-md-3 col-lg-3">{% render_product product %}</li>
                    {% endfor %}
                </ol>
                {% include "oscar/partials/pagination.html" %}
            </div>
        </section>
    {% else %}
    <p class="nonefound">{% trans "No products found." %}</p>
    {% endif %}
{% endblock content %}
