Blame view

frontend/views/accounts/general.php 15.6 KB
51e0a262   Yarik   test
1
2
3
4
5
6
7
  <?php
      /**
       * @var UserInfo    $user_info
       * @var User        $user
       * @var CompanyInfo $company_info
       */
      use common\models\CompanyInfo;
51e0a262   Yarik   test
8
      use common\models\Option;
51e0a262   Yarik   test
9
10
      use common\models\User;
      use common\models\UserInfo;
8c448b56   Administrator   add yii jquery
11
      use common\modules\file\widgets\ImageUploader;
51e0a262   Yarik   test
12
13
      use yii\helpers\Html;
      use yii\widgets\ActiveForm;
51e0a262   Yarik   test
14
      use \common\widgets\MultiLangForm;
3364fb6a   Виталий   tokar commit
15
16
      use kartik\select2\Select2;
      use yii\web\JsExpression;
51e0a262   Yarik   test
17
18
  
      $this->title = 'Учетные данные';
229730f9   Yarik   test
19
      $this->params[ 'breadcrumbs' ][] = $this->title;
51e0a262   Yarik   test
20
  ?>
d8e2d677   Виталий   tokar commit
21
  <div class="login-left-column-title"><?= $this->title ?></div>
8f5d4d0f   Yarik   test
22
23
24
25
26
27
28
29
30
31
32
33
34
  <?php
      $reg_success = \Yii::$app->session->removeFlash('reg_success');
      if(!empty( $reg_success )) {
          echo Html::tag('div', Html::button(Html::tag('span', '×', [ 'aria-hidden' => true ]), [
              'class'        => 'close',
              'data-dismiss' => 'alert',
              'aria-label'   => 'close',
          ]).$reg_success, [
              'class' => 'alert alert-success alert-dismissible fade in',
              'role'  => 'alert',
          ]);
      }
  ?>
51e0a262   Yarik   test
35
  <div class="" id="form_definition">
766bd93b   Yarik   test
36
      <?php $form = ActiveForm::begin(); ?>
d8e2d677   Виталий   tokar commit
37
  
0dfdb6ef   Виталий   tokar commit
38
39
      <div class="general-check-wr style">
          <div class="general-check">
0dfdb6ef   Виталий   tokar commit
40
              <div class="general-check-left">
35b03e57   Administrator   add yii jquery
41
                  <?= $form->field($user_info, 'is_freelancer', [ 'template' => "{input}\n{label}\n{error}" ])
766bd93b   Yarik   test
42
                           ->label('<span></span>Я - исполнитель')
766bd93b   Yarik   test
43
                           ->checkbox([
229730f9   Yarik   test
44
                               'class' => 'custom-check admin-check',
766bd93b   Yarik   test
45
                           ], false); ?>
0dfdb6ef   Виталий   tokar commit
46
47
              </div>
              <div class="general-check-right">
5f78d6bf   Виталий   git
48
                  <div class="general-check-right-txt">
a2cb610b   Yarik   Commit
49
                      Обязательно должны быть указаны специализации услуг, а также добавлены проекты в портфолио, что бы вы попали в рейтинг исполнителей
8f5d4d0f   Yarik   test
50
51
52
                      <?php
                          if(!empty( $user->specializations )) {
                              echo "<p>В Вашем профиле указаны специализации: " . count($user->specializations) . "</p>";
a8dda9c4   Виталий   git
53
                          } else {
8f5d4d0f   Yarik   test
54
                              echo "<p>В Вашем профиле не указаны специализации. Чтобы указать - перейдите по " . Html::a('ссылке', [ 'accounts/service' ], [ 'target' => '_blank' ]) . "</p>";
a8dda9c4   Виталий   git
55
                          }
a2cb610b   Yarik   Commit
56
57
58
59
60
                          if(!empty( $user->portfolios )) {
                              echo "<p>В Вашем портфолио добавлено проектов: " . count($user->portfolios) . "</p>";
                          } else {
                              echo "<p>В Вашем портфолио не добавлены проекты. Чтобы добавить - перейдите по " . Html::a('ссылке', [ 'accounts/portfolio' ], [ 'target' => '_blank' ]) . "</p>";
                          }
8f5d4d0f   Yarik   test
61
                      ?>
a8dda9c4   Виталий   git
62
                  </div>
0dfdb6ef   Виталий   tokar commit
63
64
              </div>
          </div>
0dfdb6ef   Виталий   tokar commit
65
66
          <div class="general-check">
              <div class="general-check-left">
35b03e57   Administrator   add yii jquery
67
                  <?= $form->field($user_info, 'is_customer', [ 'template' => "{input}\n{label}\n{error}" ])
766bd93b   Yarik   test
68
69
                           ->label('<span></span>Я - заказчик')
                           ->checkbox([
229730f9   Yarik   test
70
                               'class' => 'custom-check admin-check',
766bd93b   Yarik   test
71
                           ], false); ?>
0dfdb6ef   Виталий   tokar commit
72
73
              </div>
              <div class="general-check-right">
5f78d6bf   Виталий   git
74
                  <div class="general-check-right-txt">
b9a54f61   Yarik   test
75
                      Обязательно должны быть созданы заказы Вами, что бы вы попали в рейтинг заказчиков
5f78d6bf   Виталий   git
76
                      <?php
8f5d4d0f   Yarik   test
77
78
79
80
81
                          if(!empty( $user->projects )) {
                              echo "<p>В Вашем профиле добавлены " . Yii::t('app', 'projects') . ": " . count($user->projects) . "</p>";
                          } else {
                              echo "<p>В Вашем профиле не добавлены " . Yii::t('app', 'projects') . ". Чтобы добавить - перейдите по " . Html::a('ссылке', [ 'accounts/projects' ], [ 'target' => '_blank' ]) . "</p>";
                          }
5f78d6bf   Виталий   git
82
83
84
                      ?>
                  </div>
              </div>
008e0a77   Yarik   test
85
          </div>
0dfdb6ef   Виталий   tokar commit
86
87
88
      </div>
      <div class="general-who style border-general">
          <div class="general-who-title gen-admin-title">Кто вы:</div>
f0f915df   Administrator   add Vitaliy's wid...
89
  
229730f9   Yarik   test
90
91
92
93
94
95
          <?= $form->field($user, 'type')
                   ->label(false)
                   ->radioList([
                       1 => 'Частное лицо',
                       2 => 'Компания',
                   ], [
8f5d4d0f   Yarik   test
96
97
98
99
100
101
102
103
104
105
                       'item' => function($index, $label, $name, $checked, $value) {
                           $return = '<div class="admin-who-check">';
                           $return .= '<input class="custom-radio" id="select_admin_' . $value . '" type="radio" name="' . $name . '" value="' . $value . '" ' . ( $checked ? "checked" : "" ) . ' >';
                           $return .= '<label for="select_admin_' . $value . '" >';
                           $return .= '<span></span>' . ucwords($label);
                           $return .= '</label>';
                           $return .= '</div>';
                           return $return;
                       },
                   ]); ?>
0dfdb6ef   Виталий   tokar commit
106
  
0dfdb6ef   Виталий   tokar commit
107
108
  
      </div>
3364fb6a   Виталий   tokar commit
109
110
111
112
      <div class="style border-general" style="margin-top: 11px">
          <div class="hidden-input-admin-general">
              <div class="input-blocks-wrapper">
                  <div class="input-blocks">
8f5d4d0f   Yarik   test
113
114
115
116
                      <?= $form->field($company_info, 'name', [
                          'options'                => [ 'class' => 'form-group company_info' ],
                          'enableClientValidation' => false,
                      ])
78ab7436   Yarik   test
117
                               ->textInput([ 'class' => 'custom-input-2 no-client-validation' ]); ?>
3364fb6a   Виталий   tokar commit
118
119
120
121
                  </div>
              </div>
              <div class="input-blocks-wrapper">
                  <div class="input-blocks">
229730f9   Yarik   test
122
123
124
125
126
                      <?= $form->field($company_info, 'staff', [ 'options' => [ 'class' => 'form-group company_info' ] ])
                               ->textInput([
                                   'class' => 'custom-input-2',
                                   'type'  => 'number',
                               ]); ?>
3364fb6a   Виталий   tokar commit
127
128
                  </div>
              </div>
fe41f4ed   Виталий   tokar commit
129
              <div class="conacts-admin style">Контакты представителя:</div>
b9769b49   Виталий   tokar commit
130
          </div>
0dfdb6ef   Виталий   tokar commit
131
  
3364fb6a   Виталий   tokar commit
132
133
          <div class="input-blocks-wrapper">
              <div class="input-blocks">
229730f9   Yarik   test
134
135
136
                  <?= $form->field($user, 'firstname')
                           ->label('Имя')
                           ->textInput([ 'class' => 'custom-input-2' ]); ?>
3364fb6a   Виталий   tokar commit
137
              </div>
0dfdb6ef   Виталий   tokar commit
138
          </div>
0dfdb6ef   Виталий   tokar commit
139
  
3364fb6a   Виталий   tokar commit
140
141
          <div class="input-blocks-wrapper">
              <div class="input-blocks">
229730f9   Yarik   test
142
143
144
                  <?= $form->field($user, 'lastname')
                           ->label('Фамилия')
                           ->textInput([ 'class' => 'custom-input-2' ]); ?>
3364fb6a   Виталий   tokar commit
145
              </div>
b9769b49   Виталий   tokar commit
146
          </div>
3364fb6a   Виталий   tokar commit
147
148
          <div class="input-blocks-wrapper">
              <div class="input-blocks">
229730f9   Yarik   test
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
                  <?= $form->field($user_info, 'country')
                           ->widget(Select2::classname(), [
                               'options'       => [ 'placeholder' => 'Выбор страны ...', ],
                               'pluginOptions' => [
                                   'allowClear'         => true,
                                   'minimumInputLength' => 3,
                                   'ajax'               => [
                                       'url'      => \yii\helpers\Url::to([ 'site/country' ]),
                                       'dataType' => 'json',
                                       'data'     => new JsExpression('function(params) { return {q:params.term}; }'),
                                   ],
                                   'escapeMarkup'       => new JsExpression('function (markup) { return markup; }'),
                                   'templateResult'     => new JsExpression('function(country) { return country.text; }'),
                                   'templateSelection'  => new JsExpression('function (country) { return country.text; }'),
                               ],
                           ]); ?>
3364fb6a   Виталий   tokar commit
165
              </div>
b9769b49   Виталий   tokar commit
166
          </div>
3364fb6a   Виталий   tokar commit
167
168
          <div class="input-blocks-wrapper">
              <div class="input-blocks">
229730f9   Yarik   test
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
                  <?= $form->field($user_info, 'city')
                           ->widget(Select2::classname(), [
                               'options'       => [ 'placeholder' => 'Выбор города ...' ],
                               '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; }'),
                               ],
                           ]); ?>
6a82a223   Виталий   tokar commit
185
  
3364fb6a   Виталий   tokar commit
186
187
188
              </div>
  
              <div class="input-blocks street-input">
229730f9   Yarik   test
189
190
                  <?= $form->field($company_info, 'street', [ 'options' => [ 'class' => 'form-group company_info' ] ])
                           ->textInput([ 'class' => 'custom-input-2' ]); ?>
3364fb6a   Виталий   tokar commit
191
192
193
              </div>
  
              <div class="input-blocks home-input">
229730f9   Yarik   test
194
195
                  <?= $form->field($company_info, 'house', [ 'options' => [ 'class' => 'form-group company_info' ] ])
                           ->textInput([ 'class' => 'custom-input-2' ]); ?>
3364fb6a   Виталий   tokar commit
196
              </div>
6a82a223   Виталий   tokar commit
197
          </div>
3364fb6a   Виталий   tokar commit
198
199
200
  
          <div class="input-blocks-wrapper ">
              <div class="input-blocks">
229730f9   Yarik   test
201
202
203
204
205
                  <?= $form->field($user_info, 'email')
                           ->textInput([
                               'class' => 'custom-input-2',
                               'value' => empty( $user_info->email ) ? $user->email : $user_info->email,
                           ]); ?>
3364fb6a   Виталий   tokar commit
206
207
              </div>
              <div class="input-blocks hide-mail-check">
229730f9   Yarik   test
208
209
210
211
212
213
214
215
216
                  <?= $form->field($user_info, 'hide_mail', [
                      'options'  => [ 'class' => 'form-group', ],
                      'template' => "{input}{label}\n{hint}\n{error}",
                  ])
                           ->label('<span></span>не публиковать Email')
                           ->checkbox([
                               'checked' => 'checked',
                               'class'   => 'custom-check',
                           ], false); ?>
3364fb6a   Виталий   tokar commit
217
              </div>
b9769b49   Виталий   tokar commit
218
219
          </div>
      </div>
fe41f4ed   Виталий   tokar commit
220
      <div class="input-blocks-wrapper border-general fix-marg">
3364fb6a   Виталий   tokar commit
221
          <div class="input-blocks weight-normal">
229730f9   Yarik   test
222
223
224
225
226
227
228
              <div class="gen-admin-title">Статус:</div>
              <?= $form->field($user_info, 'busy')
                       ->label(false)
                       ->radioList([
                           0 => 'Свободен',
                           1 => 'Занят',
                       ], [
8f5d4d0f   Yarik   test
229
230
231
232
233
234
235
236
237
238
                           'item' => function($index, $label, $name, $checked, $value) {
                               $return = '<div class="admin-who-check">';
                               $return .= '<input class="custom-radio" id="select_admin_status' . $value . '" type="radio" name="' . $name . '" value="' . $value . '" ' . ( $checked ? "checked" : "" ) . ' >';
                               $return .= '<label for="select_admin_status' . $value . '" >';
                               $return .= '<span></span>' . ucwords($label);
                               $return .= '</label>';
                               $return .= '</div>';
                               return $return;
                           },
                       ]); ?>
6a82a223   Виталий   tokar commit
239
240
241
242
          </div>
      </div>
  
  
f43a2a59   Виталий   git
243
      <div class="style border-general general_avatar-wr">
3364fb6a   Виталий   tokar commit
244
245
          <div class="input-blocks-wrapper admin-avatar">
              <div class="gen-admin-title">Аватар</div>
229730f9   Yarik   test
246
247
248
249
              <div class="file-help-1">
                  <div>Формат: PNG, JPG, GIF<br/>Размер: 180x180 px<br/>Файлы большего размера и других пропорций будут конвертироваться
                  </div>
              </div>
3364fb6a   Виталий   tokar commit
250
              <?= ImageUploader::widget([
229730f9   Yarik   test
251
252
253
                  'model'   => $user_info,
                  'field'   => 'image',
                  'size'    => [
eb7e82fb   Administrator   29.02.16
254
                      [
229730f9   Yarik   test
255
256
                          'width'  => 48,
                          'height' => 48,
eb7e82fb   Administrator   29.02.16
257
258
                      ],
                      [
229730f9   Yarik   test
259
260
                          'width'  => 180,
                          'height' => 180,
eb7e82fb   Administrator   29.02.16
261
262
263
                      ],
  
                  ],
cefc2aa6   Yarik   test
264
                  'remover' => true,
229730f9   Yarik   test
265
266
267
268
                  'multi'   => false,
                  'gallery' => $user_info->image,
                  'name'    => 'Выбрать файл',
              ]); ?>
3364fb6a   Виталий   tokar commit
269
          </div>
6a82a223   Виталий   tokar commit
270
  
3364fb6a   Виталий   tokar commit
271
272
          <div class="input-blocks-wrapper admin-avatar admin-pattern">
              <div class="gen-admin-title">Подложка</div>
229730f9   Yarik   test
273
274
275
276
277
278
279
              <?= ImageUploader::widget([
                  'model'   => $user_info,
                  'field'   => 'poster',
                  'size'    => [
                      [
                          'width'  => 1920,
                          'height' => 380,
eb7e82fb   Administrator   29.02.16
280
                      ],
229730f9   Yarik   test
281
                  ],
c20d5820   Yarik   test
282
                  'remover' => true,
229730f9   Yarik   test
283
284
285
286
                  'multi'   => false,
                  'gallery' => $user_info->poster,
                  'name'    => 'Выбрать файл',
              ]); ?>
3364fb6a   Виталий   tokar commit
287
          </div>
6a82a223   Виталий   tokar commit
288
  
3364fb6a   Виталий   tokar commit
289
      </div>
6a82a223   Виталий   tokar commit
290
291
  
  
fe41f4ed   Виталий   tokar commit
292
      <div class="input-blocks-wrapper fix-marg">
3364fb6a   Виталий   tokar commit
293
294
295
          <div class="input-blocks weight-normal">
              <div class="gen-admin-title">Членство в МФП</div>
              <div class="admin-fix-mfp">
229730f9   Yarik   test
296
297
298
299
300
301
                  <?= $form->field($user_info, 'member')
                           ->label(false)
                           ->radioList([
                               0 => 'Не хочу',
                               1 => 'Хочу стать',
                           ], [
8f5d4d0f   Yarik   test
302
303
304
305
306
307
308
309
310
311
                               'item' => function($index, $label, $name, $checked, $value) {
                                   $return = '<div class="admin-who-check">';
                                   $return .= '<input class="custom-radio" id="select_admin_mfp' . $value . '" type="radio" name="' . $name . '" value="' . $value . '" ' . ( $checked ? "checked" : "" ) . ' >';
                                   $return .= '<label for="select_admin_mfp' . $value . '" >';
                                   $return .= '<span></span>' . ucwords($label);
                                   $return .= '</label>';
                                   $return .= '</div>';
                                   return $return;
                               },
                           ]); ?>
3364fb6a   Виталий   tokar commit
312
313
314
              </div>
              <div class="admin-mfp-help">Выберите если хотите стать членом МФП и наш менеджер свяжется с Вами.</div>
          </div>
6a82a223   Виталий   tokar commit
315
  
3364fb6a   Виталий   tokar commit
316
      </div>
6a82a223   Виталий   tokar commit
317
318
  
  
b9769b49   Виталий   tokar commit
319
      <div class="input-blocks-wrapper">
3364fb6a   Виталий   tokar commit
320
          <div class="admin-save-btn style">
229730f9   Yarik   test
321
322
              <?= Html::submitButton('Сохранить', [ 'class' => 'input-blocks-wrapper button' ]);
                  $form->end(); ?>
b9769b49   Виталий   tokar commit
323
324
          </div>
      </div>
51e0a262   Yarik   test
325
  </div>