Blame view

frontend/views/accounts/_projects_form.php 11.7 KB
aa182b5c   Yarik   test
1
2
  <?php
      /**
b16ed95f   Yarik   test
3
       * @var Project          $project
aa182b5c   Yarik   test
4
       * @var Specialization[] $specialization
b16ed95f   Yarik   test
5
6
       * @var Payment[]        $payment
       * @var string[]         $projects
aa182b5c   Yarik   test
7
       */
9cc08528   Yarik   test
8
      use common\models\Currency;
aa182b5c   Yarik   test
9
10
11
12
      use common\models\Payment;
      use common\models\Project;
      use common\models\Specialization;
      use common\widgets\ImageUploader;
b16ed95f   Yarik   test
13
      use kartik\select2\Select2;
aa182b5c   Yarik   test
14
15
      use mihaildev\ckeditor\CKEditor;
      use yii\helpers\Html;
b16ed95f   Yarik   test
16
      use yii\web\JsExpression;
aa182b5c   Yarik   test
17
18
      use yii\widgets\ActiveForm;
  
37cb2820   Виталий   tokar commit
19
      $this->title = 'Проекты';
aa182b5c   Yarik   test
20
21
      $this->params[ 'breadcrumbs' ][] = $this->title;
  ?>
37cb2820   Виталий   tokar commit
22
  <div class="login-left-column-title"><?= $this->title ?></div>
aa182b5c   Yarik   test
23
24
25
26
27
  
  <?php
      $form = ActiveForm::begin();
  ?>
  
aa182b5c   Yarik   test
28
  
37cb2820   Виталий   tokar commit
29
30
31
32
33
34
  <div class="input-blocks-wrapper">
      <div class="input-blocks">
          <?= $form->field($project, 'name')
              ->textInput (['class'=> 'custom-input-2']) ?>
      </div>
  </div>
aa182b5c   Yarik   test
35
  
37cb2820   Виталий   tokar commit
36
37
38
39
40
41
  <div class="input-blocks-wrapper">
      <div class="input-blocks">
          <?= $form->field($project, 'link')
              ->textInput (['class'=> 'custom-input-2']) ?>
      </div>
  </div>
aa182b5c   Yarik   test
42
  
d36bdac6   Administrator   17.02.16
43
  <div class="input-blocks-wrapper">
93e3bd31   Виталий   tokar commit
44
      <div class="input-blocks admin-project-list admin-currency-second">
37cb2820   Виталий   tokar commit
45
46
47
48
          <?= $form->field($project, 'project_pid')
              ->dropDownList($projects, [ 'prompt' => 'Родительский проект' ]) ?>
      </div>
  </div>
82c2fa67   Виталий   tokar commit
49
  <div class="input-blocks-wrapper admin-menu-list">
d36bdac6   Administrator   17.02.16
50
51
52
53
54
55
56
57
58
59
60
61
62
      <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):?>
  
                          <?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): ?>
5fd01fb4   Administrator   17.02.16
63
                                              <li>
82c2fa67   Виталий   tokar commit
64
65
66
67
68
69
70
71
72
73
74
                                                  <a href="#" title="<?= $child_second->specialization_name ?>">
                                                      <?= $form->field($project, "specializationInput[{$child_second->specialization_id}]", [
                                                          'template'     => '{input}{label}{hint}{error}',
                                                      ])
                                                          ->label('<span></span>' . $child_second->specialization_name)
                                                          ->checkbox([
                                                              'value'   => $child_second->specialization_id,
                                                              'label'   => NULL,
                                                              'uncheck' => NULL,
                                                              'class' => 'custom-check',
                                                          ], false) ?>
5fd01fb4   Administrator   17.02.16
75
76
                                                  </a>
                                              </li>
d36bdac6   Administrator   17.02.16
77
78
79
80
81
82
83
84
85
86
87
88
                                          <?php endif;?>
                                      <?php endforeach; ?>
                                  </ul>
                              </li>
                          <?php endif; ?>
                      <?php endforeach; ?>
  
                  </ul>
              </li>
          <?php endforeach; ?>
      </ul>
  </div>
aa182b5c   Yarik   test
89
  
37cb2820   Виталий   tokar commit
90
91
  
  <div class="conacts-admin style">Адрес проекта:</div>
aa182b5c   Yarik   test
92
  <div class="form-inline">
37cb2820   Виталий   tokar commit
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
      <div class="input-blocks-wrapper">
          <div class="input-blocks">
              <?= $form->field($project, '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; }'),
                      ],
                  ]);
              ?>
          </div>
  
  
  
  
  
          <div class="input-blocks street-input">
              <?= $form->field($project, 'street', [ 'template' => "{label}{input}{hint}{error}" ])
                  ->textInput (['class'=> 'custom-input-2']) ?>
          </div>
  
  
  
          <div class="input-blocks home-input">
              <?= $form->field($project, 'house', [ 'template' => "{label}{input}{hint}{error}" ])
                  ->textInput (['class'=> 'custom-input-2']) ?>
          </div>
      </div>
aa182b5c   Yarik   test
130
131
  </div>
  
37cb2820   Виталий   tokar commit
132
  <div class="input-blocks-wrapper">
93e3bd31   Виталий   tokar commit
133
134
135
136
137
      <div class="input-blocks admin-project-list-two admin-currency-first">
          <?= $form->field($project, 'budget', [
              'template' => "{label}<br />{input}\n{hint}\n{error}"
          ])
              ->textInput (['class'=> 'custom-input-2 custom-input-2-date','type'=>'number']) ?>
37cb2820   Виталий   tokar commit
138
      </div>
93e3bd31   Виталий   tokar commit
139
      <div class="input-blocks admin-project-list-two admin-currency-second">
9cc08528   Yarik   test
140
141
142
          <?=
              $form->field($project, 'budget_currency')->label(false)->dropDownList(Currency::getCurrencyDropdown(), ['class'=> 'custom-input-2']);
          ?>
37cb2820   Виталий   tokar commit
143
      </div>
93e3bd31   Виталий   tokar commit
144
145
146
147
148
      <div class="input-blocks admin-who-check-payment admin-project-contractual">
          <?= $form->field($project, 'contractual', ['template' => "{input}{label}\n{hint}\n{error}"])
              ->checkbox (['class'=> 'custom-check'], false)
              ->label ('<span></span>Договорной')
          ?>
37cb2820   Виталий   tokar commit
149
150
151
      </div>
  
  </div>
aa182b5c   Yarik   test
152
  
93e3bd31   Виталий   tokar commit
153
  <div class="input-blocks-wrapper">
5aefd508   Виталий   tokar commit
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
      <div class="input-blocks">
          <?= $form->field($project, 'payment_variant')
              ->radioList([
                  1 => 'Без предоплаты',
                  2 => 'Предоплата возможна',
              ],[
                  '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;
                  }
              ]) ?>
      </div>
93e3bd31   Виталий   tokar commit
171
172
  </div>
  
5aefd508   Виталий   tokar commit
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
  <div class="input-blocks-wrapper">
      <div class="input-blocks">
          <?= $form->field($project, 'paymentInput')
              ->checkboxList($payment,[
                  'item' => function($index, $label, $name, $checked, $value) {
                      $return = '<div class="admin-who-check-payment">';
                      $return .= '<input class="custom-check" id="check_admin_mfp'.$value.'" type="checkbox" name="' . $name . '" value="' . $value . '" '.($checked ? "checked" :"").' >';
                      $return .= '<label for="check_admin_mfp'.$value.'" >';
                      $return .= '<span></span>' . ucwords($label);
                      $return .= '</label>';
                      $return .= '</div>';
                      return $return;
                  }
              ]) ?>
      </div>
  </div>
aa182b5c   Yarik   test
189
  
aa182b5c   Yarik   test
190
  
37cb2820   Виталий   tokar commit
191
  <div class="input-blocks-wrapper">
5aefd508   Виталий   tokar commit
192
193
194
195
196
197
198
      <div class="input-blocks admin-project-days">
          <?= $form->field($project, 'deadline', [ 'template' => "{label}<br />{input}<span class='admn-input-txt' style='padding-left: 10px'>дней</span>\n{hint}\n{error}" ])
              ->textInput (['class'=> 'custom-input-2 custom-input-2-date','type'=>'number']) ?>
      </div>
  </div>
  
  <div class="input-blocks-wrapper full-blocks admin-editor-bl">
37cb2820   Виталий   tokar commit
199
      <div class="input-blocks">
5aefd508   Виталий   tokar commit
200
201
          <?= $form->field($project, 'description')
                   ->widget(CKEditor::className()) ?>
37cb2820   Виталий   tokar commit
202
203
      </div>
  </div>
aa182b5c   Yarik   test
204
  
5aefd508   Виталий   tokar commit
205
206
207
208
209
210
211
212
213
  <div class="input-blocks-wrapper admin-project-file">
      <div class="input-blocks">
          <div style="position: absolute; float: left;top: 0; left: 0; z-index: 1; width: 100%; overflow: hidden">
              <div class="gen-admin-title">Присоединить файл</div>
              <div class="admin-project-file-btn">Загрузить</div>
              <div class="not-file-mb-adm">До 3 Мб файл</div>
          </div>
          <div style="opacity: 0; height: 54px; width: 100%; float: left;position: absolute; top: 0;left: 0; z-index: 2;-ms-filter: 'progid:DXImageTransform.Microsoft.Alpha(Opacity=50)'">
          <?= $form->field($project, 'file')
aa182b5c   Yarik   test
214
  
5aefd508   Виталий   tokar commit
215
216
              ->fileInput([ 'multiple' => 'multiple' ]) ?>
          </div>
aa182b5c   Yarik   test
217
  
5aefd508   Виталий   tokar commit
218
219
      </div>
  </div>
aa182b5c   Yarik   test
220
  
5aefd508   Виталий   tokar commit
221
222
223
224
225
226
227
228
229
230
  <div class="input-blocks-wrapper">
      <div class="input-blocks admin-project-list admin-currency-second">
          <?= $form->field($project, 'date_end')
              ->dropDownList([
                  1 => 'Неделя',
                  2 => '2 неделю',
                  3 => 'Месяц',
              ]) ?>
      </div>
  </div>
aa182b5c   Yarik   test
231
  
3a1bbfcc   Yarik   test
232
  <div class="input-blocks-wrapper">
04b478b9   Виталий   tokar commit
233
      <div class="admin-save-btn skills-save-btn admin-add-remove-wr style">
3a1bbfcc   Yarik   test
234
          <?= Html::submitButton($project->isNewRecord?'Добавить':'Обновить', [ 'class' => 'input-blocks-wrapper button' ]) ?>
04b478b9   Виталий   tokar commit
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
          <div class="admin-remove-note">
              <?php
                  if(!$project->isNewRecord) {
                      echo Html::a('Удалить', [
                          'accounts/projects-delete',
                          'id' => $project->project_id,
                      ], [
                          'title'        => 'Удалить',
                          'aria-label'   => 'Удалить',
                          'data-confirm' => 'Вы уверены, что хотите удалить этот элемент?',
                          'data-method'  => 'post',
                          'data-pjax'    => 0,
                      ]);
                  }
              ?>
          </div>
          <div class="admin-back-note">
1c67655e   Yarik   test
252
              <?= Html::a('вернуться', Request::getIsLocal(\Yii::$app->request->referrer)?\Yii::$app->request->referrer:['accounts/projects' ]) ?>
04b478b9   Виталий   tokar commit
253
          </div>
3a1bbfcc   Yarik   test
254
255
      </div>
  </div>
aa182b5c   Yarik   test
256
257
258
259
  
  <?php
      $form->end();
  ?>
93e3bd31   Виталий   tokar commit
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
  <script>
      $(document).ready(function(){
          $('.input-blocks.admin-currency-second select').change(function(){
              $(this).blur()
          })
  
          if($('.admin-project-contractual input[type="checkbox"]').prop("checked")) {
              $('.admin-project-list-two input, .admin-project-list-two select').attr('disabled', 'disabled')
          }
          $('.admin-project-contractual input[type="checkbox"]').change(function(){
             if($(this).prop("checked")) {
                 $('.admin-project-list-two input, .admin-project-list-two select').attr('disabled','disabled')
             } else {
                 $('.admin-project-list-two input, .admin-project-list-two select').removeAttr('disabled')
             }
          })
5aefd508   Виталий   tokar commit
276
277
278
279
280
281
282
283
284
  
  
          $('.admin-project-file input[type="file"]').change(function(){
              var strInput = this.value
          $('.admin-project-file .not-file-mb-adm').html(strInput.replace(/^.*\\/, ""))
  
          });
  
  
93e3bd31   Виталий   tokar commit
285
      })
5aefd508   Виталий   tokar commit
286
  </script>