<?php
/**
 * @var $this ActionController
 * @var $content string
 * @var $actions Action[]
 * @var $currentCategory ActionCategory|null
 */
?>
<?php $this->renderPartial('//snippets/headerGallery');?>

<div class="wrapper content-wrapper">
    <div class="col-wrapper">
        <div class="col10">
            <h1><?php echo CHtml::encode($this->pageName)?></h1>

            <div class="text-content">
                <?php echo $content ?>
            </div>

            <div class="slider-wrapper action-page-slider" id="main-page-slider">
                <div class="slides-container" style="height: 401px; overflow: hidden;">
                    <?php foreach ($actions as $action): ?>
                        <div class="slide">
                            <?php echo CHtml::link(CHtml::image($action->imageBehavior->getFileUrl('preview')), array('action/view', 'link' => $action->link, 'category' => $action->actionCategory->link))?>
                            <div class="caption">
                                <span class="name"><?php echo CHtml::encode($action->i18n->name)?></span>
                                <span class="short"><?php echo CHtml::encode($action->i18n->short)?></span>
                                <?php if($action->status == 'active'):?>
                                    <span class="short"><?php echo Yii::t('site','Осталось');?> <?= $action->dayLeft?> дней</span>
                                <?php else:?>
                                    <span class="short over-action">Завершена</span>
                                <?php endif; ?>

                            </div>
                        </div>
                    <?php endforeach;?>
                </div>
                <a class="prev"></a>
                <a class="next"></a>
            </div>
            <?php
            /** @var $cs CClientScript */
            $cs = Yii::app()->getClientScript();
            $cs->registerCoreScript('jquery');
            $cs->registerScriptFile('/js/slides.min.jquery.js');
            $src = <<<JS
$('#main-page-slider').slides({
    'container':'slides-container',
    'next':'next',
    'prev':'prev',
    'paginationClass':'slide-pagination',
    'currentClass':'active',
    'generatePagination':false,
    'play': 50000000,
    'pause': 2500,
    'hoverPause': true
});
JS;

            $cs->registerScript('main-page-gallery', $src);
            ?>


        </div>
        <div class="col2">
            <p class="section-title"><?php echo Yii::t('site','Есть вопросы?');?></p>

            <div class="text-content">
                <?php echo Yii::t('site','Обращайтесь к вашему персональному консультанту (акции)!');?>
            </div>
            <?php $this->renderPartial('//snippets/sidebarContacts');?>
        </div>
    </div>
</div>
        