add backend theme AdminLte, bind reception/transaction to a permission
This commit is contained in:
26
backend/views/layouts/content.php
Normal file
26
backend/views/layouts/content.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
use yii\widgets\Breadcrumbs;
|
||||
use dmstr\widgets\Alert;
|
||||
|
||||
?>
|
||||
<div class="content-wrapper">
|
||||
<section class="content-header clearfix">
|
||||
|
||||
<?=
|
||||
Breadcrumbs::widget(
|
||||
[
|
||||
'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
|
||||
]
|
||||
) ?>
|
||||
</section>
|
||||
|
||||
<section class="content">
|
||||
<?= Alert::widget() ?>
|
||||
<?= $content ?>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<footer class="main-footer">
|
||||
© <?= Yii::$app->name ?> <?= Yii::$app->params['version'] ?> Fitness - WebAdmin <?= date('Y') ?>
|
||||
</footer>
|
||||
|
||||
69
backend/views/layouts/header.php
Normal file
69
backend/views/layouts/header.php
Normal file
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
use yii\helpers\Html;
|
||||
|
||||
/* @var $this \yii\web\View */
|
||||
/* @var $content string */
|
||||
?>
|
||||
|
||||
<header class="main-header">
|
||||
|
||||
<?= Html::a('<span class="logo-mini">A</span><span class="logo-lg">Fitness Admin</span>', Yii::$app->homeUrl, ['class' => 'logo']) ?>
|
||||
|
||||
<nav class="navbar navbar-static-top" role="navigation">
|
||||
|
||||
<a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
</a>
|
||||
|
||||
<div class="navbar-header">
|
||||
<a class="navbar-brand" href="#">Web Recepció</a>
|
||||
</div>
|
||||
|
||||
<div class="navbar-custom-menu">
|
||||
|
||||
<ul class="nav navbar-nav">
|
||||
|
||||
<!-- User Account: style can be found in dropdown.less -->
|
||||
|
||||
<li class="dropdown user user-menu">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
||||
<span class='glyphicon glyphicon-user'></span>
|
||||
<span class="hidden-xs"><?php echo Yii::$app->user->identity->username?></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<!-- User image -->
|
||||
<li class="user-header">
|
||||
|
||||
<p>
|
||||
<?php echo Yii::$app->user->identity->username?>
|
||||
<small>Felhasználó</small>
|
||||
</p>
|
||||
</li>
|
||||
<!-- Menu Footer-->
|
||||
<li class="user-footer">
|
||||
<div class="pull-left">
|
||||
<!--
|
||||
<a href="#" class="btn btn-default btn-flat">Profile</a>
|
||||
-->
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<?= Html::a(
|
||||
Yii::t('common/site','Logout'),
|
||||
['/site/logout'],
|
||||
['data-method' => 'post', 'class' => 'btn btn-default btn-flat']
|
||||
) ?>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<!-- User Account: style can be found in dropdown.less -->
|
||||
<!--
|
||||
<li>
|
||||
<a href="#" data-toggle="control-sidebar"><i class="fa fa-gears"></i></a>
|
||||
</li>
|
||||
-->
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
20
backend/views/layouts/left.php
Normal file
20
backend/views/layouts/left.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
use backend\components\AdminMenuStructure;
|
||||
?>
|
||||
|
||||
<?php
|
||||
$menu = new AdminMenuStructure();
|
||||
$menu = $menu->run();
|
||||
$items = $menu;
|
||||
|
||||
?>
|
||||
<aside class="main-sidebar">
|
||||
<section class="sidebar">
|
||||
<?= \backend\components\LTEAdminMenu::widget(
|
||||
[
|
||||
'options' => ['class' => 'sidebar-menu'],
|
||||
'items' => $items
|
||||
]
|
||||
) ?>
|
||||
</section>
|
||||
</aside>
|
||||
29
backend/views/layouts/main-login.php
Normal file
29
backend/views/layouts/main-login.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
use backend\assets\AppAsset;
|
||||
use yii\helpers\Html;
|
||||
|
||||
/* @var $this \yii\web\View */
|
||||
/* @var $content string */
|
||||
|
||||
dmstr\web\AdminLteAsset::register($this);
|
||||
?>
|
||||
<?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 class="login-page">
|
||||
|
||||
<?php $this->beginBody() ?>
|
||||
|
||||
<?= $content ?>
|
||||
|
||||
<?php $this->endBody() ?>
|
||||
</body>
|
||||
</html>
|
||||
<?php $this->endPage() ?>
|
||||
@@ -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