Commit a81136e75636b7946f1cdce97eda291cd887f075
1 parent
9230f848
tokar commit
Showing
3 changed files
with
78 additions
and
35 deletions
Show diff stats
frontend/views/accounts/_team_form.php
... | ... | @@ -22,7 +22,7 @@ |
22 | 22 | <div class="input-blocks-wrapper"> |
23 | 23 | <div class="input-blocks"> |
24 | 24 | <?php |
25 | - $form = ActiveForm::begin(); | |
25 | + $form = ActiveForm::begin(); | |
26 | 26 | ?> |
27 | 27 | </div> |
28 | 28 | </div> |
... | ... | @@ -30,71 +30,75 @@ |
30 | 30 | <div class="input-blocks-wrapper"> |
31 | 31 | <div class="input-blocks"> |
32 | 32 | <?= $form->field($team, 'lastname') |
33 | - ->textInput (['class'=> 'custom-input-2']) ?> | |
33 | + ->textInput([ 'class' => 'custom-input-2' ]) ?> | |
34 | 34 | </div> |
35 | 35 | </div> |
36 | 36 | |
37 | 37 | <div class="input-blocks-wrapper"> |
38 | 38 | <div class="input-blocks"> |
39 | 39 | <?= $form->field($team, 'firstname') |
40 | - ->textInput (['class'=> 'custom-input-2']) ?> | |
40 | + ->textInput([ 'class' => 'custom-input-2' ]) ?> | |
41 | 41 | </div> |
42 | 42 | </div> |
43 | 43 | |
44 | 44 | <div class="input-blocks-wrapper"> |
45 | 45 | <div class="input-blocks"> |
46 | 46 | <?= $form->field($team, 'middlename') |
47 | - ->textInput (['class'=> 'custom-input-2']) ?> | |
47 | + ->textInput([ 'class' => 'custom-input-2' ]) ?> | |
48 | 48 | </div> |
49 | 49 | </div> |
50 | 50 | |
51 | 51 | <div class="input-blocks-wrapper"> |
52 | 52 | <div class="input-blocks"> |
53 | 53 | <?= $form->field($team, 'link') |
54 | - ->textInput (['class'=> 'custom-input-2']) ?> | |
54 | + ->textInput([ 'class' => 'custom-input-2' ]) ?> | |
55 | 55 | </div> |
56 | 56 | </div> |
57 | 57 | |
58 | 58 | <div class="input-blocks-wrapper"> |
59 | 59 | <div class="input-blocks"> |
60 | 60 | <?= $form->field($team, 'position') |
61 | - ->textInput (['class'=> 'custom-input-2']) ?> | |
61 | + ->textInput([ 'class' => 'custom-input-2' ]) ?> | |
62 | 62 | </div> |
63 | 63 | </div> |
64 | 64 | |
65 | 65 | <div class="input-blocks-wrapper admn-select-company"> |
66 | 66 | <div class="input-blocks"> |
67 | 67 | <?= $form->field($team, 'department_id') |
68 | - ->dropDownList($department) ?> | |
68 | + ->dropDownList($department) ?> | |
69 | 69 | </div> |
70 | 70 | </div> |
71 | 71 | |
72 | 72 | <div class="input-blocks-wrapper"> |
73 | 73 | <div class="input-blocks"> |
74 | 74 | <?= $form->field($team, 'experience_from', [ 'template' => "{label},<span style='font-weight: 700;font-size: 13px'>лет</span><br /><span class='admn-input-txt' style='margin-right: 10px'>с</span>{input}<span class='admn-input-txt' style='margin-left: 10px'>года</span> \n{hint}\n{error}" ]) |
75 | - ->textInput (['class'=> 'custom-input-2 custom-input-2-date','type'=>'number', 'min' => 1950, 'max' => date('Y')])?> | |
75 | + ->textInput([ | |
76 | + 'class' => 'custom-input-2 custom-input-2-date', | |
77 | + 'type' => 'number', | |
78 | + 'min' => 1950, | |
79 | + 'max' => date('Y'), | |
80 | + ]) ?> | |
76 | 81 | </div> |
77 | 82 | </div> |
78 | 83 | |
79 | 84 | <div class="input-blocks-wrapper"> |
80 | 85 | <div class="input-blocks"> |
81 | - <?= | |
82 | - $form->field($team, 'country_id')->widget(Select2::classname(), [ | |
83 | - 'options' => ['placeholder' => 'Выбор страны ...'], | |
84 | - 'pluginOptions' => [ | |
85 | - 'allowClear' => true, | |
86 | - 'minimumInputLength' => 3, | |
87 | - 'ajax' => [ | |
88 | - 'url' => \yii\helpers\Url::to(['site/country']), | |
89 | - 'dataType' => 'json', | |
90 | - 'data' => new JsExpression('function(params) { return {q:params.term}; }') | |
91 | - ], | |
92 | - 'escapeMarkup' => new JsExpression('function (markup) { return markup; }'), | |
93 | - 'templateResult' => new JsExpression('function(country) { return country.text; }'), | |
94 | - 'templateSelection' => new JsExpression('function (country) { return country.text; }'), | |
95 | - ], | |
96 | - ]); | |
97 | - ?> | |
86 | + <?= $form->field($team, 'country_id') | |
87 | + ->widget(Select2::classname(), [ | |
88 | + 'options' => [ 'placeholder' => 'Выбор страны ...' ], | |
89 | + 'pluginOptions' => [ | |
90 | + 'allowClear' => true, | |
91 | + 'minimumInputLength' => 3, | |
92 | + 'ajax' => [ | |
93 | + 'url' => \yii\helpers\Url::to([ 'site/country' ]), | |
94 | + 'dataType' => 'json', | |
95 | + 'data' => new JsExpression('function(params) { return {q:params.term}; }'), | |
96 | + ], | |
97 | + 'escapeMarkup' => new JsExpression('function (markup) { return markup; }'), | |
98 | + 'templateResult' => new JsExpression('function(country) { return country.text; }'), | |
99 | + 'templateSelection' => new JsExpression('function (country) { return country.text; }'), | |
100 | + ], | |
101 | + ]); ?> | |
98 | 102 | </div> |
99 | 103 | </div> |
100 | 104 | |
... | ... | @@ -111,8 +115,24 @@ |
111 | 115 | </div> |
112 | 116 | |
113 | 117 | <div class="input-blocks-wrapper"> |
114 | - <div class="admin-save-btn skills-save-btn style"> | |
115 | - <?= Html::submitButton('Добавить',['class'=>'input-blocks-wrapper button']) ?> | |
118 | + <div class="admin-save-btn skills-save-btn style"> | |
119 | + <?= Html::submitButton('Добавить', [ 'class' => 'input-blocks-wrapper button' ]) ?> | |
120 | + <?php | |
121 | + if(!$team->isNewRecord) { | |
122 | + echo Html::a('Удалить', [ | |
123 | + 'accounts/team-delete', | |
124 | + 'id' => $team->team_id, | |
125 | + ], [ | |
126 | + 'title' => 'Удалить', | |
127 | + 'aria-label' => 'Удалить', | |
128 | + 'data-confirm' => 'Вы уверены, что хотите удалить этот элемент?', | |
129 | + 'data-method' => 'post', | |
130 | + 'data-pjax' => 0, | |
131 | + 'class'=>'btn' | |
132 | + ]); | |
133 | + } | |
134 | + ?> | |
135 | + <?= Html::a('Отменить', [ 'accounts/team' ]) ?> | |
116 | 136 | </div> |
117 | 137 | </div> |
118 | 138 | |
... | ... | @@ -120,9 +140,18 @@ |
120 | 140 | $form->end(); |
121 | 141 | ?> |
122 | 142 | <script> |
123 | - $(document).ready(function(){ | |
124 | - $('.input-blocks-wrapper.admn-select-company select').change(function(){ | |
125 | - $(this).blur() | |
126 | - }) | |
127 | - }) | |
143 | + $ (document) | |
144 | + .ready ( | |
145 | + function () | |
146 | + { | |
147 | + $ ('.input-blocks-wrapper.admn-select-company select') | |
148 | + .change ( | |
149 | + function () | |
150 | + { | |
151 | + $ (this) | |
152 | + .blur () | |
153 | + } | |
154 | + ) | |
155 | + } | |
156 | + ) | |
128 | 157 | </script> | ... | ... |
frontend/views/accounts/service.php
... | ... | @@ -249,4 +249,10 @@ |
249 | 249 | <?php |
250 | 250 | $form->end(); |
251 | 251 | ?> |
252 | -</div> | |
253 | 252 | \ No newline at end of file |
253 | +</div><script> | |
254 | + $(document).ready(function(){ | |
255 | + $('.input-blocks.admin-currency-second select').change(function(){ | |
256 | + $(this).blur() | |
257 | + }) | |
258 | + }) | |
259 | +</script> | |
254 | 260 | \ No newline at end of file | ... | ... |
frontend/web/css/style.css
... | ... | @@ -6016,11 +6016,19 @@ a {color: #0072bc} |
6016 | 6016 | } |
6017 | 6017 | } |
6018 | 6018 | .input-blocks.admin-currency-first .custom-input-2.custom-input-2-date {width: 66px} |
6019 | -.input-blocks.admin-currency-first {width: 150px} | |
6020 | -.input-blocks.admin-currency-second {} | |
6019 | +.input-blocks.admin-currency-first {width: 150px; position: } | |
6020 | +.input-blocks.admin-currency-second { | |
6021 | + margin-left: -61px; | |
6022 | + box-sizing: border-box; | |
6023 | + padding-top: 23px; | |
6024 | +} | |
6021 | 6025 | .input-blocks.admin-currency-second select { |
6022 | 6026 | border-radius: 0; |
6023 | 6027 | line-height: normal; |
6028 | + width: 150px; | |
6029 | + float: left; | |
6030 | + | |
6031 | + | |
6024 | 6032 | } |
6025 | 6033 | .input-blocks.admin-currency-second select:focus{ |
6026 | 6034 | box-shadow: 1px 2px 2px 0px rgba(215, 215, 215, 0.75) inset; | ... | ... |