_item.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. /**
  3. * @var $this \yii\web\View
  4. * @var $model \app\models\News
  5. * @var $index integer
  6. */
  7. use yii\helpers\ArrayHelper;
  8. ?>
  9. <div class="row">
  10. <div class="col-md-8">
  11. <div id="post-<?=$model->id?>" class="post">
  12. <?//= Yii::$app->user->can('admin') ? $this->render('@app/views/news/view/admin/edit_btn', ['model'=>$model]) : "";?>
  13. <?=$this->render("/layouts/breadcrumbs")?>
  14. <h1><a href="<?=$model->getUrl()?>"><?=$model->title?></a></h1>
  15. <p class="lead"><?=$model->lid?></p>
  16. <p class="published_at">
  17. <?=$model->publishedAt?> <?=date("Y, H:m")?>
  18. <?php if(($count = $model->getCommentsAll()->count())>0):?>
  19. <span class="commnets">&nbsp;<svg class="icon icon-comments"><use xlink:href="/svg/symbol/sprite-clear.svg#comments"></use></svg><?=$count?></span>
  20. <?php endif;?>
  21. </p>
  22. <p>
  23. <?php if($model->photo_include == 'Y' && $model->image instanceof \app\models\base\Image):?>
  24. <a href="<?=$model->getUrl()?>">
  25. <div class="picture-cont-16x9">
  26. <picture class="w-100">
  27. <source srcset="<?=$model->image->url?>" media="(min-width: 600px)">
  28. <img src="<?=$model->image->url?>" alt="<?=$model->photo_title?>" class="w-100">
  29. </picture>
  30. </div>
  31. </a>
  32. <?php endif;?>
  33. </p>
  34. <section class="read_more text-center">
  35. <a href="<?=$model->getUrl()?>" class="button button_grey">Читать полностью</a>
  36. </section>
  37. </div>
  38. </div>
  39. </div>
  40. <?php if(($index % 5) == 0 && $index!=0):?>
  41. <?=$this->render('@app/views/_etc/banners/partner3D',["index"=>$index])?>
  42. <?=$this->render('@app/views/_etc/banners/partner2D',["index"=>$index])?>
  43. <?=$this->render('@app/views/_etc/banners/partner1D',["index"=>$index])?>
  44. <?php endif;?>