Ejemplo n.º 1
0
            </p>
            <p class="pull-right">
                <?php 
echo Html::a('<i class="glyphicon glyphicon-th-large"></i> ' . Module::t('module', 'BUTTON_CATEGORIES'), ['category/index'], ['class' => 'btn btn-primary']);
?>
                <?php 
echo Html::a('<i class="glyphicon glyphicon-tags"></i> ' . Module::t('module', 'BUTTON_TAGS'), ['tags/index'], ['class' => 'btn btn-primary']);
?>
                <?php 
echo Html::a('<i class="glyphicon glyphicon-comment"></i> ' . Module::t('module', 'BUTTON_COMMENTS') . ' <span class="badge">' . $countPending . '</span>', ['comment/index'], ['class' => 'btn btn-primary']);
?>
            </p>
        </div>
    </div>

    <?php 
$gridColumn = [['class' => 'yii\\grid\\SerialColumn'], ['class' => LinkColumn::className(), 'attribute' => 'title'], ['attribute' => 'author_id', 'label' => Module::t('module', 'LABEL_AUTHOR'), 'format' => 'text', 'content' => function ($data) {
    return $data->getAuthorName();
}, 'filter' => Post::getAuthorList()], ['filter' => DatePicker::widget(['model' => $searchModel, 'attribute' => 'date_from', 'attribute2' => 'date_to', 'type' => DatePicker::TYPE_RANGE, 'separator' => '-', 'pluginOptions' => ['format' => 'yyyy-mm-dd', 'todayHighlight' => true]]), 'attribute' => 'created_at', 'format' => ['date', 'php:d M Y г., H:i:s']], ['filter' => DatePicker::widget(['model' => $searchModel, 'attribute' => 'dateUpd_from', 'attribute2' => 'dateUpd_to', 'type' => DatePicker::TYPE_RANGE, 'separator' => '-', 'pluginOptions' => ['format' => 'yyyy-mm-dd', 'todayHighlight' => true]]), 'attribute' => 'updated_at', 'format' => ['date', 'php:d M Y г., H:i:s']], ['class' => SetColumn::className(), 'attribute' => 'publish_status', 'filter' => Post::getStatusesArray(), 'name' => function ($model) {
    return Post::getStatusTitle($model->publish_status);
}, 'cssCLasses' => [Post::STATUS_PUBLISH => 'success', Post::STATUS_DRAFT => 'default', Post::STATUS_ARCHIVE => 'info']], ['attribute' => 'category_id', 'label' => Module::t('module', 'LABEL_CATEGORY'), 'format' => 'text', 'content' => function ($data) {
    return $data->getCategoryTitle();
}, 'filter' => Post::getCategoryList()], ['class' => ActionColumn::className()]];
?>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => $gridColumn, 'responsive' => true, 'hover' => true, 'pjax' => false, 'resizableColumns' => true, 'toolbar' => [['content' => Html::a('<i class="glyphicon glyphicon-repeat"></i>', ['index'], ['class' => 'btn btn-default', 'title' => Module::t('module', 'RESET_GRID')])], '{toggleData}'], 'panel' => ['heading' => '<h3 class="panel-title"><i class="glyphicon glyphicon-th-list"></i> ' . Html::encode($this->title) . '</h3>', 'type' => 'primary', 'before' => Html::a('<i class="glyphicon glyphicon-plus"></i> ' . Module::t('module', 'BUTTON_CREATE'), ['create'], ['class' => 'btn btn-success', 'data-pjax' => 0])]]);
?>

</div>
Ejemplo n.º 2
0
use app\components\grid\LinkColumn;
use app\modules\admin\modules\users\models\User;
use kartik\date\DatePicker;
use app\modules\admin\modules\users\Module;
/* @var $this yii\web\View */
/* @var $searchModel \app\modules\admin\modules\users\models\search\UserSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Module::t('module', 'ADMIN_USERS');
$this->params['breadcrumbs'][] = ['label' => Module::t('module', 'ADMIN'), 'url' => ['/admin/default/index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="admin-users-default-index">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>
    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

    <?php 
$gridColumn = [['class' => 'yii\\grid\\SerialColumn'], ['filter' => DatePicker::widget(['model' => $searchModel, 'attribute' => 'date_from', 'attribute2' => 'date_to', 'type' => DatePicker::TYPE_RANGE, 'separator' => '<i class="glyphicon glyphicon-arrow-right"></i>', 'pluginOptions' => ['format' => 'yyyy-mm-dd', 'todayHighlight' => true]]), 'attribute' => 'created_at', 'format' => ['date', 'php:d M Y г., H:i:s']], ['class' => LinkColumn::className(), 'attribute' => 'username'], 'email:email', ['class' => SetColumn::className(), 'filter' => User::getStatusesArray(), 'attribute' => 'status', 'name' => 'statusName', 'cssCLasses' => [User::STATUS_ACTIVE => 'success', User::STATUS_WAIT => 'warning', User::STATUS_BLOCKED => 'default']], ['filter' => User::getRolesArray(), 'attribute' => 'role', 'value' => 'RoleName'], ['class' => ActionColumn::className()]];
?>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => $gridColumn, 'responsive' => true, 'hover' => true, 'pjax' => false, 'resizableColumns' => true, 'toolbar' => [['content' => Html::a('<i class="glyphicon glyphicon-repeat"></i>', ['index'], ['class' => 'btn btn-default', 'title' => Module::t('module', 'RESET_GRID')])], '{toggleData}'], 'panel' => ['heading' => '<h3 class="panel-title"><i class="glyphicon glyphicon-user"></i> ' . Html::encode($this->title) . '</h3>', 'type' => 'primary', 'before' => Html::a('<i class="glyphicon glyphicon-plus"></i> ' . Module::t('module', 'BUTTON_CREATE'), ['create'], ['class' => 'btn btn-success', 'data-pjax' => 0])]]);
?>

</div>
Ejemplo n.º 3
0
use app\modules\admin\Module;
use app\components\grid\SetColumn;
use kartik\date\DatePicker;
use yii\helpers\Html;
use yii\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel \app\modules\admin\models\search\UserSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Module::t('module', 'ADMIN_USERS');
$this->params['breadcrumbs'][] = ['label' => Module::t('module', 'ADMIN'), 'url' => ['default/index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="users-index">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>

    <p>
        <?php 
echo Html::a(Module::t('module', 'ADMIN_USERS_ADD'), ['create'], ['class' => 'btn btn-success']);
?>
    </p>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => ['id', ['filter' => DatePicker::widget(['model' => $searchModel, 'attribute' => 'date_from', 'attribute2' => 'date_to', 'type' => DatePicker::TYPE_RANGE, 'separator' => '-', 'pluginOptions' => ['format' => 'yyyy-mm-dd']]), 'attribute' => 'created_at', 'format' => 'datetime', 'filterOptions' => ['style' => 'max-width: 180px']], ['class' => LinkColumn::className(), 'attribute' => 'username'], 'email:email', ['class' => SetColumn::className(), 'filter' => User::getStatusesArray(), 'attribute' => 'status', 'name' => 'statusName', 'cssCLasses' => [User::STATUS_ACTIVE => 'success', User::STATUS_WAIT => 'warning', User::STATUS_BLOCKED => 'default']], ['class' => ActionColumn::className()]]]);
?>

</div>
Ejemplo n.º 4
0
?>
<div class="admin-blog-tags-index">

    <div class="row">
        <div class="col-md-12">
            <p class="pull-left">
            </p>
            <p class="pull-right">
                <?php 
echo Html::a('<i class="glyphicon glyphicon-th-large"></i> ' . Module::t('module', 'BUTTON_CATEGORIES'), ['category/index'], ['class' => 'btn btn-primary']);
?>
                <?php 
echo Html::a('<i class="glyphicon glyphicon-th-list"></i> ' . Module::t('module', 'BUTTON_POSTS'), ['post/index'], ['class' => 'btn btn-primary']);
?>
                <?php 
echo Html::a('<i class="glyphicon glyphicon-comment"></i> ' . Module::t('module', 'BUTTON_COMMENTS'), ['comment/index'], ['class' => 'btn btn-primary']);
?>
            </p>
        </div>
    </div>

    <?php 
$gridColumn = [['class' => 'yii\\grid\\SerialColumn'], 'title', ['class' => ActionColumn::className()]];
?>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => $gridColumn, 'responsive' => true, 'hover' => true, 'pjax' => false, 'resizableColumns' => true, 'toolbar' => [['content' => Html::a('<i class="glyphicon glyphicon-repeat"></i>', ['index'], ['class' => 'btn btn-default', 'title' => Module::t('module', 'RESET_GRID')])], '{toggleData}'], 'panel' => ['heading' => '<h3 class="panel-title"><i class="glyphicon glyphicon-tags"></i> ' . Html::encode($this->title) . '</h3>', 'type' => 'primary', 'before' => Html::a('<i class="glyphicon glyphicon-plus"></i> ' . Module::t('module', 'BUTTON_CREATE'), ['create'], ['class' => 'btn btn-success', 'data-pjax' => 0])]]);
?>

</div>
Ejemplo n.º 5
0
use app\components\grid\SetColumn;
use app\components\grid\LinkColumn;
use kartik\date\DatePicker;
use app\modules\admin\modules\comment\models\Comment;
use app\modules\admin\modules\comment\Module;
/* @var $this yii\web\View */
/* @var $searchModel app\modules\admin\modules\comment\models\CommentSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Module::t('module', 'ADMIN_COMMENTS');
$this->params['breadcrumbs'][] = ['label' => Module::t('module', 'ADMIN'), 'url' => ['/admin/default/index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="admin-comment-default-index">
    <?php 
$gridColumn = [['class' => 'yii\\grid\\SerialColumn'], ['class' => 'kartik\\grid\\ExpandRowColumn', 'width' => '50px', 'value' => function ($model, $key, $index, $column) {
    return GridView::ROW_COLLAPSED;
}, 'detail' => function ($model, $key, $index, $column) {
    return Yii::$app->controller->renderPartial('_expand-row-details', ['model' => $model]);
}, 'headerOptions' => ['class' => 'kartik-sheet-style'], 'expandOneOnly' => true], ['attribute' => 'created_at', 'format' => ['date', 'php:d M Y г., H:i:s']], 'author', ['attribute' => 'material_id', 'contentOptions' => [], 'filter' => false, 'content' => function ($data) {
    $materialModel = new $data->namespace();
    return $materialModel->getModelMaterial($data->material_id)->title;
}], ['attribute' => 'type', 'contentOptions' => ['style' => 'width:100px;'], 'headerOptions' => ['style' => 'width:100px;'], 'filter' => true, 'content' => function ($data) {
    return $data->type;
}], ['class' => SetColumn::className(), 'attribute' => 'moder', 'headerOptions' => ['style' => 'width:100px;'], 'filter' => Comment::getModerationsArray(), 'name' => function ($model) {
    return Comment::getModerTitle($model->moder);
}, 'cssCLasses' => [Comment::COMMENT_MODER_ALLOWED => 'success', Comment::COMMENT_MODER_DISALLOWED => 'danger', Comment::COMMENT_MODER_PENDING => 'warning']], ['class' => ActionColumn::className(), 'header' => Module::t('module', 'GRID_ACTIONS'), 'headerOptions' => ['style' => 'width:100px;']]];
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => $gridColumn, 'responsive' => true, 'hover' => true, 'pjax' => false, 'resizableColumns' => true, 'toolbar' => [['content' => Html::a('<i class="glyphicon glyphicon-repeat"></i>', ['index'], ['class' => 'btn btn-default', 'title' => Yii::t('app', 'Reset Grid')])], '{toggleData}'], 'panel' => ['heading' => '<h3 class="panel-title"><i class="glyphicon glyphicon-comment"></i> ' . Html::encode($this->title) . '</h3>', 'type' => 'primary']]);
?>

</div>
Ejemplo n.º 6
0
use app\components\grid\LinkColumn;
use app\modules\admin\modules\user\models\User;
use app\modules\admin\modules\user\Module;
use app\components\grid\SetColumn;
use kartik\date\DatePicker;
use yii\helpers\Html;
use yii\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel \app\modules\admin\modules\user\models\search\UserSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Module::t('module', 'ADMIN_USERS');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="users-index">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>

    <p>
        <?php 
echo Html::a(Module::t('module', 'ADMIN_USERS_ADD'), ['create'], ['class' => 'btn btn-success']);
?>
    </p>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['filter' => DatePicker::widget(['model' => $searchModel, 'attribute' => 'date_from', 'attribute2' => 'date_to', 'type' => DatePicker::TYPE_RANGE, 'separator' => '-', 'pluginOptions' => ['format' => 'yyyy-mm-dd']]), 'attribute' => 'created_at', 'format' => 'datetime'], ['class' => LinkColumn::className(), 'attribute' => 'username'], 'email:email', ['class' => SetColumn::className(), 'filter' => User::getStatusesArray(), 'attribute' => 'status', 'name' => 'statusName', 'cssCLasses' => User::getLabelsArray()], ['filter' => User::getRolesArray(), 'attribute' => 'role', 'value' => 'RoleName'], ['class' => ActionColumn::className()]]]);
?>
</div>
Ejemplo n.º 7
0
/* @var $this yii\web\View */
/* @var $searchModel app\modules\admin\models\UserSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
/* @var $model app\modules\user\models\User */
$this->title = 'Пользователи';
$this->params['breadcrumbs'][] = ['label' => 'Админ-панель', 'url' => ['default/index']];
$this->params['breadcrumbs'][] = ['label' => 'Пользователи', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="user-index">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>
    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

    <p>
        <?php 
echo Html::a('Создать запись', ['create'], ['class' => 'btn btn-success']);
?>
    </p>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'id', 'username', 'usr', 'trainerActive', 'email:email', 'userGroup:ntext', 'PID:ntext', 'date', 'version', 'status', ['class' => ActionColumn::className()]]]);
?>

</div>