Назад

Источник шаблона: base_com/catalog/product_description_block.j2

{% from "base/catalog/macro.j2" import product_description %}

{# Плагин removeSmallPics удалит все картинки из заданного контейнера #}
{% if product.type not in [T_EBAY, T_AMAZON, T_ANY_SHOP, T_USER_PRODUCT] %}
    <script type="text/javascript">
        $(document).ready(function () {
            var is_filtered = false;
            $('.description-tab').click(function () {
                if (!is_filtered) {
                    $("#" + window.main_page_prefix + " div#pictures div:not(.preloader)").removeSmallPics({'log_me': false, 'height_lt': 100, 'width_lt': 300});
                    is_filtered = true;
                }
            });
        });
    </script>
{% else %}
    <script type="text/javascript">
        $(document).ready(function () {
            $('.description-tab').click(function () {
                $('#' + window.main_page_prefix + ' div#pictures img').each(function () {
                    $(this).prop('src', $(this).data('src'));
                    $(this).data('src', '');
                });
            });
        });
    </script>
{% endif %}

{% if product.description_images or product.main_description_images %}
    {% for image in product.main_description_images %}
            <div><img class="ProImg" src="{{ product_image(product, image.link) }}" alt="{{ image.alt }}" title="{{ image.title }}" itemprop="image" /></div>
    {% endfor %}
    <br />
    <div id="pictures">
        <div class="preloader" style="display: none">
            <img src="{{ STATIC_URL }}images/preloader.gif"/>
            <span>{{ _("Загрузка дополнительных фотографий") }} ...</span>
        </div>
        <div class="clear"></div>
        {% for image in product.description_images %}
            <div><img class="ProImg" data-src="{{ image.link }}" data-orig-src="{{ image.link }}" alt="{{ image.alt }}" title="{{ image.title }}" /></div>
        {% endfor %}
    </div>
{% endif %}