diff --git a/common/models/TenderSearch.php b/common/models/TenderSearch.php index 7c0831e..f21caa3 100755 --- a/common/models/TenderSearch.php +++ b/common/models/TenderSearch.php @@ -36,7 +36,6 @@ return [ [ [ - 'specialization', 'budget_currency', 'contractual', ], @@ -44,6 +43,7 @@ ], [ [ + 'specialization', 'city', 'payment', 'info', diff --git a/frontend/controllers/SearchController.php b/frontend/controllers/SearchController.php index 0b7000d..12e1438 100755 --- a/frontend/controllers/SearchController.php +++ b/frontend/controllers/SearchController.php @@ -90,7 +90,7 @@ $dataProvider->setPagination([ 'pageSize' => 10, ]); - $specialization = Specialization::specializationsList(); + $specializations = Specialization::getSorted()->all(); $currencies = Currency::getCurrencyDropdown(); $payments = Payment::find() ->select([ @@ -103,7 +103,7 @@ return $this->render('project', [ 'model' => $model, 'dataProvider' => $dataProvider, - 'specialization' => $specialization, + 'specializations' => $specializations, 'currencies' => $currencies, 'payments' => $payments, ]); @@ -143,7 +143,7 @@ { $searchModel = new SearchVacancyForm(); - $specialization = Specialization::specializationsList(); + $specializations = Specialization::getSorted()->all(); $query = $searchModel->search(Yii::$app->request->queryParams); @@ -170,7 +170,7 @@ return $this->render('vacancy', [ 'dataProvider' => $dataProvider, - 'specialization' => $specialization, + 'specializations' => $specializations, 'model' => $searchModel, 'pagination' => $pagination, ]); diff --git a/frontend/views/search/project.php b/frontend/views/search/project.php index 0a5e7ac..79f2f63 100755 --- a/frontend/views/search/project.php +++ b/frontend/views/search/project.php @@ -3,10 +3,11 @@ * @var View $this * @var TenderSearch $model * @var ActiveDataProvider $dataProvider - * @var array $specialization + * @var array $specializations * @var array $currencies * @var array $payments */ + use common\models\Specialization; use common\models\TenderSearch; use kartik\select2\Select2; use yii\data\ActiveDataProvider; @@ -35,8 +36,71 @@ ->textInput([ 'class' => 'form-control', 'placeholder' => 'Текст для поиска', ]); + ?> + +
+
+ +
+
+
+ +
+
+
Необходимо выбрать хотя бы одну «специализацию».
+
+
+ +
+ +
+ + field($model, 'specialization') ->dropDownList($specialization, [ 'prompt' => 'Любая' ]); + */ echo $form->field($model, 'city') ->widget(Select2::classname(), [ diff --git a/frontend/views/search/vacancy.php b/frontend/views/search/vacancy.php index 73a2962..c8a885a 100755 --- a/frontend/views/search/vacancy.php +++ b/frontend/views/search/vacancy.php @@ -1,15 +1,16 @@ title = 'My Yii Application'; + $this->title = 'My Yii Application'; ?>
@@ -19,37 +20,99 @@ $this->title = 'My Yii Application';
['class'=>'search-work-form'],'action'=>[''], 'method'=>'get']); + $form = ActiveForm::begin([ + 'options' => [ 'class' => 'search-work-form' ], + 'action' => [ '' ], + 'method' => 'get', + ]); ?> - field($model, '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($model, 'specialization') - ->dropDownList($specialization, ['prompt' => 'Любая']); - ?> + field($model, '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($model, 'specialization') + ->dropDownList($specialization, ['prompt' => 'Любая']); + */ + ?> + + +
    + +
    end(); ?> @@ -59,20 +122,16 @@ $this->title = 'My Yii Application';
    Вакансии
    - $dataProvider, - 'itemView' => '_vacancy_list_view', - 'summary' => false, - ]); - ?> + $dataProvider, + 'itemView' => '_vacancy_list_view', + 'summary' => false, + ]); ?>
    -- libgit2 0.21.4