<p> <?php echo Html::a(Yii::t('admin', 'Create page'), ['../pages/static/create'], ['class' => 'btn btn-success']); ?> <?php \yii\widgets\Pjax::begin(); ?> <?php echo \atuin\engine\widgets\grid\GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'tableOptions' => ['class' => 'table table-striped table-bordered table-hover'], 'gridHookName' => 'staticPageGrid', 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'title', ['attribute' => 'author', 'label' => Yii::t('admin', 'Author'), 'value' => 'author.username'], ['attribute' => 'lastEditor', 'label' => Yii::t('admin', 'Last Editor'), 'value' => 'lastEditor.username'], ['format' => ['date', 'php:d/m/Y'], 'attribute' => 'creation_date'], ['format' => ['date', 'php:d/m/Y'], 'attribute' => 'update_date'], ['class' => 'yii\\grid\\ActionColumn', 'urlCreator' => function ($action, $model, $key, $index) { $url = NULL; if ($action === 'update') { $url = Yii::$app->getHomeUrl() . '/pages/static/update/' . $model->id; } elseif ($action == 'delete') { $url = Yii::$app->getHomeUrl() . '/pages/static/delete/' . $model->id; } elseif ($action == 'view') { $url = Yii::$app->getHomeUrl() . '/pages/static/view/' . $model->id; } return $url; }]]]); ?> <?php \yii\widgets\Pjax::end(); ?> </p> </div> </div> </div>
<p> <?php echo Html::a(Yii::t('admin', 'Add new App'), ['../apps/market'], ['class' => 'btn btn-success']); ?> <?php \yii\widgets\Pjax::begin(); ?> <?php echo \atuin\engine\widgets\grid\GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'tableOptions' => ['class' => 'table table-striped table-bordered table-hover'], 'gridHookName' => 'appsPageGrid', 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'name', 'version', ['format' => ['date', 'php:d/m/Y'], 'attribute' => 'install_date'], 'description', ['class' => 'yii\\grid\\ActionColumn', 'buttons' => ['view' => function ($url, $model, $key) { return Html::a('<span class="glyphicon glyphicon-eye-open"></span>', Yii::$app->getHomeUrl() . '/apps/view/' . $key, ['title' => Yii::t('yii', 'View')]); }, 'update' => function ($url, $model, $key) { if ($model->isUpdated == FALSE) { return Html::a('<span class="glyphicon glyphicon-refresh"></span>', Yii::$app->getHomeUrl() . '/apps/update/' . $key, ['title' => Yii::t('yii', 'Update'), 'data-confirm' => Yii::t('admin', 'Are you sure to update this App?'), 'data-method' => 'post']); } }, 'delete' => function ($url, $model, $key) { if ($model->core_module == 0) { return Html::a('<span class="glyphicon glyphicon-trash"></span>', Yii::$app->getHomeUrl() . '/apps/delete/' . $key, ['title' => Yii::t('yii', 'Delete'), 'data-confirm' => Yii::t('admin', 'Are you sure to delete this App?'), 'data-method' => 'post']); } }]]]]); ?> <?php \yii\widgets\Pjax::end(); ?> </p> </div> </div> </div>