Blame view

frontend/views/performer/blog-view.php 2.95 KB
14a09168   Alex Savenko   init 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
  <?php
      /**
       * @var yii\web\View $this
       * @var Blog         $article
       */
      use common\models\Blog;
      use yii\helpers\Html;
      use yii\helpers\Url;
      
      $this->params[ 'user' ] = $user;
      
      $this->title = $article->name;
  ?>
  <div class="performer-vacancy-vacant-title-reclam-wr style">
      <div class="blog-post-wr">
          <div class="blog-post-title style"><p><?= $article->name ?></p></div>
          <div class="blog-post-icons-wr style">
              <div class="blog-post-date">
                  <span></span>
                  <p><?= \Yii::$app->formatter->asDate($article->date_add, 'php:d.m.Y') ?></p>
              </div>
              <div class="blog-post-views">
                  <span></span>
                  <p><?= $article->view_count ?></p>
              </div>
              <div class="blog-post-comm-num">
                  <span></span>
                  <p><?= count($article->comments) ?></p>
              </div>
          </div>
          <div class="blog-post-content style">
              <?= $article->description ?>
          </div>
          <div class="share-buttons-new">
              <p class="share-buttons-new-title">Поделиться</p>
              <p class="share-buttons-new-link">
                  <?php
                      echo Html::a(Html::img('/images/ico-vk.png'), 'http://vk.com/share.php?url=' . Url::current([], true), [
                          'target' => '_blank',
                      ]);
                      echo Html::a(Html::img('/images/ico-fb.png'), 'http://www.facebook.com/sharer/sharer.php?u=' . Url::current([], true), [
                          'target' => '_blank',
                      ]);
                      echo Html::a(Html::img('/images/ico-google.png'), 'https://plus.google.com/share?url=' . Url::current([], true), [
                          'target' => '_blank',
                      ]);
                  ?>
              </p>
          </div>
      </div>
  </div>
  <?php
      echo \common\modules\comment\widgets\CommentWidget::widget([
          'context'       => $this,
          'model'         => $article::className(),
          'model_id'      => $article->blog_id,
          'comment_class' => \common\modules\comment\models\Comment::className(),
          'rating_class'  => \common\modules\comment\models\Rating::className(),
          'class_options' => [
              'scenario'     => is_int(\Yii::$app->user->getId()) ? \common\modules\comment\models\Comment::SCENARIO_USER : \common\modules\comment\models\Comment::SCENARIO_GUEST,
              'user_id'      => \Yii::$app->user->getId(),
              'guestComment' => false,
              'status'       => \common\modules\comment\models\Comment::STATUS_ACTIVE,
          ],
          'list_options'  => [
              'view' => 'list-comment',
          ],
          'form_options'  => [
              'view'  => 'form-comment',
              'tag'   => 'div',
              'class' => 'artbox_comment_form',
          ],
          'options'       => [
              'class' => 'new-portf-comments-wr style',
          ],
      ]);
  ?>