Merge pull request 'Feat: Add New Asset url' (#8) from shola into main

Reviewed-on: #8
This commit is contained in:
shola 2025-05-06 09:09:34 +07:00
commit 9fd508f5cb
2 changed files with 19 additions and 42 deletions

View File

@ -5,7 +5,7 @@
<div class="container-fluid flex justify-between items-stretch lg:gap-4" id="header_container"> <div class="container-fluid flex justify-between items-stretch lg:gap-4" id="header_container">
<div class="flex gap-1 lg:hidden items-center -ml-1"> <div class="flex gap-1 lg:hidden items-center -ml-1">
<a class="shrink-0" href="{{ url('/') }}"> <a class="shrink-0" href="{{ url('/') }}">
<img class="max-h-[25px] w-full" src="assets/media/app/logo-agi-mini.png" /> <img class="max-h-[25px] w-full" src="{{ asset('assets/media/app/logo-agi-mini.png') }}" />
</a> </a>
<div class="flex items-center"> <div class="flex items-center">
<button class="btn btn-icon btn-light btn-clear btn-sm" data-drawer-toggle="#sidebar"> <button class="btn btn-icon btn-light btn-clear btn-sm" data-drawer-toggle="#sidebar">
@ -97,12 +97,12 @@
data-menu-item-toggle="dropdown" data-menu-item-trigger="click|lg:click"> data-menu-item-toggle="dropdown" data-menu-item-trigger="click|lg:click">
<div class="menu-toggle btn btn-icon rounded-full"> <div class="menu-toggle btn btn-icon rounded-full">
<img alt="" class="size-9 rounded-full border-2 border-success shrink-0" <img alt="" class="size-9 rounded-full border-2 border-success shrink-0"
src="assets/media/avatars/300-2.png" /> src="{{ asset('assets/media/avatars/300-2.png') }}" />
</div> </div>
<div class="menu-dropdown menu-default light:border-gray-300 w-full max-w-[350px]"> <div class="menu-dropdown menu-default light:border-gray-300 w-full max-w-[350px]">
<div class="flex items-start justify-between px-5 py-1.5 gap-1.5"> <div class="flex items-start justify-between px-5 py-1.5 gap-1.5">
<div class="flex items-start gap-2"> <div class="flex items-start gap-2">
<img alt="" class="size-9 rounded-full border-2 border-success" src="assets/media/avatars/300-2.png" /> <img alt="" class="size-9 rounded-full border-2 border-success" src="{{ asset('assets/media/avatars/300-2.png') }}" />
<div class="flex flex-col gap-1.5"> <div class="flex flex-col gap-1.5">
<span class="text-sm text-gray-800 font-semibold leading-none"> <span class="text-sm text-gray-800 font-semibold leading-none">
{{ Auth::user()->name }} {{ Auth::user()->name }}

View File

@ -5,18 +5,17 @@
<div class="sidebar-header hidden lg:flex items-center relative justify-between px-3 lg:px-6 shrink-0" <div class="sidebar-header hidden lg:flex items-center relative justify-between px-3 lg:px-6 shrink-0"
id="sidebar_header"> id="sidebar_header">
<a class="dark:hidden" href="{{ url('/') }}"> <a class="dark:hidden" href="{{ url('/') }}">
<img class="default-logo min-h-[22px] max-w-none" style="height: 53.55px;" src="assets/media/app/logo-agi-croped.png" /> <img class="default-logo min-h-[22px] max-w-none" style="height: 53.55px;" src="{{ asset('assets/media/app/logo-agi-croped.png') }}" />
<img class="small-logo min-h-[22px] max-w-none" style="height: 50px" src="assets/media/app/logo-agi-mini.png" /> <img class="small-logo min-h-[22px] max-w-none" style="height: 50px" src="{{ asset('assets/media/app/logo-agi-mini.png') }}" />
</a> </a>
<a class="light:hidden dark:flex" href="{{ url('/') }}"> <a class="light:hidden dark:flex" href="{{ url('/') }}">
<img class="default-logo min-h-[22px] max-w-none" style="height: 53.55px;" src="assets/media/app/logo-agi-croped.png" /> <img class="default-logo min-h-[22px] max-w-none" style="height: 53.55px;" src="{{ asset('assets/media/app/logo-agi-croped.png') }}" />
<img class="small-logo min-h-[22px] max-w-none" style="height: 50px" src="assets/media/app/logo-agi-mini.png" /> <img class="small-logo min-h-[22px] max-w-none" style="height: 50px" src="{{ asset('assets/media/app/logo-agi-mini.png') }}" />
</a> </a>
<button <button
class="btn btn-icon btn-icon-md size-[30px] rounded-lg border border-gray-200 dark:border-gray-300 bg-light text-gray-500 hover:text-gray-700 toggle absolute left-full top-2/4 -translate-x-2/4 -translate-y-2/4" class="btn btn-icon btn-icon-md size-[30px] rounded-lg border border-gray-200 dark:border-gray-300 bg-light text-gray-500 hover:text-gray-700 toggle absolute left-full top-2/4 -translate-x-2/4 -translate-y-2/4"
data-toggle="body" data-toggle-class="sidebar-collapse" id="sidebar_toggle"> data-toggle="body" data-toggle-class="sidebar-collapse" id="sidebar_toggle">
<i class="ki-filled ki-black-left-line toggle-active:rotate-180 transition-all duration-300"> <i class="ki-filled ki-black-left-line toggle-active:rotate-180 transition-all duration-300"></i>
</i>
</button> </button>
</div> </div>
@ -27,23 +26,18 @@
<div class="menu flex flex-col grow gap-0.5" data-menu="true" data-menu-accordion-expand-all="false" <div class="menu flex flex-col grow gap-0.5" data-menu="true" data-menu-accordion-expand-all="false"
id="sidebar_menu"> id="sidebar_menu">
<a class="menu-item" href="/"> <a class="menu-item" href="/">
<div <div class="menu-link flex items-center grow cursor-pointer border border-transparent gap-[10px] pl-[10px] pr-[10px] py-[6px]" tabindex="0">
class="menu-link flex items-center grow cursor-pointer border border-transparent gap-[10px] pl-[10px] pr-[10px] py-[6px]"
tabindex="0">
<span class="menu-icon items-start text-gray-500 dark:text-gray-400 w-[20px]"> <span class="menu-icon items-start text-gray-500 dark:text-gray-400 w-[20px]">
<i class="ki-filled ki-element-11 text-lg text-primary"></i> <i class="ki-filled ki-element-11 text-lg text-primary"></i>
</span> </span>
<span <span class="menu-title text-sm font-semibold text-gray-700 menu-item-active:text-primary menu-link-hover:!text-primary">
class="menu-title text-sm font-semibold text-gray-700 menu-item-active:text-primary menu-link-hover:!text-primary">
Dashboards Dashboards
</span> </span>
</div> </div>
</a> </a>
@php
// Ensure $menus is defined and is an object
$menus = isset($menus) ? json_decode(json_encode($menus)) : new stdClass;
// Define the order of sections @php
$menus = isset($menus) ? json_decode(json_encode($menus)) : new stdClass;
$sectionOrder = ['main', 'otorisator','laporan', 'master', 'system']; $sectionOrder = ['main', 'otorisator','laporan', 'master', 'system'];
$sectionTitles = [ $sectionTitles = [
'main' => 'Apps', 'main' => 'Apps',
@ -77,9 +71,7 @@
@if(auth()->user()->hasRole($menu->roles)) @if(auth()->user()->hasRole($menu->roles))
@if(isset($menu->sub)) @if(isset($menu->sub))
<div class="menu-item {{ request()->routeIs($menu->path) || request()->routeIs($menu->path.'.*') ? 'show' : '' }}" data-menu-item-toggle="accordion" data-menu-item-trigger="click"> <div class="menu-item {{ request()->routeIs($menu->path) || request()->routeIs($menu->path.'.*') ? 'show' : '' }}" data-menu-item-toggle="accordion" data-menu-item-trigger="click">
<div <div class="menu-link flex items-center grow cursor-pointer border border-transparent gap-[10px] pl-[10px] pr-[10px] py-[6px]" tabindex="0">
class="menu-link flex items-center grow cursor-pointer border border-transparent gap-[10px] pl-[10px] pr-[10px] py-[6px]"
tabindex="0">
<span class="menu-icon items-start text-gray-500 dark:text-gray-400 w-[20px]"> <span class="menu-icon items-start text-gray-500 dark:text-gray-400 w-[20px]">
<i class="{{ $menu->icon ?? 'ki-filled ki-element-11 text-lg' }}"></i> <i class="{{ $menu->icon ?? 'ki-filled ki-element-11 text-lg' }}"></i>
</span> </span>
@ -90,7 +82,6 @@
$words = explode(' ', $title); $words = explode(' ', $title);
$lines = []; $lines = [];
$currentLine = ''; $currentLine = '';
foreach($words as $word) { foreach($words as $word) {
if(strlen($currentLine . ' ' . $word) <= 30 || empty($currentLine)) { if(strlen($currentLine . ' ' . $word) <= 30 || empty($currentLine)) {
$currentLine = empty($currentLine) ? $word : $currentLine . ' ' . $word; $currentLine = empty($currentLine) ? $word : $currentLine . ' ' . $word;
@ -99,11 +90,7 @@
$currentLine = $word; $currentLine = $word;
} }
} }
if(!empty($currentLine)) $lines[] = $currentLine;
if(!empty($currentLine)) {
$lines[] = $currentLine;
}
echo implode('<br>', $lines); echo implode('<br>', $lines);
} else { } else {
echo $title; echo $title;
@ -111,10 +98,8 @@
@endphp @endphp
</span> </span>
<span class="menu-arrow text-gray-400 w-[20px] shrink-0 justify-end ml-1 mr-[-10px]"> <span class="menu-arrow text-gray-400 w-[20px] shrink-0 justify-end ml-1 mr-[-10px]">
<i class="ki-filled ki-plus text-2xs menu-item-show:hidden"> <i class="ki-filled ki-plus text-2xs menu-item-show:hidden"></i>
</i> <i class="ki-filled ki-minus text-2xs hidden menu-item-show:inline-flex"></i>
<i class="ki-filled ki-minus text-2xs hidden menu-item-show:inline-flex">
</i>
</span> </span>
</div> </div>
@if(is_array($menu->sub)) @if(is_array($menu->sub))
@ -124,11 +109,8 @@
<div class="menu-item {{ request()->routeIs($sub->path.'.*') && in_array(request()->route()->getName(), [$sub->path.'.index', $sub->path.'.create', $sub->path.'.edit', $sub->path.'.restore']) ? 'active' : '' }}"> <div class="menu-item {{ request()->routeIs($sub->path.'.*') && in_array(request()->route()->getName(), [$sub->path.'.index', $sub->path.'.create', $sub->path.'.edit', $sub->path.'.restore']) ? 'active' : '' }}">
<a class="menu-link gap-[14px] pl-[10px] pr-[10px] py-[8px] border border-transparent items-center grow menu-item-active:bg-secondary-active dark:menu-item-active:bg-coal-300 dark:menu-item-active:border-gray-100 menu-item-active:rounded-lg hover:bg-secondary-active dark:hover:bg-coal-300 dark:hover:border-gray-100 hover:rounded-lg" <a class="menu-link gap-[14px] pl-[10px] pr-[10px] py-[8px] border border-transparent items-center grow menu-item-active:bg-secondary-active dark:menu-item-active:bg-coal-300 dark:menu-item-active:border-gray-100 menu-item-active:rounded-lg hover:bg-secondary-active dark:hover:bg-coal-300 dark:hover:border-gray-100 hover:rounded-lg"
href="{{ $sub->path ? route($sub->path.'.index') : '' }}" tabindex="0"> href="{{ $sub->path ? route($sub->path.'.index') : '' }}" tabindex="0">
<span <span class="menu-bullet flex w-[6px] relative before:absolute before:top-0 before:size-[6px] before:rounded-full before:-translate-x-1/2 before:-translate-y-1/2 menu-item-active:before:bg-primary menu-item-hover:before:bg-primary"></span>
class="menu-bullet flex w-[6px] relative before:absolute before:top-0 before:size-[6px] before:rounded-full before:-translate-x-1/2 before:-translate-y-1/2 menu-item-active:before:bg-primary menu-item-hover:before:bg-primary"> <span class="menu-title text-2sm font-medium text-gray-700 menu-item-active:text-primary menu-item-active:font-semibold menu-link-hover:!text-primary">
</span>
<span
class="menu-title text-2sm font-medium text-gray-700 menu-item-active:text-primary menu-item-active:font-semibold menu-link-hover:!text-primary">
{{ $sub->title }} {{ $sub->title }}
</span> </span>
</a> </a>
@ -151,7 +133,6 @@
$words = explode(' ', $title); $words = explode(' ', $title);
$lines = []; $lines = [];
$currentLine = ''; $currentLine = '';
foreach($words as $word) { foreach($words as $word) {
if(strlen($currentLine . ' ' . $word) <= 30 || empty($currentLine)) { if(strlen($currentLine . ' ' . $word) <= 30 || empty($currentLine)) {
$currentLine = empty($currentLine) ? $word : $currentLine . ' ' . $word; $currentLine = empty($currentLine) ? $word : $currentLine . ' ' . $word;
@ -160,11 +141,7 @@
$currentLine = $word; $currentLine = $word;
} }
} }
if(!empty($currentLine)) $lines[] = $currentLine;
if(!empty($currentLine)) {
$lines[] = $currentLine;
}
echo implode('<br>', $lines); echo implode('<br>', $lines);
} else { } else {
echo $title; echo $title;