123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 |
- <?php
- use yii\helpers\Html;
- $profile = Yii::$app->user->identity->profile;
- ?>
- <aside class="main-sidebar sidebar-dark-primary elevation-4">
- <!-- Brand Logo -->
- <a href="/manager/" class="brand-link">
- <img src="/img/icon-180x180.png" alt="Amitel Logo" class="brand-image img-circle elevation-3" style="opacity: .8">
- <span class="brand-text font-weight-light">Amitel admin 3</span>
- </a>
- <!-- Sidebar -->
- <div class="sidebar">
- <!-- Sidebar user panel (optional) -->
- <div class="user-panel mt-3 pb-3 mb-3 d-flex">
- <div class="image">
- <?/*=Html::img($profile->getAvatarUrl($profile->gravatar_id), [
- 'class' => 'img-circle elevation-2',
- 'alt' => $profile->user->username,
- ]) */?>
- </div>
- <div class="info">
- <a href="#" class="d-block"><?=$profile->name?></a>
- </div>
- </div>
- <!-- SidebarSearch Form -->
- <!-- href be escaped -->
- <!-- <div class="form-inline">
- <div class="input-group" data-widget="sidebar-search">
- <input class="form-control form-control-sidebar" type="search" placeholder="Search" aria-label="Search">
- <div class="input-group-append">
- <button class="btn btn-sidebar">
- <i class="fas fa-search fa-fw"></i>
- </button>
- </div>
- </div>
- </div> -->
- <!-- Sidebar Menu -->
- <nav class="mt-2 nav-flat">
- <?php
- echo \hail812\adminlte\widgets\Menu::widget([
- 'options' => ['Class' => 'nav nav-pills nav-sidebar nav-child-indent flex-column'],
- 'items' => [
- ['label' => 'Login', 'url' => ['site/login'], 'icon' => 'sign-in-alt', 'visible' => Yii::$app->user->isGuest],
- [
- 'label' => 'Новости',
- 'icon' => 'newspaper',
- 'url' => ['/manager/news/list'],
- // 'badge' => '<span class="right badge badge-info">2</span>',
- 'options' => ['class' => 'nav-item menu-open'],
- 'items' => [
- ['label' => 'День', 'url' => ['/manager/news/list'], 'iconStyle' => 'far'],
- ['label' => 'В очереди', 'url' => ['/manager/news/inactive'], 'iconStyle' => 'far', 'iconClassAdded'=>'fa-clock'],
- ['label' => 'Создать', 'url' => ['/manager/news/create'], 'iconStyle' => 'fas', 'iconClassAdded'=>'','icon' => 'pen-nib'],
- ]
- ],
- [
- 'label' => 'Комментарии',
- 'url' => ['/manager/comments/index'],
- 'icon' => 'comments',
- 'badge' => '<span class="right badge badge-danger">'.\manager\models\Comments::find()->andWhere(['visible'=>"N"])->count().'</span>',
- 'items' => [
- ['label' => 'Настройки', 'url' => ['/manager/comments/conf'], 'iconStyle' => 'fa', 'iconClassAdded'=>'','icon' => 'wrench'],
- ['label' => 'Фильтры', 'url' => ['/manager/comments-filter'], 'iconStyle' => 'fa', 'iconClassAdded'=>'','icon' => 'wrench', 'badge' => '<span class="right badge badge-danger">New</span>',],
- ]
- ],
- [
- 'label' => 'Главная стр.',
- 'icon' => 'tachometer-alt',
- 'url' => ['/manager/design/blocks'],
- // 'badge' => '<span class="right badge badge-info">2</span>',
- 'items' => [
- ['label' => 'Блоки на главной', 'url' => ['/manager/design/blocks'], 'iconStyle' => 'far'],
- ['label' => 'Создать Блок', 'url' => ['/manager/design/create'], 'iconStyle' => 'far'],
- ['label' => 'КД блок', 'url' => ['/manager/kd'], 'iconStyle' => 'far', 'iconClass' => 'nav-icon far fa-circle text-warning'],
- ['label' => 'НЧ блок ', 'url' => ['/manager/nh'], 'iconStyle' => 'far', 'iconClassAdded' => 'text-danger'],
- ['label' => 'Слайдер', 'url' => ['/manager/top-slider'], 'iconStyle' => 'far', 'iconClassAdded' => 'text-primary'],
- ['label' => 'Сброс кэша главной', 'url' => ['/manager/design/purge'], 'iconStyle' => 'fa', 'iconClassAdded' => 'fa-shower'],
- ]
- ],
- ['label' => 'Рубрики', 'icon' => 'th', 'url' => ['/manager/news/topiclist'],
- 'items' => [
- ['label' => 'Список', 'url' => ['/manager/news/topiclist'], 'iconStyle' => 'far'],
- ['label' => 'Создать', 'url' => ['/manager/news/topiccreate'], 'iconStyle' => 'far'],
- ['label' => 'Все', 'url' => ['/manager/news/topicall'], 'iconStyle' => 'far'],
- ]
- ],
- ['label' => 'Сюжеты', 'icon' => 'th', 'url' => ['/manager/news/storylist'],
- 'items' => [
- ['label' => 'Список', 'url' => ['/manager/news/storylist'], 'iconStyle' => 'far'],
- ['label' => 'Создать', 'url' => ['/manager/news/storycreate'], 'iconStyle' => 'far']
- ]
- ],
- ['label' => 'Тэги', 'icon' => 'th', 'url' => ['/manager/tags/index'],
- 'items' => [
- ['label' => 'Список', 'url' => ['/manager/tags/index'], 'iconStyle' => 'far'],
- ['label' => 'Создать', 'url' => ['/manager/tags/create'], 'iconStyle' => 'far'],
- ['label' => 'Меню', 'url' => ['/manager/tagsfilter/index'], 'iconStyle' => 'far', 'iconClass'=>'nav-icon fas fa-th-list']
- ]
- ],
- ['label' => 'Опросы', 'icon' => 'thumbs-up', 'url' => ['/manager/inquirer/'],
- 'badge' => '<span class="right badge badge-danger">New</span>',
- 'items' => [
- ['label' => 'Список опросов', 'url' => ['/manager/inquirer/index'], 'iconStyle' => 'far'],
- ['label' => 'Создать', 'url' => ['/manager/inquirer/create'], 'iconStyle' => 'far'],
- ]
- ],
- ['label' => 'Статистика', 'icon' => 'chart-pie', 'url' => ['/manager/stats/index'],
- 'badge' => '<span class="right badge badge-danger">New</span>',
- 'items' => [
- ['label' => 'доска', 'url' => ['/manager/stats/index'], 'iconStyle' => 'fas', 'icon'=>'tachometer-alt'],
- ['label' => 'Авторы', 'url' => ['/manager/stats/authors'], 'iconStyle' => 'far', 'icon'=>'user-circle'],
- ['label' => 'Автор по дням', 'url' => ['/manager/stats/authorsd'], 'iconStyle' => 'far', 'icon'=>'user']
- ]
- ],
- ['label' => 'Персоны','icon' => 'user', 'url' => ['/manager/person/']
- ],
- ['label' => 'Авторы','icon' => 'user', 'url' => ['/manager/authors/'],
- ],
- ['label' => 'пользователи', 'icon' => 'user', 'url' => ['/user/admin/index'], 'visible' => Yii::$app->user->can('view_manage_users_page'),
- 'items' => [
- ['label' => 'Список', 'iconStyle' => 'far fa-solid fa-user', 'url' => ['/user/admin/index']],
- ['label' => 'Новый', 'iconStyle' => 'far fa-user', 'url' => ['/user/admin/create']]
- ]
- ],
- ['label' => 'Страницы', 'icon' => 'file', 'url' => ['/manager/page'],
- ],
- ['label' => 'Документы', 'icon' => 'file', 'url' => ['/manager/docs'],
- 'badge' => '<span class="right badge badge-danger">New</span>',
- ],
- ['label' => 'Старые фоторепы', 'icon' => 'file', 'url' => ['/manager/report-topic'],
- 'badge' => '<span class="right badge badge-danger">New</span>',
- ],
- ['label' => 'Yii2 PROVIDED', 'header' => true, 'visible' => YII_ENV_DEV],
- ['label' => 'Gii', 'icon' => 'file-code', 'url' => ['/gii'], 'target' => '_blank', 'visible' => YII_ENV_DEV],
- ['label' => 'Debug', 'icon' => 'bug', 'url' => ['/debug'], 'target' => '_blank', 'visible' => YII_ENV_DEV],
- ['label' => 'Test', 'icon' => 'bug', 'url' => ['/manager/news/test'], 'target' => '_blank', 'visible' => YII_ENV_DEV],
- ],
- ]);
- ?>
- </nav>
- <!-- /.sidebar-menu -->
- </div>
- <!-- /.sidebar -->
- </aside>
- <script>
- var url = String(window.location);
- $('ul.nav-sidebar a').filter(function() {
- // console.log(url+'-'+this.href.indexOf('kd')+':'+url.indexOf("design"));
- if( this.href.indexOf('design') >= 0 && ( url.indexOf("kd") >= 0 || url.indexOf("nh") >= 0 || url.indexOf("top-slider") >= 0 ) ) return true;
- if( this.href.indexOf('tags') >= 0 && ( url.indexOf("tagsfilter") >= 0 ) ) return true;
- if( this.href.indexOf('comments') >= 0 && ( url.indexOf("comments-filter") >= 0 ) ) return true;
- return this.href == url;
- }).parent().addClass('menu-open');
- </script>
|