Blame view

frontend/views/accounts/_portfolio_form.php 6.74 KB
7eb29439   Yarik   test
1
2
3
  <?php
      /**
       * @var Portfolio $portfolio
1b56164e   Yarik   test
4
       * @var integer[] $specializations
7eb29439   Yarik   test
5
6
7
       */
      use common\models\Option;
      use common\models\Portfolio;
9fdba9c2   Administrator   15.02.16
8
9
  use common\models\Specialization;
  use common\widgets\ImageUploader;
7eb29439   Yarik   test
10
      use mihaildev\ckeditor\CKEditor;
f7089e23   Administrator   15.02.16
11
12
  use yii\helpers\ArrayHelper;
  use yii\helpers\Html;
7eb29439   Yarik   test
13
14
      use yii\widgets\ActiveForm;
      use \common\widgets\MultiLangForm;
b20e4b53   Виталий   tokar commit
15
16
  use kartik\select2\Select2;
  use yii\web\JsExpression;
7eb29439   Yarik   test
17
  
b20e4b53   Виталий   tokar commit
18
      $this->title = 'Портфолио';
7eb29439   Yarik   test
19
20
      $this->params[ 'breadcrumbs' ][] = $this->title;
  ?>
b20e4b53   Виталий   tokar commit
21
  <div class="login-left-column-title"><?= $this->title ?></div>
7eb29439   Yarik   test
22
23
24
25
  
  <?php
      $form = ActiveForm::begin();
  ?>
b20e4b53   Виталий   tokar commit
26
27
  <div class="input-blocks-wrapper full-blocks data-block">
      <?= !empty($portfolio->date_add) ? "Дата создания: $portfolio->date_add" :""?>
7eb29439   Yarik   test
28
  
b20e4b53   Виталий   tokar commit
29
30
  </div>
  <div class="style">
7eb29439   Yarik   test
31
  
b20e4b53   Виталий   tokar commit
32
33
34
35
36
37
      <div class="input-blocks-wrapper">
          <div class="input-blocks">
              <?= $form->field($portfolio, 'name')
                  ->textInput (['class'=> 'custom-input-2 fix-input-2']); ?>
          </div>
      </div>
7eb29439   Yarik   test
38
  
b20e4b53   Виталий   tokar commit
39
40
41
42
43
44
      <div class="input-blocks-wrapper">
          <div class="input-blocks">
              <?= $form->field($portfolio, 'link')
                  ->textInput (['class'=> 'custom-input-2 fix-input-2']); ?>
          </div>
      </div>
7eb29439   Yarik   test
45
  
1b56164e   Yarik   test
46
47
48
49
50
51
52
      <div class="input-blocks-wrapper">
          <ul class="content-menu-first">
              <?php foreach($specializations as $specialization): ?>
                  <li data-img="<?= $specialization->image ?>">
                      <span data-menu-bg="<?= $specialization->background ?>" style="background: <?= $specialization->background ?>"></span><a href="#"><?= $specialization->specialization_name ?></a>
                      <ul>
                          <?php foreach($specialization->children as $child_first): ?>
7eb29439   Yarik   test
53
  
1b56164e   Yarik   test
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
                              <?php if($child_first instanceof Specialization): ?>
                                  <li>
                                      <a href="#"><?= $child_first->specialization_name ?></a>
                                      <ul>
                                          <?php foreach($child_first->children as $child_second): ?>
                                              <?php if($child_first instanceof Specialization): ?>
                                                  <li>
                                                      <a href="#">
                                                          <?= $form->field($portfolio, "specializationInput[{$child_second->specialization_id}]")
                                                                   ->checkbox([
                                                                       'value'   => $child_second->specialization_id,
                                                                       'label'   => $child_second->specialization_name,
                                                                       'uncheck' => NULL,
                                                                   ]) ?>
                                                      </a>
                                                  </li>
                                              <?php endif; ?>
                                          <?php endforeach; ?>
                                      </ul>
                                  </li>
                              <?php endif; ?>
                          <?php endforeach; ?>
9fdba9c2   Administrator   15.02.16
76
  
1b56164e   Yarik   test
77
78
79
80
81
                      </ul>
                  </li>
              <?php endforeach; ?>
          </ul>
      </div>
7eb29439   Yarik   test
82
  
7eb29439   Yarik   test
83
  
7eb29439   Yarik   test
84
  
b20e4b53   Виталий   tokar commit
85
86
87
88
89
90
      <div class="input-blocks-wrapper admin-avatar portfolio-foto-admin hidden-foto foto-portfolio-adm">
          <div class="gen-admin-title">Фото главное</div>
          <div class="not-file-txt-adm">Файл не выбран</div>
          <?= ImageUploader::widget([
              'model'=> $portfolio,
              'field'=>'cover',
f7089e23   Administrator   15.02.16
91
92
              'width'=>210,
              'height'=>150,
b20e4b53   Виталий   tokar commit
93
94
95
96
97
98
99
100
              'multi'=>false,
              'gallery' =>$portfolio->cover,
              'name' => 'Загрузить'
          ]);
          ?>
          <div class="not-file-mb-adm">До 3 Мб файл</div>
      </div>
  
b20e4b53   Виталий   tokar commit
101
102
103
104
      <div class="input-blocks-wrapper">
          <div class="input-blocks">
              <?=
              $form->field($portfolio, 'city')->widget(Select2::classname(), [
8e5fa1e8   Виталий   tokar commit
105
                  'options' => ['class' => 'Выбор города ...'],
b20e4b53   Виталий   tokar commit
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
                  'pluginOptions' => [
                      'allowClear' => true,
                      'minimumInputLength' => 3,
                      'ajax' => [
                          'url' => \yii\helpers\Url::to(['site/city']),
                          'dataType' => 'json',
                          'data' => new JsExpression('function(params) { return {q:params.term}; }')
                      ],
                      'escapeMarkup' => new JsExpression('function (markup) { return markup; }'),
                      'templateResult' => new JsExpression('function(city) { return city.text; }'),
                      'templateSelection' => new JsExpression('function (city) { return city.text; }'),
                  ],
              ]);
              ?>
  
          </div>
  
          <div class="input-blocks street-input">
              <?= $form->field ($portfolio, 'street', ['options' => ['class' => 'form-group company_info']])
                  ->label ('Улица')
                  ->textInput (['class'=> 'custom-input-2']);
              ?>
          </div>
  
          <div class="input-blocks home-input">
              <?= $form->field ($portfolio, 'house', ['options' => ['class' => 'form-group company_info']])
                  ->label ('Дом')
                  ->textInput (['class'=> 'custom-input-2']);
              ?>
          </div>
      </div>
  
  
  
      <div class="input-blocks-wrapper full-blocks admin-editor-bl">
          <div class="input-blocks">
              <?= $form->field($portfolio, 'description')->widget(CKEditor::className()) ?>
          </div>
      </div>
  
  </div>
  
3a1bbfcc   Yarik   test
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
  <div class="input-blocks-wrapper">
      <div class="admin-save-btn skills-save-btn style">
          <?= Html::submitButton($portfolio->isNewRecord?'Добавить':'Обновить', [ 'class' => 'input-blocks-wrapper button' ]) ?>
          <?php
              if(!$portfolio->isNewRecord) {
                  echo Html::a('Удалить', [
                      'accounts/portfolio-delete',
                      'id' => $portfolio->portfolio_id,
                  ], [
                      'title'        => 'Удалить',
                      'aria-label'   => 'Удалить',
                      'data-confirm' => 'Вы уверены, что хотите удалить этот элемент?',
                      'data-method'  => 'post',
                      'data-pjax'    => 0,
                  ]);
              }
          ?>
          <?= Html::a('Отменить', [ 'accounts/portfolio' ]) ?>
b20e4b53   Виталий   tokar commit
166
167
      </div>
  </div>
7eb29439   Yarik   test
168
169
170
  <?php
      $form->end();
  ?>
8e5fa1e8   Виталий   tokar commit
171
172
173
174
  <script>
      $(document).ready(function(){
  
      })
f7089e23   Administrator   15.02.16
175
  </script>