- Use x-navigate.preserve-scroll to maintain sidebar scroll position during navigation - Prevents page from scrolling to top after clicking sidebar links - Alpine navigate automatically saves and restores scroll position
33 lines
1.2 KiB
PHP
33 lines
1.2 KiB
PHP
<div class="p-4" x-data="sidebarState()" x-init="initExpandedFolders()">
|
|
<div class="mb-4">
|
|
<h2 class="text-sm font-semibold text-gray-700 uppercase tracking-wider">
|
|
{{ __('messages.documents.title') }}
|
|
</h2>
|
|
</div>
|
|
|
|
@if(empty($tree))
|
|
<div class="text-sm text-gray-500 italic">
|
|
{{ __('messages.documents.no_documents') }}
|
|
</div>
|
|
@else
|
|
<div class="space-y-1">
|
|
@include('partials.tree-item', ['tree' => $tree, 'path' => ''])
|
|
</div>
|
|
@endif
|
|
|
|
@auth
|
|
<div class="mt-6 pt-6 border-t border-gray-200">
|
|
<a
|
|
x-navigate.preserve-scroll
|
|
href="{{ route('documents.create') }}"
|
|
class="flex items-center justify-center px-4 py-2 text-sm font-medium text-white bg-indigo-600 rounded-md hover:bg-indigo-700"
|
|
>
|
|
<svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4"></path>
|
|
</svg>
|
|
{{ __('messages.documents.new_document') }}
|
|
</a>
|
|
</div>
|
|
@endauth
|
|
</div>
|