Blame view

frontend/views/blog/_article.php 2.51 KB
298bc0f4   Alexey Boroda   first commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
  <?php
      
      use artbox\core\helpers\ImageHelper;
      use yii\bootstrap\Html;
      use artbox\core\helpers\Url;
      
      /**
       * @var \common\models\blog\Article $model
       */
  
  ?>
  
  <section class="post">
    <div class="row">
      <div class="col-xs-4 col-sm-4 col-md-4">
        <div class="image">
          <a href="<?= Url::to(
              [
                 'alias' => $model->alias
              ]
          ) ?>">
              <?= ImageHelper::set($model->image ? $model->image->getPath() : '@frontend/web/img/no-image.png')
                             ->cropResize(263, 197)
                             ->renderImage(
                                 [
                                     'class' => 'img-responsive',
                                     'alt'   => $model->title,
                                 ]
                             ) ?>
          </a>
        </div>
      </div>
      <div class="col-xs-8 col-sm-8 col-md-8">
        <h2><a href="<?= Url::to(
                [
                  'alias' => $model->alias
                ]
            ) ?>"><?= $model->title; ?></a></h2>
        <div class="clearfix">
            <?php if (empty($model->categories)) { ?>
24af1c1a   alex   Убрал с новостей ...
41
  <!--            <p class="author-category">Без категории </p>-->
298bc0f4   Alexey Boroda   first commit
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
            <?php } else {
                $i = 0;
                foreach ($model->categories as $category) {
                    $i++;
                    ?>
                  <p class="author-category">
                    <a href="<?=Url::to(['alias' => $category->alias])?>"><?=$category->title?></a>
                      <?php
                         
                          if ($i === count($model->categories)) {
                              echo '&#160';
                          } else {
                              echo '&#44&#160';
                          }
                      ?></p>
                    <?php
                }
            } ?>
          <p class="date-comments">
929c9486   alex   Поредактировал фо...
61
      
351fa8a5   alex   Временно убрал ча...
62
63
  <!--            <i class="fa fa-calendar-o"></i> -->
              <?php  // echo  \Yii::$app->formatter->asDate($model->created_at, 'short'); ?>
298bc0f4   Alexey Boroda   first commit
64
65
66
67
68
69
            <!--          <a href="blog-post.html"><i class="fa fa-comment-o"></i> 8 комментариев</a>-->
          </p>
        </div>
        <p class="intro"><?= $model->body_preview; ?></p>
        <p class="read-more">
            <?= Html::a(
724d0056   Виталий   forms-reduction
70
                \Yii::t('app', 'Continue reading'),
298bc0f4   Alexey Boroda   first commit
71
72
73
74
75
76
77
78
79
80
81
                [
                    '', 'alias' => $model->alias
                ],
                [
                    'class' => 'btn btn-template-main',
                ]
            ) ?>
        </p>
      </div>
    </div>
  </section>