Commit e3f26847933f5f556fa6227bc3a94bc8dfd88d66
1 parent
27658cd5
Commit
Showing
2 changed files
with
89 additions
and
67 deletions
Show diff stats
frontend/views/company/gallery.php
@@ -10,42 +10,53 @@ | @@ -10,42 +10,53 @@ | ||
10 | 10 | ||
11 | $this->params[ 'company' ] = $company; | 11 | $this->params[ 'company' ] = $company; |
12 | $this->title = 'My Yii Application'; | 12 | $this->title = 'My Yii Application'; |
13 | -?> | ||
14 | -<?php if(!empty( $videos )) { ?> | ||
15 | - <div class="video-performer-wrapper style"> | ||
16 | - <div class="gallery-title">Видео: <?= count($videos) ?></div> | ||
17 | - <div class="slider-video-wr"> | ||
18 | - <div id="demo5" class="scroll-img video-slider"> | ||
19 | - <ul> | ||
20 | - <?php foreach($videos as $video): ?> | ||
21 | - <li> | ||
22 | - <div class="iframe-video"> | ||
23 | - <iframe width="560" height="320" src="<?= $video[ 'youtube' ] ?>" frameborder="0" allowfullscreen></iframe> | ||
24 | - </div> | ||
25 | - | ||
26 | - <a href="#"></a><span></span> | ||
27 | - </li> | ||
28 | - <?php endforeach; ?> | 13 | + if(empty( $videos ) && empty( $gallery->getModels() )) { |
14 | + ?> | ||
15 | + <div class="gallery-performer-wrapper style"> | ||
16 | + <div class="gallery-performer-margin"> | ||
17 | + Галерей к просмотру не найдено | ||
18 | + </div> | ||
19 | + </div> | ||
20 | + <?php | ||
21 | + } else { | ||
22 | + if(!empty( $videos )) { ?> | ||
23 | + <div class="video-performer-wrapper style"> | ||
24 | + <div class="gallery-title">Видео: <?= count($videos) ?></div> | ||
25 | + <div class="slider-video-wr"> | ||
26 | + <div id="demo5" class="scroll-img video-slider"> | ||
27 | + <ul> | ||
28 | + <?php foreach($videos as $video): ?> | ||
29 | + <li> | ||
30 | + <div class="iframe-video"> | ||
31 | + <iframe width="560" height="320" src="<?= $video[ 'youtube' ] ?>" frameborder="0" allowfullscreen></iframe> | ||
32 | + </div> | ||
33 | + <a href="#"></a><span></span> | ||
34 | + </li> | ||
35 | + <?php endforeach; ?> | ||
29 | 36 | ||
30 | - </ul> | 37 | + </ul> |
38 | + </div> | ||
39 | + <div id="demo5-btn" class="text-center"> | ||
40 | + <button class="btn" id="demo5-backward"></button> | ||
41 | + <button class="btn" id="demo5-forward"></button> | ||
42 | + </div> | ||
43 | + </div> | ||
31 | </div> | 44 | </div> |
32 | - <div id="demo5-btn" class="text-center"> | ||
33 | - <button class="btn" id="demo5-backward"></button> | ||
34 | - <button class="btn" id="demo5-forward"></button> | 45 | + <?php } |
46 | + ?> | ||
47 | + <div class="gallery-performer-wrapper style"> | ||
48 | + <div class="gallery-performer-margin"> | ||
49 | + <?= ListView::widget([ | ||
50 | + 'dataProvider' => $gallery, | ||
51 | + 'itemView' => '_gallery_list_view', | ||
52 | + 'summary' => '', | ||
53 | + 'layout' => "{summary}\n{items}\n<div class='navi-buttons-wr style gallery-style'>{pager}</div>", | ||
54 | + ]); ?> | ||
35 | </div> | 55 | </div> |
36 | </div> | 56 | </div> |
37 | - </div> | ||
38 | -<?php } ?> | ||
39 | -<div class="gallery-performer-wrapper style"> | ||
40 | - <div class="gallery-performer-margin"> | ||
41 | - <?= ListView::widget([ | ||
42 | - 'dataProvider' => $gallery, | ||
43 | - 'itemView' => '_gallery_list_view', | ||
44 | - 'summary' => '', | ||
45 | - 'layout' => "{summary}\n{items}\n<div class='navi-buttons-wr style gallery-style'>{pager}</div>", | ||
46 | - ]); ?> | ||
47 | - </div> | ||
48 | -</div> | 57 | + <?php |
58 | + } | ||
59 | +?> | ||
49 | <script> | 60 | <script> |
50 | $( | 61 | $( |
51 | function() | 62 | function() |
frontend/views/performer/gallery.php
1 | <?php | 1 | <?php |
2 | - | ||
3 | - use \yii\helpers\Html; | ||
4 | - use yii\widgets\LinkPager; | 2 | + |
5 | use yii\widgets\ListView; | 3 | use yii\widgets\ListView; |
6 | 4 | ||
7 | - /* @var $this yii\web\View */ | 5 | + /** |
6 | + * @var $this yii\web\View | ||
7 | + */ | ||
8 | 8 | ||
9 | $this->params[ 'user' ] = $user; | 9 | $this->params[ 'user' ] = $user; |
10 | $this->title = 'My Yii Application'; | 10 | $this->title = 'My Yii Application'; |
11 | -?> | ||
12 | -<?php | ||
13 | - if(!empty( $videos )) { | 11 | + if(empty( $videos ) && empty( $gallery->getModels() )) { |
14 | ?> | 12 | ?> |
15 | - <div class="video-performer-wrapper style"> | ||
16 | - <div class="gallery-title">Видео: <?= count($videos) ?></div> | ||
17 | - <div class="slider-video-wr"> | ||
18 | - <div id="demo5" class="scroll-img video-slider"> | ||
19 | - <ul> | ||
20 | - <?php foreach($videos as $video): ?> | ||
21 | - <li> | ||
22 | - <div class="iframe-video"> | ||
23 | - <iframe width="560" height="320" src="<?= $video[ 'youtube' ] ?>" frameborder="0" allowfullscreen></iframe> | ||
24 | - </div> | 13 | + <div class="gallery-performer-wrapper style"> |
14 | + <div class="gallery-performer-margin"> | ||
15 | + Галерей к просмотру не найдено | ||
16 | + </div> | ||
17 | + </div> | ||
18 | + <?php | ||
19 | + } else { | ||
20 | + if(!empty( $videos )) { | ||
21 | + ?> | ||
22 | + <div class="video-performer-wrapper style"> | ||
23 | + <div class="gallery-title">Видео: <?= count($videos) ?></div> | ||
24 | + <div class="slider-video-wr"> | ||
25 | + <div id="demo5" class="scroll-img video-slider"> | ||
26 | + <ul> | ||
27 | + <?php foreach($videos as $video): ?> | ||
28 | + <li> | ||
29 | + <div class="iframe-video"> | ||
30 | + <iframe width="560" height="320" src="<?= $video[ 'youtube' ] ?>" frameborder="0" allowfullscreen></iframe> | ||
31 | + </div> | ||
25 | 32 | ||
26 | - <a href="#"></a><span></span> | ||
27 | - </li> | ||
28 | - <?php endforeach; ?> | 33 | + <a href="#"></a><span></span> |
34 | + </li> | ||
35 | + <?php endforeach; ?> | ||
29 | 36 | ||
30 | - </ul> | ||
31 | - </div> | ||
32 | - <div id="demo5-btn" class="text-center"> | ||
33 | - <button class="btn" id="demo5-backward"></button> | ||
34 | - <button class="btn" id="demo5-forward"></button> | 37 | + </ul> |
38 | + </div> | ||
39 | + <div id="demo5-btn" class="text-center"> | ||
40 | + <button class="btn" id="demo5-backward"></button> | ||
41 | + <button class="btn" id="demo5-forward"></button> | ||
42 | + </div> | ||
35 | </div> | 43 | </div> |
36 | </div> | 44 | </div> |
45 | + <?php | ||
46 | + } | ||
47 | + ?> | ||
48 | + <div class="gallery-performer-wrapper style"> | ||
49 | + <div class="gallery-performer-margin"> | ||
50 | + <?= ListView::widget([ | ||
51 | + 'dataProvider' => $gallery, | ||
52 | + 'itemView' => '_gallery_list_view', | ||
53 | + 'summary' => '', | ||
54 | + 'layout' => "{summary}\n{items}\n<div class='navi-buttons-wr style gallery-style'>{pager}</div>", | ||
55 | + ]); ?> | ||
56 | + </div> | ||
37 | </div> | 57 | </div> |
38 | <?php | 58 | <?php |
39 | } | 59 | } |
60 | + | ||
40 | ?> | 61 | ?> |
41 | -<div class="gallery-performer-wrapper style"> | ||
42 | - <div class="gallery-performer-margin"> | ||
43 | - <?= ListView::widget([ | ||
44 | - 'dataProvider' => $gallery, | ||
45 | - 'itemView' => '_gallery_list_view', | ||
46 | - 'summary' => '', | ||
47 | - 'layout' => "{summary}\n{items}\n<div class='navi-buttons-wr style gallery-style'>{pager}</div>", | ||
48 | - ]); ?> | ||
49 | - </div> | ||
50 | -</div> | ||
51 | <script> | 62 | <script> |
52 | $( | 63 | $( |
53 | function() | 64 | function() |