sidebar.php 4.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <?php
  2. use yii\helpers\Html;
  3. $profile = Yii::$app->user->identity->profile;
  4. ?>
  5. <aside class="main-sidebar sidebar-dark-primary elevation-4">
  6. <!-- Brand Logo -->
  7. <a href="index3.html" class="brand-link">
  8. <img src="<?=$assetDir?>/img/AdminLTELogo.png" alt="AdminLTE Logo" class="brand-image img-circle elevation-3" style="opacity: .8">
  9. <span class="brand-text font-weight-light">AdminLTE 3</span>
  10. </a>
  11. <!-- Sidebar -->
  12. <div class="sidebar">
  13. <!-- Sidebar user panel (optional) -->
  14. <div class="user-panel mt-3 pb-3 mb-3 d-flex">
  15. <div class="image">
  16. <?=Html::img($profile->getAvatarUrl($profile->gravatar_id), [
  17. 'class' => 'img-circle elevation-2',
  18. 'alt' => $profile->user->username,
  19. ]) ?>
  20. </div>
  21. <div class="info">
  22. <a href="#" class="d-block"><?=$profile->name?></a>
  23. </div>
  24. </div>
  25. <!-- SidebarSearch Form -->
  26. <!-- href be escaped -->
  27. <!-- <div class="form-inline">
  28. <div class="input-group" data-widget="sidebar-search">
  29. <input class="form-control form-control-sidebar" type="search" placeholder="Search" aria-label="Search">
  30. <div class="input-group-append">
  31. <button class="btn btn-sidebar">
  32. <i class="fas fa-search fa-fw"></i>
  33. </button>
  34. </div>
  35. </div>
  36. </div> -->
  37. <!-- Sidebar Menu -->
  38. <nav class="mt-2 nav-flat">
  39. <?php
  40. echo \hail812\adminlte\widgets\Menu::widget([
  41. 'items' => [
  42. ['label' => 'Login', 'url' => ['site/login'], 'icon' => 'sign-in-alt', 'visible' => Yii::$app->user->isGuest],
  43. [
  44. 'label' => 'Новости',
  45. 'icon' => 'tachometer-alt',
  46. 'url' => ['/manager/news/list'],
  47. // 'badge' => '<span class="right badge badge-info">2</span>',
  48. 'items' => [
  49. ['label' => 'День', 'url' => ['/manager/news/list'], 'iconStyle' => 'far'],
  50. ['label' => 'В очереди', 'url' => ['/manager/news/inactive'], 'iconStyle' => 'far'],
  51. ['label' => 'Создать', 'url' => ['/manager/news/new'], 'iconStyle' => 'far'],
  52. ]
  53. ],
  54. ['label' => 'Рубрики', 'icon' => 'th', 'badge' => '<span class="right badge badge-danger">New</span>', 'url' => ['/manager/news/topiclist'],
  55. 'items' => [
  56. ['label' => 'Список', 'url' => ['/manager/news/topiclist'], 'iconStyle' => 'far'],
  57. ['label' => 'Создать', 'url' => ['/manager/news/topiccreate'], 'iconStyle' => 'far'],
  58. ['label' => 'Все', 'url' => ['/manager/news/topicall'], 'iconStyle' => 'far'],
  59. ]
  60. ],
  61. ['label' => 'Сюжеты', 'icon' => 'th', 'badge' => '<span class="right badge badge-danger">New</span>', 'url' => ['/manager/news/storylist'],
  62. 'items' => [
  63. ['label' => 'Список', 'url' => ['/manager/news/storylist'], 'iconStyle' => 'far'],
  64. ['label' => 'Создать', 'url' => ['/manager/news/storycreate'], 'iconStyle' => 'far']
  65. ]
  66. ],
  67. ['label' => 'пользователи','icon' => 'user',
  68. 'items' => [
  69. ['label' => 'Список', 'iconStyle' => 'far fa-solid fa-user', 'url' => ['/user/admin/index']],
  70. ['label' => 'Новый', 'iconStyle' => 'far fa-user', 'url' => ['/user/admin/create']]
  71. ]
  72. ],
  73. ['label' => 'Yii2 PROVIDED', 'header' => true],
  74. ['label' => 'Gii', 'icon' => 'file-code', 'url' => ['/gii'], 'target' => '_blank'],
  75. ['label' => 'Debug', 'icon' => 'bug', 'url' => ['/debug'], 'target' => '_blank'],
  76. ['label' => 'Test', 'icon' => 'bug', 'url' => ['/manager/news/test'], 'target' => '_blank'],
  77. ['label' => 'LABELS', 'header' => true],
  78. ['label' => 'Important', 'iconStyle' => 'far', 'iconClassAdded' => 'text-danger'],
  79. ['label' => 'Warning', 'iconClass' => 'nav-icon far fa-circle text-warning'],
  80. ['label' => 'Informational', 'iconStyle' => 'far', 'iconClassAdded' => 'text-info'],
  81. ],
  82. ]);
  83. ?>
  84. </nav>
  85. <!-- /.sidebar-menu -->
  86. </div>
  87. <!-- /.sidebar -->
  88. </aside>