nav-side-bar-component.blade.php 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. {{-- Todo: member-left-sidebar 새탭에 메뉴열기 수정하기 --}}
  2. <!-- User menu -->
  3. <div class="sidebar-section sidebar-user my-1" id="left-sidebar-head-box">
  4. <div class="sidebar-section-body">
  5. <div class="media profile" >
  6. <a href="#" class="mr-3 dropdown-toggle" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  7. <img src="{{ asset('/images/placeholders/placeholder.jpg') }}" class="rounded-circle" alt="">
  8. </a>
  9. <div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
  10. <a class="dropdown-item" href="#">사용권한</a>
  11. <a class="dropdown-item" href="#">지사구분</a>
  12. <a class="dropdown-item" href="#">창고구분</a>
  13. <a class="dropdown-item" href="#">영업구분</a>
  14. <a class="dropdown-item" href="#">지사구분</a>
  15. <a class="dropdown-item" href="#">창고구분</a>
  16. <a class="dropdown-item" href="#">회계구분</a>
  17. <a class="dropdown-item" href="#">국가코드</a>
  18. </div>
  19. <div class="media-body">
  20. <div class="font-weight-semibold">{{ Str::limit(session('user.NickName') ?? '', 10, '') }}</div>
  21. <div class="font-size-sm line-height-sm opacity-50">
  22. {{ session('user.Email') ?? '' }}
  23. </div>
  24. </div>
  25. <div class="ml-3 align-self-center">
  26. <button type="button"
  27. class="btn btn-outline-light-100 text-white border-transparent btn-icon rounded-pill btn-sm d-none d-xl-inline-block">
  28. <i class="icon-cog3"></i>
  29. </button>
  30. <button type="button"
  31. class="btn btn-outline-light-100 text-white border-transparent btn-icon rounded-pill btn-sm d-xl-none">
  32. <i class="icon-cog3"></i>
  33. </button>
  34. </div>
  35. </div>
  36. </div>
  37. <div class="ml-3">
  38. <input type="checkbox" value="1" class="text-center" id="open-left-menu-new-tab-check"> <label class="mb-0" for="open-left-menu-new-tab-check">{{ $form['FormVars']['Title']['OpenMenuNewTab'] }}</label>
  39. </div>
  40. </div>
  41. <!-- /user menu -->
  42. <div class="sidebar-section">
  43. <ul class="nav nav-sidebar" data-nav-type="accordion" id="left-sidebar">
  44. @foreach($menuList ?? [] as $menu)
  45. <li class="nav-item {{ empty($menu['child']) ? '' : 'nav-item-submenu' }}">
  46. <a href="{{ $menu['PageUri'] ? $menu['PageUri'].'?bpa='.$menu['bpa']: '#' }}" target="{{ $menu['IsNewtab'] ? '_blank' : '_self' }}"
  47. class="nav-link {{ $menu['MenuCode'] == $menuCode ? 'active' : '' }}">
  48. <i class="{{ $menu['Icon'] }}"></i> <span>{{ $menu['MenuName'] }}</span>
  49. </a>
  50. @if(isset($menu['child']) && count($menu['child']) > 0)
  51. <ul class="nav nav-group-sub" data-submenu-title="Menu levels" style="display: none;">
  52. @foreach($menu['child'] as $secondMenu)
  53. <li class="nav-item {{ empty($secondMenu['child']) ? '' : 'nav-item-submenu' }}">
  54. <a href="{{ $secondMenu['PageUri'] }}?bpa={{ $secondMenu['bpa'] }}" target="{{ $secondMenu['IsNewtab'] ? '_blank' : '_self' }}"
  55. class="nav-link {{ $secondMenu['MenuCode'] == $menuCode ? 'active' : '' }}">
  56. <i class="{{ $secondMenu['Icon'] }}"></i> {{ $secondMenu['MenuName'] }}</a>
  57. @if(!empty($secondMenu['child']))
  58. <ul class="nav nav-group-sub">
  59. @foreach($secondMenu['child'] as $thirdMenu)
  60. <li class="nav-item">
  61. <a href="{{ $thirdMenu['PageUri'] }}?bpa={{ $thirdMenu['bpa'] }}" target="{{ $thirdMenu['IsNewtab'] ? '_blank' : '_self' }}"
  62. class="nav-link {{ $thirdMenu['MenuCode'] == $menuCode ? 'active' : '' }}">
  63. <i class="{{ $thirdMenu['Icon'] }}"></i> {{ $thirdMenu['MenuName'] }}
  64. </a>
  65. </li>
  66. @endforeach
  67. </ul>
  68. @endif
  69. </li>
  70. @endforeach
  71. </ul>
  72. @endif
  73. </li>
  74. @endforeach
  75. </ul>
  76. </div>
  77. @once
  78. @push('js')
  79. <script>
  80. $(document).ready(function() {
  81. // 왼쪽 메뉴클릭 이벤트
  82. $('#left-sidebar a').on('click', function (e) {
  83. if ($(this).attr('href') && ! $(this).closest('li').hasClass('nav-item-submenu')
  84. && $('#left-sidebar-head-box').find('#open-left-menu-new-tab-check').prop('checked')) {
  85. e.preventDefault();
  86. window.open($(this).attr('href'), '_blank');
  87. }
  88. });
  89. if ({!! json_encode($disableLMenu) !!} == 1) {
  90. $('.sidebar-main').addClass('sidebar-collapsed')
  91. }
  92. if ({!! json_encode($enableRMenu) !!} == 1) {
  93. $('.sidebar-right').removeClass('sidebar-collapsed')
  94. }
  95. $('a.active').closest('ul').closest('.nav-item-submenu').closest('ul').closest('.nav-item-submenu').addClass('nav-item-open');
  96. $('a.active').closest('ul').closest('.nav-item-submenu').addClass('nav-item-open');
  97. $('a.active').closest('.nav-item-submenu').addClass('nav-item-open');
  98. $('a.active').closest('.nav-group-sub').show();
  99. $('a.active').closest('ul').closest('.nav-item-submenu').closest('.nav-group-sub').show();
  100. });
  101. const menuCode = {!! json_encode($menuCode) !!};
  102. const menuList = {!! json_encode($menuList) !!};
  103. const menuPages = {!! json_encode($menuPages) !!};
  104. </script>
  105. @endpush
  106. @endonce