añadir funicionalidades de permisos y grupos
This commit is contained in:
@@ -1,21 +1,32 @@
|
||||
@props(['folder', 'level' => 0])
|
||||
@props(['folder', 'currentFolder', 'expandedFolders', 'level' => 0])
|
||||
|
||||
<li class="pl-{{ $level * 4 }} group">
|
||||
<div class="flex items-center justify-between p-2 hover:bg-gray-50 rounded-lg cursor-pointer"
|
||||
wire:click="$emit('folderSelected', {{ $folder->id }})">
|
||||
<div class="flex items-center">
|
||||
<x-icons icon="folder" class="w-5 h-5 mr-2 text-yellow-500" />
|
||||
<span class="text-sm">{{ $folder->name }}</span>
|
||||
<li class="pl-{{ $level * 4 }}">
|
||||
<div class="flex items-center justify-between p-2 hover:bg-gray-50
|
||||
{{ $folder->id === optional($currentFolder)->id ? 'bg-blue-50' : '' }}">
|
||||
<div class="flex items-center flex-1" wire:click="selectFolder({{ $folder->id }})">
|
||||
<button wire:click.prevent="toggleFolder({{ $folder->id }})"
|
||||
class="mr-2">
|
||||
@if(in_array($folder->id, $expandedFolders))
|
||||
<x-icons.chevron-down class="w-4 h-4" />
|
||||
@else
|
||||
<x-icons.chevron-right class="w-4 h-4" />
|
||||
@endif
|
||||
</button>
|
||||
<x-icons.folder class="w-5 h-5 mr-2 text-yellow-500" />
|
||||
<span>{{ $folder->name }}</span>
|
||||
</div>
|
||||
@if($folder->children->isNotEmpty())
|
||||
<x-icons icon="chevron-right" class="w-4 h-4 text-gray-400 transform group-hover:rotate-90 transition-transform" />
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@if($folder->children->isNotEmpty())
|
||||
<ul class="mt-1 space-y-1">
|
||||
@if(in_array($folder->id, $expandedFolders))
|
||||
<ul class="ml-4">
|
||||
@foreach($folder->children as $child)
|
||||
<x-folder-item :folder="$child" :level="$level + 1" />
|
||||
<x-folder-item
|
||||
:folder="$child"
|
||||
:currentFolder="$currentFolder"
|
||||
:expandedFolders="$expandedFolders"
|
||||
:level="$level + 1"
|
||||
wire:key="folder-{{ $child->id }}"
|
||||
/>
|
||||
@endforeach
|
||||
</ul>
|
||||
@endif
|
||||
|
||||
9
resources/views/components/label.blade.php
Normal file
9
resources/views/components/label.blade.php
Normal file
@@ -0,0 +1,9 @@
|
||||
{{-- resources/views/components/label.blade.php --}}
|
||||
@props(['for' => null, 'value' => null])
|
||||
|
||||
<label
|
||||
{{ $attributes->merge(['class' => 'block text-sm font-medium text-gray-700']) }}
|
||||
for="{{ $for }}"
|
||||
>
|
||||
{{ $value ?? $slot }}
|
||||
</label>
|
||||
15
resources/views/components/layouts/livewire-app.blade.php
Normal file
15
resources/views/components/layouts/livewire-app.blade.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>{{ $title ?? 'Proyecto' }}</title>
|
||||
@livewireStyles
|
||||
@vite(['resources/css/app.css', 'resources/js/app.js'])
|
||||
</head>
|
||||
<body>
|
||||
<!-- Integra tu sidebar aquí si es necesario -->
|
||||
<div class="container mx-auto p-4">
|
||||
{{ $slot }}
|
||||
</div>
|
||||
@livewireScripts
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user