add backend theme AdminLte, bind reception/transaction to a permission
This commit is contained in:
@@ -1,76 +1,74 @@
|
||||
<?php
|
||||
use yii\helpers\Html;
|
||||
|
||||
/* @var $this \yii\web\View */
|
||||
/* @var $content string */
|
||||
|
||||
use backend\assets\AppAsset;
|
||||
use yii\helpers\Html;
|
||||
use yii\bootstrap\Nav;
|
||||
use yii\bootstrap\NavBar;
|
||||
use yii\widgets\Breadcrumbs;
|
||||
use common\widgets\Alert;
|
||||
use backend\components\AdminMenuStructure;
|
||||
use kartik\widgets\AlertBlock;
|
||||
|
||||
AppAsset::register($this);
|
||||
if (Yii::$app->controller->action->id === 'login') {
|
||||
/**
|
||||
* Do not use this code in your template. Remove it.
|
||||
* Instead, use the code $this->layout = '//main-login'; in your controller.
|
||||
*/
|
||||
echo $this->render(
|
||||
'main-login',
|
||||
['content' => $content]
|
||||
);
|
||||
} else {
|
||||
|
||||
$adminMenu = new AdminMenuStructure();
|
||||
$items = $adminMenu->run();
|
||||
?>
|
||||
<?php $this->beginPage() ?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="<?= Yii::$app->language ?>">
|
||||
<head>
|
||||
<meta charset="<?= Yii::$app->charset ?>">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<?= Html::csrfMetaTags() ?>
|
||||
<title><?= Html::encode($this->title) ?></title>
|
||||
<?php $this->head() ?>
|
||||
</head>
|
||||
<body>
|
||||
<?php $this->beginBody() ?>
|
||||
if (class_exists('backend\assets\AppAsset')) {
|
||||
backend\assets\AppAsset::register($this);
|
||||
} else {
|
||||
app\assets\AppAsset::register($this);
|
||||
}
|
||||
|
||||
<div class="wrap">
|
||||
<?php
|
||||
NavBar::begin([
|
||||
'brandLabel' => 'Botond Fitness WebAdmin',
|
||||
'brandUrl' => Yii::$app->homeUrl,
|
||||
'options' => [
|
||||
'class' => 'navbar-inverse navbar-fixed-top',
|
||||
],
|
||||
]);
|
||||
echo Nav::widget([
|
||||
'options' => ['class' => 'navbar-nav navbar-right'],
|
||||
'items' => $items,
|
||||
]);
|
||||
NavBar::end();
|
||||
dmstr\web\AdminLteAsset::register($this);
|
||||
|
||||
$directoryAsset = Yii::$app->assetManager->getPublishedUrl('@vendor/almasaeed2010/adminlte/dist');
|
||||
?>
|
||||
<?php $this->beginPage() ?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="<?= Yii::$app->language ?>">
|
||||
<head>
|
||||
<meta charset="<?= Yii::$app->charset ?>"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<?= Html::csrfMetaTags() ?>
|
||||
<title><?= Html::encode($this->title) ?></title>
|
||||
<?php $this->head() ?>
|
||||
<style type="text/css">
|
||||
.content-header > .breadcrumb{
|
||||
position: static;
|
||||
top: auto;
|
||||
left: auto;
|
||||
right: auto;
|
||||
float: left;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body class="hold-transition skin-red sidebar-mini">
|
||||
<?php $this->beginBody() ?>
|
||||
<div class="wrapper">
|
||||
|
||||
<div class="container">
|
||||
<?= Breadcrumbs::widget([
|
||||
'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
|
||||
]) ?>
|
||||
<?php //echo Alert::widget() ?>
|
||||
<?php
|
||||
echo AlertBlock::widget([
|
||||
'useSessionFlash' => true,
|
||||
'type' => AlertBlock::TYPE_GROWL,
|
||||
'delay' => '1'
|
||||
]);
|
||||
<?= $this->render(
|
||||
'header.php',
|
||||
['directoryAsset' => $directoryAsset]
|
||||
) ?>
|
||||
|
||||
<?= $this->render(
|
||||
'left.php',
|
||||
['directoryAsset' => $directoryAsset]
|
||||
)
|
||||
?>
|
||||
<?= $content ?>
|
||||
|
||||
<?= $this->render(
|
||||
'content.php',
|
||||
['content' => $content, 'directoryAsset' => $directoryAsset]
|
||||
) ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
<div class="container">
|
||||
<p class="pull-left">© <?= Yii::$app->name ?> <?= Yii::$app->params['version'] ?> Fitness - WebAdmin <?= date('Y') ?></p>
|
||||
|
||||
<p class="pull-right"><?= Yii::powered() ?></p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<?php $this->endBody() ?>
|
||||
</body>
|
||||
</html>
|
||||
<?php $this->endPage() ?>
|
||||
<?php $this->endBody() ?>
|
||||
</body>
|
||||
</html>
|
||||
<?php $this->endPage() ?>
|
||||
<?php } ?>
|
||||
|
||||
Reference in New Issue
Block a user