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 @@
= $form->field($vacancy, 'name')
- ->textInput (['class'=> 'custom-input-2']); ?>
+ ->textInput([ 'class' => 'custom-input-2' ]); ?>
-
-
@@ -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,
+ ]); ?>
- =
- $form->field($vacancy, 'salary_currency', [
+ = $form->field($vacancy, 'salary_currency', [
'template' => "{input}\n{hint}\n{error}",
])
- ->label(false)
- ->dropDownList($currencies)
- ?>
+ ->label(false)
+ ->dropDownList($currencies) ?>
@@ -119,15 +143,15 @@
= $form->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 @@
-
+
- = Html::submitButton($vacancy->isNewRecord?'Добавить':'Обновить', [ 'class' => 'input-blocks-wrapper button' ]) ?>
+ = Html::submitButton($vacancy->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,
+ ]);
+ }
?>
- = Html::a('вернуться', Request::getIsLocal(\Yii::$app->request->referrer)?\Yii::$app->request->referrer:['accounts/vacancy' ]) ?>
+ = Html::a('вернуться', Request::getIsLocal(\Yii::$app->request->referrer) ? \Yii::$app->request->referrer : [ 'accounts/vacancy' ]) ?>
@@ -215,14 +241,34 @@
$form->end();
?>
\ No newline at end of file
--
libgit2 0.21.4