<?php
    use yii\helpers\Url;
    use common\modules\users\widgets;
    use common\modules\school\assets\WidgetAssetBundle;
    
    WidgetAssetBundle::register($this);
?>

<?=$this->render('@frontend/views/layouts/header-school-auth')?>

<section class="les_list_top"  style="background: url(<?php echo $model->getUrl($model->image);?>) no-repeat center center; background-size: 100% auto;">
    <div class="ls_top_over">
        <div class="container">
            <div class="row">
                <div class="col-md-12 col-xs-12 col-sm-12">
                    <h1 class="ls_title">
                        <span><?php echo $model->title;?></span>
                    </h1>
                    <div class="ls_subtitle">
                        <?php echo $model->description_for_course;?>
                    </div>
                    <br>
                    <div class="ls_txt"><span>В роликах будет рассказываться:</span></div>
                    <a href="#" class="ls_now_btn">Приступить</a>
                </div>
            </div>
        </div>
    </div>
</section>
<section class="ls_list_block">
    <div class="container">
        <div class="row">
            
            <?php echo \yii\widgets\ListView::widget( [
                    'dataProvider' => $dataProvider,
                    'itemView' => 'item-view-lesson',
                    'itemOptions' => ['tag' => 'div class="col-md-3 col-xs-6 col-sm-12"'],
                    'options' => ['tag' => 'div class="lessons-block"'],
                    'emptyTextOptions' => [ 'tag' => 'div', 'class' => 'empty-text' ],
                    'layout' => '{items}<div class="clear"></div><li><nav class="pages">{pager}</nav></li>',
                    'pager' => [
                        'class' => 'common\components\zii\FrontLinkPager',
                        'activePageCssClass' => 'is-active',
                        'prevPageLabel' => '<span class="glyphicon glyphicon-chevron-left"></span>',
                        'nextPageLabel' => '<span class="glyphicon glyphicon-chevron-right"></span>',
                        'options' => [
                            'class' => 'pages-list',
                        ],
                    ],
                ] );
                ?> 
            <div class="clear"></div>
            <?php if (!Yii::$app->user->isGuest):?>
                <div class="col-md-3 col-xs-6 col-sm-12">
                    <div class="ls_likes">
                        <div class="ls_likes_title">Нравится курс?</div>
                        <a href="javascript:void(0)" class="ls_likes_y <?php echo $model->getEstimateCourseLike($model->id) ? 'ls_likes_y_choice':'';?>" 
                           data-course="<?php echo $model->id;?>">Да</a>
                        <a href="javascript:void(0)" class="ls_likes_n <?php echo $model->getEstimateCourseUnlike($model->id) ? 'ls_likes_n_choice':'';?>" 
                           data-course="<?php echo $model->id;?>">Нет</a>
                    </div>
                </div>
            <?php endif;?>
    </div>
</section>

<?php echo $this->render('@app/views/layouts/footer-short'); ?>