Blame view

frontend/views/accounts/gallery.php 3.16 KB
51e0a262   Yarik   test
1
  <?php
989c83b0   Yarik   test
2
3
4
5
6
7
8
9
      /**
       * @var GallerySearch      $searchModel
       * @var ActiveDataProvider $dataProvider
       */
      use common\models\GallerySearch;
      use yii\data\ActiveDataProvider;
      use yii\grid\GridView;
      use yii\helpers\Html;
4c9663e0   Yarik   test
10
      use yii\jui\DatePicker;
989c83b0   Yarik   test
11
12
13
  
      $this->title = 'Галерея';
      $this->params[ 'breadcrumbs' ][] = $this->title;
51e0a262   Yarik   test
14
  ?>
7fe508fb   Виталий   tokar commit
15
16
  <div class="login-left-column-title"><?= $this->title ?></div>
  <div class="admin-all-pages-add">
989c83b0   Yarik   test
17
      <?= Html::a(Yii::t('app', 'Добавить'), [ 'gallery-create' ], [ 'class' => 'btn btn-success' ]) ?>
7fe508fb   Виталий   tokar commit
18
19
  </div>
  
989c83b0   Yarik   test
20
  <?= GridView::widget([
7fe508fb   Виталий   tokar commit
21
      'options' => ['class'=>'style admin-all-pages-wr'],
989c83b0   Yarik   test
22
23
24
25
26
27
      'dataProvider' => $dataProvider,
      'filterModel'  => $searchModel,
      'columns'      => [
          [
              'attribute' => 'gallery_id',
              'label' => 'ID',
b318fb04   Administrator   15.02.16
28
              'filterOptions' => ['class' => 'text-center']
989c83b0   Yarik   test
29
30
          ],
          'name',
989c83b0   Yarik   test
31
          [
4c9663e0   Yarik   test
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
              'attribute' => 'date_add',
              'filter' => "<div class=\"input-group input-group-xs input-daterange\">
  <span class='field-teamsearch-experience_from_from'>".
                  DatePicker::widget([
                      'model' => $searchModel,
                      'attribute' => 'date_add_from',
                      'language' => 'ru',
                      'dateFormat' => 'yyyy-MM-dd',
                      'clientOptions' => [
                          'changeYear' => true,
                          'changeMonth' => true,
                      ],
                  ]).
                  "</span>
  <span class=\"input-group-addon kv-field-separator\">
  <i class=\"glyphicon glyphicon-resize-horizontal\"></i>
  </span>
  <span class='field-teamsearch-experience_from_to'>".
                  DatePicker::widget([
                      'model' => $searchModel,
                      'attribute' => 'date_add_to',
                      'language' => 'ru',
                      'dateFormat' => 'yyyy-MM-dd',
                      'clientOptions' => [
                          'changeYear' => true,
                          'changeMonth' => true,
                      ],
                  ])
                  ."</span>
  </div>",
              'format' => 'html',
989c83b0   Yarik   test
63
          ],
f59447a7   Yarik   test
64
65
66
67
          [
              'class' => 'yii\grid\ActionColumn',
              'buttons' => [
                  'update' => function($url, $model, $key) {
7fe508fb   Виталий   tokar commit
68
69
70
71
                      return Html::a('<img src="/images/ico_pencil.png" alt="">', ['gallery-update', 'id' => $model->gallery_id
                      ],[
                          'title'        => 'Редактировать',
                      ]);
f59447a7   Yarik   test
72
73
                  },
                  'delete' => function($url, $model, $key) {
7fe508fb   Виталий   tokar commit
74
                      return Html::a('<img src="/images/delete-ico.png" alt="">', ['gallery-delete', 'id' => $model->gallery_id], [
f59447a7   Yarik   test
75
76
77
78
79
80
81
82
83
84
                          'title' => 'Удалить',
                          'aria-label' => 'Удалить',
                          'data-confirm' => 'Вы уверены, что хотите удалить этот элемент?',
                          'data-method' => 'post',
                          'data-pjax' => '0',
                      ]);
                  },
              ],
              'template' => '{update} {delete}'
          ],
989c83b0   Yarik   test
85
86
      ],
  ]) ?>