From a0821e650099390adc0d758f4b4e2482a64b3f66 Mon Sep 17 00:00:00 2001 From: Yarik Date: Wed, 9 Mar 2016 17:20:53 +0200 Subject: [PATCH] test --- frontend/views/accounts/_vacancy_form.php | 220 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------------------------------------------------------- 1 file changed, 133 insertions(+), 87 deletions(-) diff --git a/frontend/views/accounts/_vacancy_form.php b/frontend/views/accounts/_vacancy_form.php index 9acbebd..1a5ca8d 100644 --- a/frontend/views/accounts/_vacancy_form.php +++ b/frontend/views/accounts/_vacancy_form.php @@ -1,10 +1,10 @@
field($vacancy, 'name') - ->textInput (['class'=> 'custom-input-2']); ?> + ->textInput([ 'class' => 'custom-input-2' ]); ?>
-
field($vacancy, 'user_name') - ->textInput (['class'=> 'custom-input-2']); ?> - Вы + ->textInput([ 'class' => 'custom-input-2' ]); ?> + firstname ) && !empty( $user->lastname )) { + echo Html::tag('span', 'Вы', [ + 'class' => 'admin-hint-vacancy-contact form_auto_data', + 'data-value' => $user->firstname . ' ' . $user->lastname, + 'title' => 'Вставить данные с Вашего личного кабинета', + ]); + } + ?>
-
field($vacancy, 'phone') - ->textInput (['class'=> 'custom-input-2']); ?> + ->textInput([ 'class' => 'custom-input-2' ]); ?> + getPhones()[1]['phone'])) { + echo Html::tag('span', 'Вы', [ + 'class' => 'admin-hint-vacancy-contact form_auto_data', + 'data-value' => $user->getPhones()[1]['phone'], + 'title' => 'Вставить данные с Вашего личного кабинета', + ]); + } + ?>
- 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; }'), - ], - ]); + field($vacancy, 'city') + ->hint('Город, в котором предлагается работа', ['tag' => 'span']) + ->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; }'), + ], + ]); ?> + userInfo->city )) { + echo Html::tag('span', 'Ваш', [ + 'class' => 'admin-hint-vacancy-contact form_auto_data', + 'data-value' => $user->userInfo->city, + 'title' => 'Вставить данные с Вашего личного кабинета', + ]); + } ?> - Ваш
@@ -80,18 +103,19 @@ 'template' => "{label}
от{input}\n{hint}\n{error}", 'options' => [ 'class' => 'form-inline' ], ]) - ->label('Заработная плата') - ->textInput (['class'=> 'custom-input-2 custom-input-2-date','type'=>'number', 'min' => 0]); - ?> + ->label('Заработная плата') + ->textInput([ + 'class' => 'custom-input-2 custom-input-2-date', + 'type' => 'number', + 'min' => 0, + ]); ?>
- field($vacancy, 'salary_currency', [ + field($vacancy, 'salary_currency', [ 'template' => "{input}\n{hint}\n{error}", ]) - ->label(false) - ->dropDownList($currencies) - ?> + ->label(false) + ->dropDownList($currencies) ?>
@@ -119,15 +143,15 @@
  • field($vacancy, "specializationInput[{$child_second->specialization_id}]", [ - 'template' => '{input}{label}{hint}{error}', + 'template' => '{input}{label}{hint}{error}', ]) - ->label('' . $child_second->specialization_name) - ->checkbox([ - 'value' => $child_second->specialization_id, - 'label' => NULL, - 'uncheck' => NULL, - 'class' => 'custom-check', - ], false) ?> + ->label('' . $child_second->specialization_name) + ->checkbox([ + 'value' => $child_second->specialization_id, + 'label' => NULL, + 'uncheck' => NULL, + 'class' => 'custom-check', + ], false) ?>
  • @@ -148,65 +172,67 @@ -
    +
    + +
    field($vacancy, 'employmentInput') - ->checkboxList($employment, - [ - 'item' => function($index, $label, $name, $checked, $value) { - $return = '
    '; - $return .= ''; - $return .= ''; - $return .= '
    '; - return $return; - } - ] - ) ?> + ->checkboxList($employment, [ + 'item' => function($index, $label, $name, $checked, $value) { + $return = '
    '; + $return .= ''; + $return .= ''; + $return .= '
    '; + return $return; + }, + ]) ?>
    - 'requirements', 'item_id' => $vacancy->vacancy_id, 'model' => 'common\models\Vacancy', 'language' => 'ru', - ] - ); ?> + 'requirements', + 'item_id' => $vacancy->vacancy_id, + 'model' => 'common\models\Vacancy', + 'language' => 'ru', + ]); ?>
    - field($vacancy, 'description')->widget(CKEditor::className()) ?> + field($vacancy, 'description') + ->widget(CKEditor::className()) ?>
    - isNewRecord?'Добавить':'Обновить', [ 'class' => 'input-blocks-wrapper button' ]) ?> + isNewRecord ? 'Добавить' : 'Обновить', [ 'class' => 'input-blocks-wrapper button' ]) ?>
    isNewRecord) { - echo Html::a('Удалить', [ - 'accounts/vacancy-delete', - 'id' => $vacancy->vacancy_id, - ], [ - 'title' => 'Удалить', - 'aria-label' => 'Удалить', - 'data-confirm' => 'Вы уверены, что хотите удалить этот элемент?', - 'data-method' => 'post', - 'data-pjax' => 0, - ]); - } + if(!$vacancy->isNewRecord) { + echo Html::a('Удалить', [ + 'accounts/vacancy-delete', + 'id' => $vacancy->vacancy_id, + ], [ + 'title' => 'Удалить', + 'aria-label' => 'Удалить', + 'data-confirm' => 'Вы уверены, что хотите удалить этот элемент?', + 'data-method' => 'post', + 'data-pjax' => 0, + ]); + } ?>
    - request->referrer)?\Yii::$app->request->referrer:['accounts/vacancy' ]) ?> + request->referrer) ? \Yii::$app->request->referrer : [ 'accounts/vacancy' ]) ?>
    @@ -215,14 +241,34 @@ $form->end(); ?> \ No newline at end of file -- libgit2 0.21.4