Commit 149959cb886c07de93dcdf2bcaa78b03fe5d1924

Authored by alex
1 parent 4055ab1d

Поменял логику работы виджета Parthenr 3

frontend/web/css/site.css
@@ -122,4 +122,5 @@ a.desc:after { @@ -122,4 +122,5 @@ a.desc:after {
122 .image_figcapture 122 .image_figcapture
123 { 123 {
124 font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif; 124 font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
125 -}  
126 \ No newline at end of file 125 \ No newline at end of file
  126 +}
  127 +
frontend/widgets/views/_parthnerList.php
@@ -3,30 +3,23 @@ @@ -3,30 +3,23 @@
3 * @var $data frontend\widgets\ParthnersList 3 * @var $data frontend\widgets\ParthnersList
4 */ 4 */
5 5
  6 +use common\models\Partner;
6 use artbox\core\components\imagemanager\models\ImageManager; 7 use artbox\core\components\imagemanager\models\ImageManager;
7 -use yii\helpers\Url;  
8 - 8 +use artbox\core\components\imagemanager\components\ImageManagerGetPath;
9 9
10 ?> 10 ?>
11 11
12 <ul class="owl-carousel customers" > 12 <ul class="owl-carousel customers" >
13 - <?php ?>  
14 - <?php foreach ($data as $parthner):?>  
15 -  
16 - <?php  
17 - $logo = null;  
18 - if ($parthner->image) {  
19 - $logo_img = ImageManager::findOne($parthner->image->id);  
20 - if ($logo_img) {  
21 - $logo = $logo_img->getImagePathPrivate() ?? $logo;  
22 - }  
23 - }  
24 - $file = $logo;  
25 - ?>  
26 13
27 14
28 - <li class="item">  
29 - <a target="_blank" href="<?= $parthner->link; ?>"><img src="<?= $file; ?>" alt=""></a>  
30 - </li>  
31 -<?php endforeach;?>  
32 - </ul>  
33 \ No newline at end of file 15 \ No newline at end of file
  16 + <?php foreach ($data as $parthner):?>
  17 + <li class="item">
  18 + <?php
  19 + $logo_img = ImageManager::findOne($parthner->image->id);
  20 + $logo = $logo_img->getImagePathPrivate();
  21 + $logo = stristr($logo, '/storage');
  22 + if ($logo === false) $logo = '/img/no-image.png';
  23 + ?>
  24 + <a href="<?php echo $parthner->link; ?>"><img src="<?php echo $logo; ?>" alt="" class="img-responsive"></a>
  25 + </li>
  26 + <?php endforeach; ?>