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,7 +22,7 @@ | ||
| 22 | <div class="input-blocks-wrapper"> | 22 | <div class="input-blocks-wrapper"> |
| 23 | <div class="input-blocks"> | 23 | <div class="input-blocks"> |
| 24 | <?php | 24 | <?php |
| 25 | - $form = ActiveForm::begin(); | 25 | + $form = ActiveForm::begin(); |
| 26 | ?> | 26 | ?> |
| 27 | </div> | 27 | </div> |
| 28 | </div> | 28 | </div> |
| @@ -30,71 +30,75 @@ | @@ -30,71 +30,75 @@ | ||
| 30 | <div class="input-blocks-wrapper"> | 30 | <div class="input-blocks-wrapper"> |
| 31 | <div class="input-blocks"> | 31 | <div class="input-blocks"> |
| 32 | <?= $form->field($team, 'lastname') | 32 | <?= $form->field($team, 'lastname') |
| 33 | - ->textInput (['class'=> 'custom-input-2']) ?> | 33 | + ->textInput([ 'class' => 'custom-input-2' ]) ?> |
| 34 | </div> | 34 | </div> |
| 35 | </div> | 35 | </div> |
| 36 | 36 | ||
| 37 | <div class="input-blocks-wrapper"> | 37 | <div class="input-blocks-wrapper"> |
| 38 | <div class="input-blocks"> | 38 | <div class="input-blocks"> |
| 39 | <?= $form->field($team, 'firstname') | 39 | <?= $form->field($team, 'firstname') |
| 40 | - ->textInput (['class'=> 'custom-input-2']) ?> | 40 | + ->textInput([ 'class' => 'custom-input-2' ]) ?> |
| 41 | </div> | 41 | </div> |
| 42 | </div> | 42 | </div> |
| 43 | 43 | ||
| 44 | <div class="input-blocks-wrapper"> | 44 | <div class="input-blocks-wrapper"> |
| 45 | <div class="input-blocks"> | 45 | <div class="input-blocks"> |
| 46 | <?= $form->field($team, 'middlename') | 46 | <?= $form->field($team, 'middlename') |
| 47 | - ->textInput (['class'=> 'custom-input-2']) ?> | 47 | + ->textInput([ 'class' => 'custom-input-2' ]) ?> |
| 48 | </div> | 48 | </div> |
| 49 | </div> | 49 | </div> |
| 50 | 50 | ||
| 51 | <div class="input-blocks-wrapper"> | 51 | <div class="input-blocks-wrapper"> |
| 52 | <div class="input-blocks"> | 52 | <div class="input-blocks"> |
| 53 | <?= $form->field($team, 'link') | 53 | <?= $form->field($team, 'link') |
| 54 | - ->textInput (['class'=> 'custom-input-2']) ?> | 54 | + ->textInput([ 'class' => 'custom-input-2' ]) ?> |
| 55 | </div> | 55 | </div> |
| 56 | </div> | 56 | </div> |
| 57 | 57 | ||
| 58 | <div class="input-blocks-wrapper"> | 58 | <div class="input-blocks-wrapper"> |
| 59 | <div class="input-blocks"> | 59 | <div class="input-blocks"> |
| 60 | <?= $form->field($team, 'position') | 60 | <?= $form->field($team, 'position') |
| 61 | - ->textInput (['class'=> 'custom-input-2']) ?> | 61 | + ->textInput([ 'class' => 'custom-input-2' ]) ?> |
| 62 | </div> | 62 | </div> |
| 63 | </div> | 63 | </div> |
| 64 | 64 | ||
| 65 | <div class="input-blocks-wrapper admn-select-company"> | 65 | <div class="input-blocks-wrapper admn-select-company"> |
| 66 | <div class="input-blocks"> | 66 | <div class="input-blocks"> |
| 67 | <?= $form->field($team, 'department_id') | 67 | <?= $form->field($team, 'department_id') |
| 68 | - ->dropDownList($department) ?> | 68 | + ->dropDownList($department) ?> |
| 69 | </div> | 69 | </div> |
| 70 | </div> | 70 | </div> |
| 71 | 71 | ||
| 72 | <div class="input-blocks-wrapper"> | 72 | <div class="input-blocks-wrapper"> |
| 73 | <div class="input-blocks"> | 73 | <div class="input-blocks"> |
| 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}" ]) | 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 | </div> | 81 | </div> |
| 77 | </div> | 82 | </div> |
| 78 | 83 | ||
| 79 | <div class="input-blocks-wrapper"> | 84 | <div class="input-blocks-wrapper"> |
| 80 | <div class="input-blocks"> | 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 | </div> | 102 | </div> |
| 99 | </div> | 103 | </div> |
| 100 | 104 | ||
| @@ -111,8 +115,24 @@ | @@ -111,8 +115,24 @@ | ||
| 111 | </div> | 115 | </div> |
| 112 | 116 | ||
| 113 | <div class="input-blocks-wrapper"> | 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 | </div> | 136 | </div> |
| 117 | </div> | 137 | </div> |
| 118 | 138 | ||
| @@ -120,9 +140,18 @@ | @@ -120,9 +140,18 @@ | ||
| 120 | $form->end(); | 140 | $form->end(); |
| 121 | ?> | 141 | ?> |
| 122 | <script> | 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 | </script> | 157 | </script> |
frontend/views/accounts/service.php
| @@ -249,4 +249,10 @@ | @@ -249,4 +249,10 @@ | ||
| 249 | <?php | 249 | <?php |
| 250 | $form->end(); | 250 | $form->end(); |
| 251 | ?> | 251 | ?> |
| 252 | -</div> | ||
| 253 | \ No newline at end of file | 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 | \ No newline at end of file | 260 | \ No newline at end of file |
frontend/web/css/style.css
| @@ -6016,11 +6016,19 @@ a {color: #0072bc} | @@ -6016,11 +6016,19 @@ a {color: #0072bc} | ||
| 6016 | } | 6016 | } |
| 6017 | } | 6017 | } |
| 6018 | .input-blocks.admin-currency-first .custom-input-2.custom-input-2-date {width: 66px} | 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 | .input-blocks.admin-currency-second select { | 6025 | .input-blocks.admin-currency-second select { |
| 6022 | border-radius: 0; | 6026 | border-radius: 0; |
| 6023 | line-height: normal; | 6027 | line-height: normal; |
| 6028 | + width: 150px; | ||
| 6029 | + float: left; | ||
| 6030 | + | ||
| 6031 | + | ||
| 6024 | } | 6032 | } |
| 6025 | .input-blocks.admin-currency-second select:focus{ | 6033 | .input-blocks.admin-currency-second select:focus{ |
| 6026 | box-shadow: 1px 2px 2px 0px rgba(215, 215, 215, 0.75) inset; | 6034 | box-shadow: 1px 2px 2px 0px rgba(215, 215, 215, 0.75) inset; |