{% load jmbo_template_tags jmbo_inclusion_tags pagination_tags %}

{% if object_list.exists %}
    <div class="jmbo-listing jmbo-listing-promo" data-oid="{{ identifier|default:listing.id }}">

        {% if listing.title %}<div class="title">{{ listing.title }}</div>{% endif %}

        {% if pinned_list %}
            <div class="pinned-items">
           {% for object in pinned_list %}
               <div class="item {% if forloop.first %}first{% endif %} {% if forloop.last %}last{% endif %}
                           item-{{ object.content_type.app_label }}
                           item-{{ object.content_type.app_label }}-{{ object.content_type.model_name }}">
                   {% render_object object.as_leaf_class "listing_item_promo_pinned" %}
                   <div class="clear"></div>
               </div>
           {% endfor %}
            </div>
        {% endif %}

        <div class="items">
            {% if items_per_page %}
                {% autopaginate object_list items_per_page %}
            {% endif %}
            {% for object in object_list %}
                <div class="item {% if forloop.first %}first{% endif %} {% if forloop.last %}last{% endif %}
                           item-{{ object.content_type.app_label }}
                           item-{{ object.content_type.app_label }}-{{ object.content_type.model_name }}">
                    {% render_object object.as_leaf_class "listing_item_promo" %}
                    <div class="clear"></div>
                </div>
            {% endfor %}
        </div>
        {% if items_per_page %}
            {% paginate %}
        {% endif %}

    </div>
{% endif %}
