Commit bdf3e3610202edf7420b7e0e2871d09280c92684
1 parent
a3a1f00a
tokar commit
Showing
3 changed files
with
132 additions
and
65 deletions
Show diff stats
frontend/views/accounts/_job_form.php
... | ... | @@ -11,34 +11,65 @@ $model = new Job(['user_id' => \Yii::$app->user->getId (), 'current' => 0]); |
11 | 11 | $form = ActiveForm::begin (); |
12 | 12 | ?> |
13 | 13 | <div class='ajax-loaded'><div class='prev_job_inputs'> |
14 | - <?= $form->field ($model, '[' . $index . ']name') | |
15 | - ->label ('Название') | |
16 | - ->textInput (); | |
17 | - ?> | |
18 | - <?= $form->field ($model, '[' . $index . ']link') | |
19 | - ->label ('Ссылка на компанию на сайте МФП') | |
20 | - ->textInput (); | |
21 | - ?> | |
22 | - <?= $form->field ($model, '[' . $index . ']date_start') | |
23 | - ->label ('Дата начала работы') | |
24 | - ->widget (DatePicker::className (), ['language' => 'ru', 'dateFormat' => 'dd-MM-yyyy']); | |
25 | - ?> | |
26 | - <?= $form->field ($model, '[' . $index . ']date_end') | |
27 | - ->label ('Дата окончания работы') | |
28 | - ->widget (DatePicker::className (), ['language' => 'ru', 'dateFormat' => 'dd-MM-yyyy']); | |
29 | - ?> | |
30 | - <?= $form->field ($model, '[' . $index . ']position') | |
31 | - ->label ('Должность') | |
32 | - ->textInput (); | |
33 | - ?> | |
34 | - <?= $form->field ($model, '[' . $index . ']total_count') | |
35 | - ->label ('Количество проектов, в которых принимали участие') | |
36 | - ->input ('number'); | |
37 | - ?> | |
38 | - <?= $form->field ($model, '[' . $index . ']complete_count') | |
39 | - ->label ('из них реализовано') | |
40 | - ->input ('number'); | |
41 | - ?> | |
14 | + <div class="input-blocks-wrapper"> | |
15 | + <div class="input-blocks"> | |
16 | + <?= $form->field ($model, '[' . $index . ']name') | |
17 | + ->label ('Название') | |
18 | + ->textInput (['class'=> 'custom-input-2']); | |
19 | + ?> | |
20 | + </div> | |
21 | + </div> | |
22 | + <div class="input-blocks-wrapper"> | |
23 | + <div class="input-blocks"> | |
24 | + <?= $form->field ($model, '[' . $index . ']link') | |
25 | + ->label ('Ссылка на компанию на сайте МФП') | |
26 | + ->textInput (['class'=> 'custom-input-2']); | |
27 | + ?> | |
28 | + </div> | |
29 | + </div> | |
30 | + <div class="input-blocks-wrapper"> | |
31 | + <div class="input-blocks"> | |
32 | + <?= $form->field ($model, '[' . $index . ']date_start') | |
33 | + ->label ('Дата начала работы') | |
34 | + ->widget (DatePicker::className (), ['options' => ['class' => 'custom-input-2'], 'language' => 'ru', 'dateFormat' => 'dd-MM-yyyy', 'clientOptions' => ['changeYear' => true, 'yearRange' => 'c-20:c', 'changeMonth' => true]]); | |
35 | + ?> | |
36 | + </div> | |
37 | + </div> | |
38 | + | |
39 | + <div class="input-blocks-wrapper"> | |
40 | + <div class="input-blocks"> | |
41 | + <?= $form->field ($model, '[' . $index . ']date_end') | |
42 | + ->label ('Дата окончания работы') | |
43 | + ->widget (DatePicker::className (), ['options' => ['class' => 'custom-input-2'], 'language' => 'ru', 'dateFormat' => 'dd-MM-yyyy', 'clientOptions' => ['changeYear' => true, 'yearRange' => 'c-20:c', 'changeMonth' => true]]); | |
44 | + ?> | |
45 | + </div> | |
46 | + </div> | |
47 | + | |
48 | + <div class="input-blocks-wrapper"> | |
49 | + <div class="input-blocks"> | |
50 | + <?= $form->field ($model, '[' . $index . ']position') | |
51 | + ->label ('Должность') | |
52 | + ->textInput (['class'=> 'custom-input-2']); | |
53 | + ?> | |
54 | + </div> | |
55 | + </div> | |
56 | + | |
57 | + <div class="input-blocks-wrapper admin-quantity-project"> | |
58 | + <div class="input-blocks"> | |
59 | + <?= $form->field ($model, '[' . $index . ']total_count') | |
60 | + ->label ('Количество проектов, в которых принимали участие') | |
61 | + ->textInput (['class'=> 'custom-input-2 custom-input-2-date','type'=>'number']); | |
62 | + ?> | |
63 | + | |
64 | + <div class="fix-quantity-project"> | |
65 | + <?= $form->field ($model, '[' . $index . ']complete_count') | |
66 | + ->label ('из них реализовано') | |
67 | + ->textInput (['class'=> 'custom-input-2 custom-input-2-date','type'=>'number']); | |
68 | + ?> | |
69 | + </div> | |
70 | + </div> | |
71 | + </div> | |
72 | + | |
42 | 73 | <?= Html::button('', ['class' => 'remove_job_button']);?> |
43 | 74 | </div></div> |
44 | 75 | <?php $form->end (); ?> | ... | ... |
frontend/views/accounts/employment.php
... | ... | @@ -15,9 +15,9 @@ $this->params['breadcrumbs'][] = $this->title; |
15 | 15 | $form = ActiveForm::begin (); |
16 | 16 | $current = array_shift ($job); |
17 | 17 | ?> |
18 | -<div class="current_job_container"> | |
18 | +<div class="current_job_container style"> | |
19 | 19 | <div class="login-left-column-title-two style">Текущее место работы:</div> |
20 | - <div class="current_job_inputs"> | |
20 | + <div class="current_job_inputs first_current_job_inputs border-general style"> | |
21 | 21 | <div class="input-blocks-wrapper"> |
22 | 22 | <div class="input-blocks"> |
23 | 23 | <?= $form->field ($current, '[0]name') |
... | ... | @@ -49,47 +49,57 @@ $current = array_shift ($job); |
49 | 49 | <div class="input-blocks"> |
50 | 50 | <?= $form->field ($current, '[0]date_start', ['options' => ['class' => 'test2class']]) |
51 | 51 | ->label ('Дата начала работы') |
52 | - ->widget (DatePicker::className (), ['options' => ['class' => 'testclass'], 'language' => 'ru', 'dateFormat' => 'dd-MM-yyyy', 'clientOptions' => ['changeYear' => true, 'yearRange' => 'c-20:c', 'changeMonth' => true]]); | |
52 | + ->widget (DatePicker::className (), ['options' => ['class' => 'custom-input-2'], 'language' => 'ru', 'dateFormat' => 'dd-MM-yyyy', 'clientOptions' => ['changeYear' => true, 'yearRange' => 'c-20:c', 'changeMonth' => true]]); | |
53 | 53 | ?> |
54 | 54 | </div> |
55 | 55 | </div> |
56 | 56 | |
57 | - <div class="input-blocks-wrapper"> | |
57 | + <div class="input-blocks-wrapper admin-quantity-project"> | |
58 | 58 | <div class="input-blocks"> |
59 | 59 | <?= $form->field ($current, '[0]total_count') |
60 | 60 | ->label ('Количество проектов, в которых принимали участие') |
61 | - ->textInput (['class'=> 'custom-input-2','type'=>'number']); | |
61 | + ->textInput (['class'=> 'custom-input-2 custom-input-2-date','type'=>'number']); | |
62 | 62 | ?> |
63 | + <div class="fix-quantity-project"> | |
64 | + <?= $form->field ($current, '[0]complete_count') | |
65 | + ->label ('из них реализовано') | |
66 | + ->textInput (['class'=> 'custom-input-2 custom-input-2-date','type'=>'number']); | |
67 | + ?> | |
68 | + </div> | |
63 | 69 | </div> |
70 | + | |
71 | + | |
72 | + | |
64 | 73 | </div> |
65 | 74 | |
75 | + </div> | |
76 | + <div class="current_job_inputs border-general style"> | |
66 | 77 | <div class="input-blocks-wrapper"> |
67 | 78 | <div class="input-blocks"> |
68 | - <?= $form->field ($current, '[0]complete_count') | |
69 | - ->label ('из них реализовано') | |
70 | - ->textInput (['class'=> 'custom-input-2','type'=>'number']); | |
79 | + <?= $form->field ($current, '[0]date_start') | |
80 | + ->label ('Когда начали заниматься проектированием') | |
81 | + ->textInput (['class'=> 'custom-input-2']); | |
71 | 82 | ?> |
72 | 83 | </div> |
73 | 84 | </div> |
74 | - | |
75 | 85 | </div> |
76 | 86 | </div> |
77 | -<div class="prev_job_container"> | |
78 | - <p>Предыдущие места работы</p> | |
87 | +<div class="prev_job_container style"> | |
88 | + <div class="login-left-column-title-two previous-employment-wr style">Предыдущие места работы</div> | |
79 | 89 | <?php |
80 | 90 | foreach ($job as $index => $job_model) |
81 | 91 | { |
82 | 92 | ?> |
83 | 93 | |
84 | 94 | <div class='prev_job_inputs'> |
85 | - <div class="input-blocks-wrapper"> | |
86 | - <div class="input-blocks"> | |
87 | - <?= $form->field ($job_model, '['. ($index + 1) .']name') | |
88 | - ->label ('Название') | |
89 | - ->textInput (['class'=> 'custom-input-2']); | |
90 | - ?> | |
91 | - </div> | |
92 | -</div> | |
95 | + <div class="input-blocks-wrapper"> | |
96 | + <div class="input-blocks"> | |
97 | + <?= $form->field ($job_model, '['. ($index + 1) .']name') | |
98 | + ->label ('Название') | |
99 | + ->textInput (['class'=> 'custom-input-2']); | |
100 | + ?> | |
101 | + </div> | |
102 | + </div> | |
93 | 103 | |
94 | 104 | <div class="input-blocks-wrapper"> |
95 | 105 | <div class="input-blocks"> |
... | ... | @@ -102,7 +112,7 @@ $current = array_shift ($job); |
102 | 112 | |
103 | 113 | <div class="input-blocks-wrapper"> |
104 | 114 | <div class="input-blocks"> |
105 | - <?= $form->field ($current, '[0]date_start', ['options' => ['class' => 'test2class']]) | |
115 | + <?= $form->field ($current, '[0]date_start') | |
106 | 116 | ->label ('Дата начала работы') |
107 | 117 | ->widget (DatePicker::className (), ['options' => ['class' => 'custom-input-2'], 'language' => 'ru', 'dateFormat' => 'dd-MM-yyyy', 'clientOptions' => ['changeYear' => true, 'yearRange' => 'c-20:c', 'changeMonth' => true]]); |
108 | 118 | ?> |
... | ... | @@ -113,7 +123,7 @@ $current = array_shift ($job); |
113 | 123 | <div class="input-blocks"> |
114 | 124 | <?= $form->field ($job_model, '['. ($index + 1) .']date_end') |
115 | 125 | ->label ('Дата окончания работы') |
116 | - ->widget (DatePicker::className (), ['language' => 'ru', 'dateFormat' => 'dd-MM-yyyy']); | |
126 | + ->widget (DatePicker::className (), ['options' => ['class' => 'custom-input-2'], 'language' => 'ru', 'dateFormat' => 'dd-MM-yyyy', 'clientOptions' => ['changeYear' => true, 'yearRange' => 'c-20:c', 'changeMonth' => true]]); | |
117 | 127 | ?> |
118 | 128 | </div> |
119 | 129 | </div> |
... | ... | @@ -127,32 +137,40 @@ $current = array_shift ($job); |
127 | 137 | </div> |
128 | 138 | </div> |
129 | 139 | |
130 | - <div class="input-blocks-wrapper"> | |
140 | + <div class="input-blocks-wrapper admin-quantity-project"> | |
131 | 141 | <div class="input-blocks"> |
132 | 142 | <?= $form->field ($job_model, '['. ($index + 1) .']total_count') |
133 | 143 | ->label ('Количество проектов, в которых принимали участие') |
134 | - ->textInput (['class'=> 'custom-input-2','type'=>'number']); | |
144 | + ->textInput (['class'=> 'custom-input-2 custom-input-2-date','type'=>'number']); | |
135 | 145 | ?> |
136 | - </div> | |
137 | - </div> | |
138 | - | |
139 | - <div class="input-blocks-wrapper"> | |
140 | - <div class="input-blocks"> | |
146 | + <div class="fix-quantity-project"> | |
141 | 147 | <?= $form->field ($job_model, '['. ($index + 1) .']complete_count') |
142 | 148 | ->label ('из них реализовано') |
143 | - ->textInput (['class'=> 'custom-input-2','type'=>'number']); | |
149 | + ->textInput (['class'=> 'custom-input-2 custom-input-2-date','type'=>'number']); | |
144 | 150 | ?> |
145 | 151 | </div> |
152 | + </div> | |
146 | 153 | </div> |
147 | - <?= Html::button('Удалить', ['class' => 'remove_job_button']) ?> | |
148 | - </div> | |
154 | + <?= Html::button('', ['class' => 'remove_job_button']) ?> | |
155 | + </div> | |
149 | 156 | <?php } ?> |
150 | 157 | |
151 | - </div> | |
158 | +</div> | |
159 | + | |
160 | +<div class="add-field-employment fix_add-field-employment style"> | |
161 | + <?= | |
162 | + Html::button('добавить еще место работы', ['id' => 'add_job_button', 'class' => 'btn']); | |
163 | + ?> | |
164 | +</div> | |
165 | + | |
166 | + | |
167 | +<div class="input-blocks-wrapper"> | |
168 | + <div class="admin-save-btn skills-save-btn style"> | |
169 | + <?= Html::submitButton('Сохранить',['class'=>'input-blocks-wrapper button']) ?> | |
170 | + </div> | |
171 | +</div> | |
152 | 172 | <?php |
153 | - echo Html::button('Добавить место работы', ['id' => 'add_job_button']); | |
154 | - echo Html::submitButton('Обновить'); | |
155 | - $form->end (); | |
173 | + $form->end (); | |
156 | 174 | ?> |
157 | 175 | <script> |
158 | 176 | $(function() { |
... | ... | @@ -164,16 +182,34 @@ $current = array_shift ($job); |
164 | 182 | var lastindex; |
165 | 183 | if(result != null) { |
166 | 184 | lastindex = result[1]; |
185 | + console.log('111111111') | |
167 | 186 | } else { |
168 | 187 | lastindex = 1; |
188 | + $('.prev_job_container').removeClass('none-job-inputs') | |
189 | + $('.add-field-employment').removeClass('none-job-inputs') | |
169 | 190 | } |
170 | 191 | $.get('/accounts/get-form', { lastindex: lastindex }, function(data) { |
171 | 192 | $('.prev_job_container').append($(data).find('.ajax-loaded').first().html()); |
172 | 193 | $(data).filter('script').appendTo('body'); |
173 | 194 | }); |
195 | + | |
174 | 196 | }); |
175 | 197 | $(document).on('click', '.remove_job_button', function() { |
176 | - $(this).parents('.prev_job_inputs').remove(); | |
198 | + $(this).parents('.prev_job_inputs').remove() | |
199 | + var prevEmploy = $('.prev_job_inputs').length | |
200 | + if(prevEmploy<1){ | |
201 | + $('.prev_job_container').addClass('none-job-inputs') | |
202 | + $('.add-field-employment').addClass('none-job-inputs') | |
203 | + } | |
177 | 204 | }); |
178 | 205 | }); |
179 | 206 | </script> |
207 | + | |
208 | +<script> | |
209 | +// $(document).ready(function(){ | |
210 | +// var prevEmploy = $('.prev_job_inputs').length | |
211 | +// if(prevEmploy<1){ | |
212 | +// $('.prev_job_container').addClass | |
213 | +// } | |
214 | +// }) | |
215 | +</script> | ... | ... |