Blame view

frontend/views/accounts/_gallery_form.php 2.68 KB
ea09d15d   Yarik   test
1
2
3
4
5
  <?php
      /**
       * @var Gallery $gallery
       * @var User $user
       */
3f7185f2   Yarik   test
6
      use common\components\Request;
ea09d15d   Yarik   test
7
8
      use common\models\Gallery;
      use common\models\User;
ea09d15d   Yarik   test
9
      use common\widgets\ImageUploader;
ea09d15d   Yarik   test
10
11
12
      use yii\helpers\Html;
      use yii\widgets\ActiveForm;
  
7fe508fb   Виталий   tokar commit
13
      $this->title = 'Галерея Фото';
ea09d15d   Yarik   test
14
15
      $this->params[ 'breadcrumbs' ][] = $this->title;
  ?>
7fe508fb   Виталий   tokar commit
16
  <div class="login-left-column-title"><?= $this->title ?></div>
ea09d15d   Yarik   test
17
18
19
20
  
  <?php
      $form = ActiveForm::begin();
  ?>
7fe508fb   Виталий   tokar commit
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
  <div class="input-blocks-wrapper full-blocks data-block">Дата создания: <?= $gallery->date_add ?></div>
  <div class="login-left-column-title-two admin-gallery-photo-edit style">Редактирование:</div>
  
  <div class="input-blocks-wrapper">
      <div class="input-blocks">
          <?= $form->field($gallery, 'name')
              ->textInput (['class'=> 'custom-input-2']) ?>
      </div>
  </div>
  
  <div class="input-blocks-wrapper admin-avatar amin-team-foto">
      <?= ImageUploader::widget([
          'model'   => $gallery,
          'field'   => 'cover',
          'width'   => 210,
          'height'  => 150,
          'multi'   => false,
          'gallery' => $gallery->cover,
          'name'    => 'Загрузить главное фото',
      ]); ?>
  </div>
2d6738ad   Виталий   tokar commit
42
43
44
45
46
47
48
49
50
51
52
  <div class="admin-gallery-photos-load-wr style">
      <?= ImageUploader::widget([
          'model'   => $gallery,
          'field'   => 'photo',
          'width'   => 152,
          'height'  => 108,
          'multi'   => true,
          'gallery' => $gallery->photo,
          'name'    => 'Загрузить фото галереи',
      ]); ?>
  </div>
ea09d15d   Yarik   test
53
  
9217ef8e   Administrator   09.02.16
54
  
ea09d15d   Yarik   test
55
  
2d6738ad   Виталий   tokar commit
56
  <div class="input-blocks-wrapper">
04b478b9   Виталий   tokar commit
57
      <div class="admin-save-btn skills-save-btn admin-add-remove-wr style">
3a1bbfcc   Yarik   test
58
          <?= Html::submitButton($gallery->isNewRecord?'Добавить':'Обновить', [ 'class' => 'input-blocks-wrapper button' ]) ?>
04b478b9   Виталий   tokar commit
59
60
          <div class="admin-remove-note">
              <?php
3a1bbfcc   Yarik   test
61
62
63
64
65
66
67
68
69
70
71
72
              if(!$gallery->isNewRecord) {
                  echo Html::a('Удалить', [
                      'accounts/gallery-delete',
                      'id' => $gallery->gallery_id,
                  ], [
                      'title'        => 'Удалить',
                      'aria-label'   => 'Удалить',
                      'data-confirm' => 'Вы уверены, что хотите удалить этот элемент?',
                      'data-method'  => 'post',
                      'data-pjax'    => 0,
                  ]);
              }
04b478b9   Виталий   tokar commit
73
74
75
76
              ?>
          </div>
  
          <div class="admin-back-note">
1c67655e   Yarik   test
77
              <?= Html::a('вернуться', Request::getIsLocal(\Yii::$app->request->referrer)?\Yii::$app->request->referrer:['accounts/gallery' ]) ?>
04b478b9   Виталий   tokar commit
78
          </div>
2d6738ad   Виталий   tokar commit
79
80
81
      </div>
  </div>
  
ea09d15d   Yarik   test
82
83
84
85
  
  <?php
      $form->end();
  ?>