<?php
if(count($partners) > 0){
    ?>
    <tr>
        <td>
            <div class="lending_area_4 lending_area_partner">
                <div class="max_width">
                    <div class="partner">

                        <div class="caption"><?php echo __('Наши партнёры'); ?></div>

                        <div class="partner_slideshow slideshow_wrap mobile_hide">
                            <div class="slideshow"
                             data-cycle-fx="carousel"
                             data-cycle-slides="> .partner_slideshow__item"
                             data-cycle-timeout="3000"
                             data-cycle-prev=".for_partners.slideshow_arrow.left"
                             data-cycle-next=".for_partners.slideshow_arrow.right"
                             data-cycle-carousel-visible="4"
                             data-cycle-easing="linear"
                             data-cycle-pause-on-hover="true">
                                <?php foreach ($partners as $partner) { ?>
                                    <div class="partner_slideshow__item slideshow__item">
                                        <div class="partner_slideshow__item__image" style="background-image: url(/u/i/<?php echo Page::replaceImageSize($partner['cover'], 'S'); ?>)"></div>
                                        <div class="partner_slideshow__item__title"><?php echo $partner['title']; ?></div>
                                    </div>
                                <?php } ?>
                            </div>
                            <div class="for_partners slideshow_arrow left"></div>
                            <div class="for_partners slideshow_arrow right"></div>
                        </div>

                        <div class="partner_slideshow slideshow_wrap mobile">
                            <div class="slideshow"
                             data-cycle-fx="scrollHorz"
                             data-cycle-slides="> .partner_slideshow__item"
                             data-cycle-timeout="3000"
                             data-cycle-prev=".for_partners.slideshow_arrow.left"
                             data-cycle-next=".for_partners.slideshow_arrow.right"
                             data-cycle-swipe="true"
                             data-cycle-swipe-fx="scrollHorz"
                             data-cycle-pause-on-hover="true">
                                <?php foreach ($partners as $partner) { ?>
                                    <div class="partner_slideshow__item slideshow__item">
                                        <div class="partner_slideshow__item__image" style="background-image: url(/u/i/<?php echo Page::replaceImageSize($partner['cover'], 'S'); ?>)"></div>
                                        <div class="partner_slideshow__item__title"><?php echo $partner['title']; ?></div>
                                    </div>
                                <?php } ?>
                            </div>
                        </div>

                    </div>
                </div>
            </div>

            <script type="text/javascript">
                if(!$('.mobile').is(":visible")) {
                    $('.partner_slideshow.mobile_hide .slideshow').cycle();
                } else {
                    $('.partner_slideshow.mobile .slideshow').cycle();
                }
            </script>

        </td>
    </tr>
    <?php
}
?>