Skip to content

Commit

Permalink
continue
Browse files Browse the repository at this point in the history
  • Loading branch information
SilverFire committed Jul 31, 2015
1 parent 2ff79fe commit cf4ac41
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/grid/AccountColumn.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

use hipanel\grid\DataColumn;
use hipanel\modules\hosting\widgets\combo\AccountCombo;
use hipanel\widgets\Select2;
use yii\helpers\Url;
use yii\helpers\Html;

Expand Down
36 changes: 36 additions & 0 deletions src/views/account/_search.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

use hipanel\modules\client\widgets\combo\ClientCombo;
use hipanel\widgets\AdvancedSearch;
use hiqdev\combo\StaticCombo;
use yii\helpers\Html;

?>

<?php $form = AdvancedSearch::begin(compact('model')) ?>
<div class="col-md-4">
<?= $form->field('login_like') ?>
</div>

<div class="col-md-4">
<?= $form->field('client_id')->widget(ClientCombo::classname()) ?>
<?= $form->field('seller_id')->widget(ClientCombo::classname()) ?>
</div>

<div class="col-md-4">
<?= $form->field('state')->widget(StaticCombo::classname(), [
'data' => $state_data,
'hasId' => true,
'pluginOptions' => [
'select2Options' => [
'multiple' => true,
]
],
]) ?>
</div>

<div class="col-md-12">
<?= Html::submitButton(Yii::t('app', 'Search'), ['class' => 'btn btn-primary']) ?>
</div>

<?php $form::end() ?>
13 changes: 11 additions & 2 deletions src/views/account/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

use hipanel\modules\hosting\grid\AccountGridView;
use hipanel\widgets\ActionBox;
use hipanel\widgets\LinkSorter;
use hipanel\widgets\Pjax;
use yii\helpers\Html;
use yii\helpers\Url;
Expand All @@ -22,27 +23,35 @@
echo Html::beginForm();
$box = ActionBox::begin(['bulk' => true, 'options' => ['class' => 'box-info']]);
$box->beginActions();
echo Html::a(Yii::t('app', 'Advanced search'), '#', ['class' => 'btn btn-info search-button']) . '&nbsp;';
echo Html::a(Yii::t('app', 'Create {modelClass}', ['modelClass' => 'account']), ['create'], ['class' => 'btn btn-success']) . '&nbsp;';
echo Html::a(Yii::t('app', 'Create FTP {modelClass}', ['modelClass' => 'account']), ['create-ftponly'], ['class' => 'btn btn-success']) . '&nbsp;';
echo '&nbsp;';
echo LinkSorter::widget([
'show' => true,
'sort' => $dataProvider->getSort(),
'attributes' => [
'login', 'client', 'server', 'state', 'type'
],
]);
$box->endActions();

$box->beginBulkActions();
echo Html::submitButton(Yii::t('app', 'Delete'), ['class' => 'btn btn-danger', 'formmethod' => 'POST', 'formaction' => Url::to('delete')]);
$box->endBulkActions();
echo $this->render('_search', compact('model'));
$box::end();

echo AccountGridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
'checkbox',
'seller_id',
'client_id',
'server',
'account',
'state',
'actions',
'checkbox',
],
]);

Expand Down

0 comments on commit cf4ac41

Please sign in to comment.