обновлена сборка главного меню для фиксации активного пункта
This commit is contained in:
parent
11670ab92e
commit
ff4d01e6a4
@ -27,6 +27,11 @@ #leftPanel .nav-link {
|
||||
color: #20184d;
|
||||
}
|
||||
|
||||
#leftPanel .nav-link.active {
|
||||
color: #e4e4e4;
|
||||
background-color: #20184d;
|
||||
}
|
||||
|
||||
input[type="radio"]:checked+label {
|
||||
background-color: #e6662a !important;
|
||||
color: white !important;
|
||||
|
||||
@ -1,73 +1,76 @@
|
||||
<?php
|
||||
$items = [];
|
||||
if (in_array($roles::AGENT, $userRoles) || in_array($roles::COMPANY_ADMIN, $userRoles)) {
|
||||
$items[] = [
|
||||
'route' => 'home',
|
||||
'name' => 'Главная',
|
||||
'icon' => 'columns-gap',
|
||||
];
|
||||
}
|
||||
if (in_array($roles::AGENT, $userRoles) || in_array($roles::COMPANY_ADMIN, $userRoles)) {
|
||||
$items[] = [
|
||||
'route' => 'clients.table',
|
||||
'name' => 'Клиенты',
|
||||
'icon' => 'person',
|
||||
];
|
||||
}
|
||||
if (in_array($roles::AGENT, $userRoles) || in_array($roles::COMPANY_ADMIN, $userRoles)) {
|
||||
/*$items[] = [
|
||||
'route' => 'projects',
|
||||
'name' => 'Проекты',
|
||||
'icon' => 'book',
|
||||
];*/
|
||||
}
|
||||
|
||||
$items[] = [
|
||||
'route' => 'posts',
|
||||
'name' => 'Новости',
|
||||
'icon' => 'layers',
|
||||
];
|
||||
|
||||
if (in_array($roles::COMPANY_ADMIN, $userRoles)) {
|
||||
$items[] = [
|
||||
'route' => 'company.agents.table',
|
||||
'name' => 'Агенты',
|
||||
'icon' => 'people',
|
||||
];
|
||||
}
|
||||
|
||||
$items[] = [
|
||||
'route' => 'docs.index',
|
||||
'name' => 'Документы',
|
||||
'icon' => 'archive',
|
||||
];
|
||||
|
||||
if (in_array($roles::COMPANY_ADMIN, $userRoles)) {
|
||||
$items[] = [
|
||||
'route' => 'company.details',
|
||||
'name' => 'Настройки',
|
||||
'icon' => 'gear',
|
||||
];
|
||||
}
|
||||
|
||||
if (in_array($roles::SUPER_ADMIN, $userRoles)) {
|
||||
$items[] = [
|
||||
'route' => 'admin.index',
|
||||
'name' => 'Админка',
|
||||
'icon' => 'arrow-right-square',
|
||||
];
|
||||
}
|
||||
?>
|
||||
<div>
|
||||
@php($current = Route::currentRouteName())
|
||||
<ul class="nav flex flex-md-column ">
|
||||
@if (in_array($roles::AGENT, $userRoles) || in_array($roles::COMPANY_ADMIN, $userRoles))
|
||||
@foreach ($items as $item)
|
||||
<li class="nav-item text-center m-2">
|
||||
<a href="{{ route('home') }}"
|
||||
class="nav-link d-flex align-items-center gap-2 fs-5 border rounded-4 active" aria-current="page">
|
||||
<i class="bi bi-columns-gap"></i> <span class="d-none d-lg-inline text-truncate">Главная</span>
|
||||
</a>
|
||||
</li>
|
||||
@endif
|
||||
|
||||
@if (in_array($roles::AGENT, $userRoles) || in_array($roles::COMPANY_ADMIN, $userRoles))
|
||||
<li class="nav-item text-center m-2">
|
||||
<a href="{{ route('clients.table') }}"
|
||||
class="nav-link d-flex align-items-center gap-2 fs-5 border rounded-4 active" aria-current="page">
|
||||
<i class="bi bi-person"></i> <span class="d-none d-lg-inline">Клиенты</span>
|
||||
</a>
|
||||
</li>
|
||||
@endif
|
||||
@if (in_array($roles::AGENT, $userRoles) || in_array($roles::COMPANY_ADMIN, $userRoles))
|
||||
<li class="nav-item text-center m-2">
|
||||
<a href="/projects" class="nav-link d-flex align-items-center gap-2 fs-5 border rounded-4 active"
|
||||
<a href="{{ route($item['route']) }}"
|
||||
class="nav-link d-flex align-items-center gap-2 fs-5 border rounded-4
|
||||
@if (Route::currentRouteName() == $item['route']) active @endif"
|
||||
aria-current="page">
|
||||
<i class="bi bi-book"></i> <span class="d-none d-lg-inline">Проекты</span>
|
||||
<i class="bi bi-{{ $item['icon'] }}"></i> <span
|
||||
class="d-none d-lg-inline text-truncate">{{ $item['name'] }}</span>
|
||||
</a>
|
||||
</li>
|
||||
@endif
|
||||
|
||||
<li class="nav-item text-center m-2">
|
||||
<a href="{{ route('posts') }}" class="nav-link d-flex align-items-center gap-2 fs-5 border rounded-4 active"
|
||||
aria-current="page">
|
||||
<i class="bi bi-layers"></i> <span class="d-none d-lg-inline">Новости</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
@if (in_array($roles::COMPANY_ADMIN, $userRoles))
|
||||
<li class="nav-item text-center m-2">
|
||||
<a href="{{ route('company.agents.table') }}"
|
||||
class="nav-link d-flex align-items-center gap-2 fs-5 border rounded-4 active" aria-current="page">
|
||||
<i class="bi bi-people"></i> <span class="d-none d-lg-inline">Агенты</span>
|
||||
</a>
|
||||
</li>
|
||||
@endif
|
||||
|
||||
@if (in_array($roles::COMPANY_ADMIN, $userRoles))
|
||||
<li class="nav-item text-center m-2">
|
||||
<a href="{{ route('company.details') }}"
|
||||
class="nav-link d-flex align-items-center gap-2 fs-5 border rounded-4 active" aria-current="page">
|
||||
<i class="bi bi-gear"></i> <span class="d-none d-lg-inline">Настройки</span>
|
||||
</a>
|
||||
</li>
|
||||
@endif
|
||||
|
||||
<li class="nav-item text-center m-2">
|
||||
<a href="{{ route('docs.index') }}"
|
||||
class="nav-link d-flex align-items-center gap-2 fs-5 border rounded-4 active" aria-current="page">
|
||||
<i class="bi bi-archive"></i> <span class="d-none d-lg-inline">Документы</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
@if (in_array($roles::SUPER_ADMIN, $userRoles))
|
||||
<li class="nav-item text-center m-2">
|
||||
<a href="{{ route('admin.index') }}"
|
||||
class="nav-link d-flex align-items-center gap-2 fs-5 border rounded-4 active" aria-current="page">
|
||||
<i class="bi bi-arrow-right-square"></i> <span class="d-none d-lg-inline">Админка</span>
|
||||
</a>
|
||||
</li>
|
||||
@endif
|
||||
|
||||
|
||||
@endforeach
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user