_main_view_item_pod.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /**
  3. * @var $model \app\models\News
  4. * @var $key
  5. * @var $index
  6. * @var $widget
  7. */
  8. use app\models\base\Image;
  9. switch ($index){
  10. case 90:
  11. $className = "main";
  12. break;
  13. case 0:
  14. $className = "high";
  15. break;
  16. default:
  17. $className = "low";
  18. }
  19. if($index == 1) echo \yii\helpers\Html::beginTag("div",["class"=>'group']);
  20. ?>
  21. <div class="news-item <?=$className?>" data-key="<?=$key?>">
  22. <div class="meta">
  23. <h2 class="title"><a href="<?=$model->url?>"><?=$model->title?></a></h2>
  24. <?php if($className!="low"): ?><div class="lead"><?=$model->lid?></div><?php endif;?>
  25. <div class="published_at">
  26. <?=$model->publishedAt?> <?=date("H:i",strtotime($model->dt_pub))?>
  27. <?php if($model->comments=="Y"):?>
  28. <?php
  29. $count=$model->getCommentsAll()->count();
  30. ?>
  31. <?php if($count>0):?>
  32. <span class="commnets">&nbsp;<svg class="icon icon-comments"><use xlink:href="/svg/symbol/sprite-clear.svg#comments"></use></svg><?=$count?></span>
  33. <?php endif;?>
  34. <?php endif;?>
  35. </div>
  36. </div>
  37. </div>