feat: initialize Dr-Panel project with patient file number support

This commit is contained in:
SajjadMahmoody
2026-05-06 02:18:23 +03:30
parent f8f174690a
commit 8b84d1780f
460 changed files with 113960 additions and 1 deletions
@@ -0,0 +1,39 @@
@php
$files = $getState() ?? [];
$files = is_array($files) ? array_values(array_filter($files)) : [];
$urls = array_values(array_map(
fn ($path) => \Illuminate\Support\Facades\Storage::disk('public')->url($path),
$files
));
@endphp
@if(count($urls) > 0)
<div class="flex flex-col gap-1.5">
@foreach($urls as $idx => $url)
@php
$filename = basename(parse_url($url, PHP_URL_PATH));
$ext = strtolower(pathinfo($filename, PATHINFO_EXTENSION));
$isVideo = in_array($ext, ['mp4', 'mov', 'avi', 'mkv', 'webm']);
@endphp
<a
href="{{ $url }}"
target="_blank"
download
class="flex items-center gap-2 text-sm text-primary-600 hover:text-primary-800 transition-colors"
>
@if($isVideo)
<svg class="w-4 h-4 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 10l4.553-2.069A1 1 0 0121 8.879V15.12a1 1 0 01-1.447.894L15 14M3 8a2 2 0 012-2h8a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2V8z"/>
</svg>
@else
<svg class="w-4 h-4 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19V6l12-3v13M9 19c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zm12-3c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zM9 10l12-3"/>
</svg>
@endif
<span class="truncate max-w-[180px]">{{ $idx + 1 }}. {{ $filename }}</span>
</a>
@endforeach
</div>
@else
<span class="text-sm text-gray-400">-</span>
@endif
@@ -0,0 +1 @@
@livewire('patient-media-player', ['patientId' => $patientId, 'field' => $field], key('media-' . $patientId . '-' . $field))
@@ -0,0 +1,33 @@
@php
$images = $getState() ?? [];
$images = is_array($images) ? array_values(array_filter($images)) : [];
$urls = array_values(array_map(
fn ($path) => \Illuminate\Support\Facades\Storage::disk('public')->url($path),
$images
));
$group = 'gallery-' . md5(implode(',', $urls));
@endphp
@if(count($urls) > 0)
<div class="grid grid-cols-4 gap-2">
@foreach($urls as $idx => $url)
<div
class="relative cursor-pointer rounded-lg overflow-hidden border border-gray-200 hover:border-primary-400 hover:opacity-80 transition-all shadow-sm group"
style="aspect-ratio:16/9;"
data-lb-group="{{ $group }}"
data-lb-idx="{{ $idx }}"
data-lb-src="{{ $url }}"
>
<img
src="{{ $url }}"
class="w-full h-full object-cover"
alt=""
loading="lazy"
/>
<div class="absolute inset-0 bg-black/0 group-hover:bg-black/20 transition duration-200"></div>
</div>
@endforeach
</div>
@else
<span class="text-sm text-gray-400">-</span>
@endif