Commit bdf3e3610202edf7420b7e0e2871d09280c92684

Authored by Виталий
1 parent a3a1f00a

tokar commit

frontend/views/accounts/_job_form.php
@@ -11,34 +11,65 @@ $model = new Job(['user_id' => \Yii::$app->user->getId (), 'current' => 0]); @@ -11,34 +11,65 @@ $model = new Job(['user_id' => \Yii::$app->user->getId (), 'current' => 0]);
11 $form = ActiveForm::begin (); 11 $form = ActiveForm::begin ();
12 ?> 12 ?>
13 <div class='ajax-loaded'><div class='prev_job_inputs'> 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 <?= Html::button('', ['class' => 'remove_job_button']);?> 73 <?= Html::button('', ['class' => 'remove_job_button']);?>
43 </div></div> 74 </div></div>
44 <?php $form->end (); ?> 75 <?php $form->end (); ?>
frontend/views/accounts/employment.php
@@ -15,9 +15,9 @@ $this-&gt;params[&#39;breadcrumbs&#39;][] = $this-&gt;title; @@ -15,9 +15,9 @@ $this-&gt;params[&#39;breadcrumbs&#39;][] = $this-&gt;title;
15 $form = ActiveForm::begin (); 15 $form = ActiveForm::begin ();
16 $current = array_shift ($job); 16 $current = array_shift ($job);
17 ?> 17 ?>
18 -<div class="current_job_container"> 18 +<div class="current_job_container style">
19 <div class="login-left-column-title-two style">Текущее место работы:</div> 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 <div class="input-blocks-wrapper"> 21 <div class="input-blocks-wrapper">
22 <div class="input-blocks"> 22 <div class="input-blocks">
23 <?= $form->field ($current, '[0]name') 23 <?= $form->field ($current, '[0]name')
@@ -49,47 +49,57 @@ $current = array_shift ($job); @@ -49,47 +49,57 @@ $current = array_shift ($job);
49 <div class="input-blocks"> 49 <div class="input-blocks">
50 <?= $form->field ($current, '[0]date_start', ['options' => ['class' => 'test2class']]) 50 <?= $form->field ($current, '[0]date_start', ['options' => ['class' => 'test2class']])
51 ->label ('Дата начала работы') 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 </div> 54 </div>
55 </div> 55 </div>
56 56
57 - <div class="input-blocks-wrapper"> 57 + <div class="input-blocks-wrapper admin-quantity-project">
58 <div class="input-blocks"> 58 <div class="input-blocks">
59 <?= $form->field ($current, '[0]total_count') 59 <?= $form->field ($current, '[0]total_count')
60 ->label ('Количество проектов, в которых принимали участие') 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 </div> 69 </div>
  70 +
  71 +
  72 +
64 </div> 73 </div>
65 74
  75 + </div>
  76 + <div class="current_job_inputs border-general style">
66 <div class="input-blocks-wrapper"> 77 <div class="input-blocks-wrapper">
67 <div class="input-blocks"> 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 </div> 83 </div>
73 </div> 84 </div>
74 -  
75 </div> 85 </div>
76 </div> 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 <?php 89 <?php
80 foreach ($job as $index => $job_model) 90 foreach ($job as $index => $job_model)
81 { 91 {
82 ?> 92 ?>
83 93
84 <div class='prev_job_inputs'> 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 <div class="input-blocks-wrapper"> 104 <div class="input-blocks-wrapper">
95 <div class="input-blocks"> 105 <div class="input-blocks">
@@ -102,7 +112,7 @@ $current = array_shift ($job); @@ -102,7 +112,7 @@ $current = array_shift ($job);
102 112
103 <div class="input-blocks-wrapper"> 113 <div class="input-blocks-wrapper">
104 <div class="input-blocks"> 114 <div class="input-blocks">
105 - <?= $form->field ($current, '[0]date_start', ['options' => ['class' => 'test2class']]) 115 + <?= $form->field ($current, '[0]date_start')
106 ->label ('Дата начала работы') 116 ->label ('Дата начала работы')
107 ->widget (DatePicker::className (), ['options' => ['class' => 'custom-input-2'], 'language' => 'ru', 'dateFormat' => 'dd-MM-yyyy', 'clientOptions' => ['changeYear' => true, 'yearRange' => 'c-20:c', 'changeMonth' => true]]); 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,7 +123,7 @@ $current = array_shift ($job);
113 <div class="input-blocks"> 123 <div class="input-blocks">
114 <?= $form->field ($job_model, '['. ($index + 1) .']date_end') 124 <?= $form->field ($job_model, '['. ($index + 1) .']date_end')
115 ->label ('Дата окончания работы') 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 </div> 128 </div>
119 </div> 129 </div>
@@ -127,32 +137,40 @@ $current = array_shift ($job); @@ -127,32 +137,40 @@ $current = array_shift ($job);
127 </div> 137 </div>
128 </div> 138 </div>
129 139
130 - <div class="input-blocks-wrapper"> 140 + <div class="input-blocks-wrapper admin-quantity-project">
131 <div class="input-blocks"> 141 <div class="input-blocks">
132 <?= $form->field ($job_model, '['. ($index + 1) .']total_count') 142 <?= $form->field ($job_model, '['. ($index + 1) .']total_count')
133 ->label ('Количество проектов, в которых принимали участие') 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 <?= $form->field ($job_model, '['. ($index + 1) .']complete_count') 147 <?= $form->field ($job_model, '['. ($index + 1) .']complete_count')
142 ->label ('из них реализовано') 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 </div> 151 </div>
  152 + </div>
146 </div> 153 </div>
147 - <?= Html::button('Удалить', ['class' => 'remove_job_button']) ?>  
148 - </div> 154 + <?= Html::button('', ['class' => 'remove_job_button']) ?>
  155 + </div>
149 <?php } ?> 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 <?php 172 <?php
153 - echo Html::button('Добавить место работы', ['id' => 'add_job_button']);  
154 - echo Html::submitButton('Обновить');  
155 - $form->end (); 173 + $form->end ();
156 ?> 174 ?>
157 <script> 175 <script>
158 $(function() { 176 $(function() {
@@ -164,16 +182,34 @@ $current = array_shift ($job); @@ -164,16 +182,34 @@ $current = array_shift ($job);
164 var lastindex; 182 var lastindex;
165 if(result != null) { 183 if(result != null) {
166 lastindex = result[1]; 184 lastindex = result[1];
  185 + console.log('111111111')
167 } else { 186 } else {
168 lastindex = 1; 187 lastindex = 1;
  188 + $('.prev_job_container').removeClass('none-job-inputs')
  189 + $('.add-field-employment').removeClass('none-job-inputs')
169 } 190 }
170 $.get('/accounts/get-form', { lastindex: lastindex }, function(data) { 191 $.get('/accounts/get-form', { lastindex: lastindex }, function(data) {
171 $('.prev_job_container').append($(data).find('.ajax-loaded').first().html()); 192 $('.prev_job_container').append($(data).find('.ajax-loaded').first().html());
172 $(data).filter('script').appendTo('body'); 193 $(data).filter('script').appendTo('body');
173 }); 194 });
  195 +
174 }); 196 });
175 $(document).on('click', '.remove_job_button', function() { 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 </script> 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>
frontend/web/css/style.css
@@ -5504,4 +5504,4 @@ a.blog-new-link:hover{text-decoration: underline !important;} @@ -5504,4 +5504,4 @@ a.blog-new-link:hover{text-decoration: underline !important;}
5504 display: block; 5504 display: block;
5505 border: none; 5505 border: none;
5506 outline: none; 5506 outline: none;
5507 -} 5507 -}
  5508 +}
5508 \ No newline at end of file 5509 \ No newline at end of file