Merge pull request #11149 from Godmartinz/gh11129_setting_disclosure_arrow

Fixed #11129 - settings treeview won't stay active.
This commit is contained in:
snipe 2022-05-23 12:55:11 -07:00 committed by GitHub
commit 70344cc02e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 7 deletions

View file

@ -1,7 +1,6 @@
<?php <?php
namespace App\Helpers; namespace App\Helpers;
use App\Models\Accessory; use App\Models\Accessory;
use App\Models\Component; use App\Models\Component;
use App\Models\Consumable; use App\Models\Consumable;
@ -1089,4 +1088,10 @@ class Helper
return $bytes; return $bytes;
} }
public static function SettingUrls(){
$settings=['#','fields.index', 'statuslabels.index', 'models.index', 'categories.index', 'manufacturers.index', 'suppliers.index', 'departments.index', 'locations.index', 'companies.index', 'depreciations.index'];
return $settings;
}
} }

View file

@ -584,8 +584,8 @@
@endcan @endcan
@can('backend.interact') @can('backend.interact')
<li class="treeview"> <li class="treeview {!! in_array(Request::route()->getName(),App\Helpers\Helper::SettingUrls()) ? ' active': '' !!}">
<a href="#"> <a href="#" id="settings" class="">
<i class="fas fa-cog" aria-hidden="true"></i> <i class="fas fa-cog" aria-hidden="true"></i>
<span>{{ trans('general.settings') }}</span> <span>{{ trans('general.settings') }}</span>
<i class="fa fa-angle-left pull-right"></i> <i class="fa fa-angle-left pull-right"></i>
@ -616,7 +616,6 @@
</li> </li>
@endcan @endcan
@can('view', \App\Models\Category::class) @can('view', \App\Models\Category::class)
<li> <li>
<a href="{{ route('categories.index') }}" {{ (Request::is('/categories') ? ' class="active"' : '') }}> <a href="{{ route('categories.index') }}" {{ (Request::is('/categories') ? ' class="active"' : '') }}>
@ -672,9 +671,7 @@
</a> </a>
</li> </li>
@endcan @endcan
</ul> </ul>
</li> </li>
@endcan @endcan