Blame view

frontend/views/accounts/_vacancy_form.php 7.24 KB
ea09d15d   Yarik   test
1
2
3
4
  <?php
      /**
       * @var Vacancy $vacancy
       * @var Employment[] $employment
1b56164e   Yarik   test
5
6
       * @var string[] $currencies
       * @var Specialization[] $specializations
ea09d15d   Yarik   test
7
8
       */
      use common\models\Employment;
1b56164e   Yarik   test
9
      use common\models\Specialization;
ea09d15d   Yarik   test
10
11
      use common\models\Vacancy;
      use common\widgets\FieldEditor;
e8236f44   Yarik   test
12
      use kartik\select2\Select2;
ea09d15d   Yarik   test
13
14
      use mihaildev\ckeditor\CKEditor;
      use yii\helpers\Html;
e8236f44   Yarik   test
15
      use yii\web\JsExpression;
ea09d15d   Yarik   test
16
17
      use yii\widgets\ActiveForm;
  
8e5fa1e8   Виталий   tokar commit
18
      $this->title = 'Вакансии';
ea09d15d   Yarik   test
19
20
      $this->params[ 'breadcrumbs' ][] = $this->title;
  ?>
8e5fa1e8   Виталий   tokar commit
21
  <div class="login-left-column-title"><?= $this->title ?></div>
58806a3d   Виталий   tokar commit
22
  <div class="login-left-column-title-two style">Редактирование:</div>
ea09d15d   Yarik   test
23
24
25
26
  <?php
      $form = ActiveForm::begin();
  ?>
  
58806a3d   Виталий   tokar commit
27
28
29
30
31
32
33
  <div class="input-blocks-wrapper">
      <div class="input-blocks">
          <?= $form->field($vacancy, 'name')
              ->textInput (['class'=> 'custom-input-2']); ?>
      </div>
  </div>
  
58806a3d   Виталий   tokar commit
34
35
36
37
38
39
40
41
42
43
44
45
46
47
  <div class="input-blocks-wrapper">
      <div class="input-blocks">
          <?= $form->field($vacancy, 'link')
              ->textInput (['class'=> 'custom-input-2']); ?>
      </div>
  </div>
  
  <div class="input-blocks-wrapper">
      <div class="input-blocks">
          <?= $form->field($vacancy, 'user_name')
              ->textInput (['class'=> 'custom-input-2']); ?>
          <span class="admin-hint-vacancy-contact">Вы</span>
      </div>
  </div>
ea09d15d   Yarik   test
48
  
58806a3d   Виталий   tokar commit
49
50
  <div class="input-blocks-wrapper">
      <div class="input-blocks">
1b56164e   Yarik   test
51
52
          <?= $form->field($vacancy, 'phone')
                   ->textInput (['class'=> 'custom-input-2']); ?>
58806a3d   Виталий   tokar commit
53
54
55
          <span class="admin-hint-vacancy-contact">Ваш</span>
      </div>
  </div>
ea09d15d   Yarik   test
56
  
e8236f44   Yarik   test
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
  <div class="input-blocks-wrapper">
      <div class="input-blocks">
          <?=
              $form->field($vacancy, '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; }'),
                  ],
              ]);
          ?>
58806a3d   Виталий   tokar commit
76
77
78
          <span class="admin-hint-vacancy-contact">Ваш</span>
      </div>
  </div>
e8236f44   Yarik   test
79
  
1b56164e   Yarik   test
80
81
82
83
84
85
86
87
88
89
90
91
92
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
  <div class="input-blocks-wrapper">
      <div class="input-blocks">
          <?= $form->field($vacancy, 'salary')
                   ->textInput (['class'=> 'custom-input-2']); ?>
          <?= $form->field($vacancy, 'salary_currency')
                   ->label(false)->dropDownList($currencies); ?>
      </div>
  </div>
  
  <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): ?>
  
                          <?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($vacancy, "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; ?>
  
                  </ul>
              </li>
          <?php endforeach; ?>
      </ul>
  </div>
  
58806a3d   Виталий   tokar commit
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
  <div class="input-blocks-wrapper admin-vacancy-check" style="margin-top: 29px">
      <div class="input-blocks">
          <?= $form->field($vacancy, 'employmentInput')
              ->checkboxList($employment,
                  [
                      'item' => function($index, $label, $name, $checked, $value) {
                          $return = '<div class="admin-who-check-payment">';
                          $return .= '<input class="custom-check" id="select_admin_payment'.$value.'" type="checkbox" name="' . $name . '" value="' . $value . '" '.($checked ? "checked" :"").' >';
                          $return .= '<label for="select_admin_payment'.$value.'" >';
                          $return .= '<span></span>' . ucwords($label);
                          $return .= '</label>';
                          $return .= '</div>';
                          return $return;
                      }
                  ]
              ) ?>
e8236f44   Yarik   test
142
143
      </div>
  </div>
ea09d15d   Yarik   test
144
  
58806a3d   Виталий   tokar commit
145
146
147
148
149
150
151
152
153
154
155
  <div class="skills-admin-wrapper style">
      <div class="input-blocks-wrapper skills-programs">
          <div class="input-blocks">
              <?= FieldEditor::widget (
                  [
                      'template' => 'requirements', 'item_id' => $vacancy->vacancy_id, 'model' => 'common\models\Vacancy', 'language' => 'ru',
                  ]
              ); ?>
          </div>
      </div>
  </div>
ea09d15d   Yarik   test
156
  
8e5fa1e8   Виталий   tokar commit
157
158
159
160
161
  <div class="input-blocks-wrapper full-blocks admin-editor-bl">
      <div class="input-blocks">
          <?= $form->field($vacancy, 'description')->widget(CKEditor::className()) ?>
      </div>
  </div>
ea09d15d   Yarik   test
162
  
8e5fa1e8   Виталий   tokar commit
163
  <div class="admin-save-btn skills-save-btn  style">
3a1bbfcc   Yarik   test
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
      <?= Html::submitButton($vacancy->isNewRecord?'Добавить':'Обновить', [ 'class' => 'input-blocks-wrapper button' ]) ?>
      <?php
          if(!$vacancy->isNewRecord) {
              echo Html::a('Удалить', [
                  'accounts/vacancy-delete',
                  'id' => $vacancy->vacancy_id,
              ], [
                  'title'        => 'Удалить',
                  'aria-label'   => 'Удалить',
                  'data-confirm' => 'Вы уверены, что хотите удалить этот элемент?',
                  'data-method'  => 'post',
                  'data-pjax'    => 0,
              ]);
          }
      ?>
      <?= Html::a('Отменить', [ 'accounts/vacancy' ]) ?>
8e5fa1e8   Виталий   tokar commit
180
  </div>
ea09d15d   Yarik   test
181
  
ea09d15d   Yarik   test
182
183
184
185
  
  <?php
      $form->end();
  ?>