@extends('admin.layouts.app') @section('title', __('tasks.show_title', ['title' => $task->title])) @section('header', $task->title) @section('breadcrumb') {{ __('tasks.title') }} / {{ Str::limit($task->title, 40) }} @endsection @section('header-actions') ← {{ __('tasks.back') }} @endsection @section('content') @php $priorityMap = [ 'surgos' => ['badge-danger', __('tasks.priority.surgos')], 'magas' => ['badge-warning', __('tasks.priority.magas')], 'kozepes' => ['badge-info', __('tasks.priority.kozepes')], 'alacsony' => ['badge-secondary', __('tasks.priority.alacsony')], ]; $statusMap = [ 'nyitott' => ['badge-secondary', __('tasks.status.nyitott')], 'folyamatban' => ['badge-info', __('tasks.status.folyamatban')], 'kesz' => ['badge-success', __('tasks.status.kesz')], ]; [$priClass, $priLabel] = $priorityMap[$task->priority] ?? ['badge-secondary', $task->priority]; [$stClass, $stLabel] = $statusMap[$task->status] ?? ['badge-secondary', $task->status]; @endphp
{{-- Bal: feladat adatok --}}
{{-- Fejléc kártya --}}
{{ __('tasks.details') }}
{{-- Cím --}}

{{ __('tasks.task_name') }}

{{ $task->title }}

{{-- Leírás --}} @if($task->description)

{{ __('tasks.description') }}

{{ $task->description }}

@endif {{-- Státusz + Prioritás --}}

{{ __('tasks.col_status') }}

@csrf @method('PATCH')

{{ __('tasks.col_priority') }}

{{ $priLabel }}
{{-- Határidő --}}

{{ __('tasks.deadline') }}

@if($task->due_date) {{ $task->due_date->format('Y. m. d.') }} @if($task->isOverdue()) {{ __('tasks.overdue') }} @endif @else @endif
{{-- Felelős --}}

{{ __('tasks.assignee') }}

@if($task->assignedUser)
@if($task->assignedUser->photo)
@else
{{ strtoupper(substr($task->assignedUser->name, 0, 1)) }}
@endif {{ $task->assignedUser->name }}
@else @endif
{{-- Projekt --}}

{{ __('tasks.project') }}

@if($task->project) {{ $task->project->title }} @else @endif
{{-- Létrehozó + dátum --}}

{{ __('tasks.col_creator') }}

{{ $task->creator->name ?? '—' }}

{{ __('common.created_at') }}

{{ $task->created_at->format('Y.m.d H:i') }}
{{-- Csatolmányok --}}
{{ __('tasks.attachments') }} {{ $task->attachments->count() }}
{{-- Feltöltési form --}}
@csrf

{{ __('tasks.attach_hint') }}

@error('file')

{{ $message }}

@enderror
{{-- Csatolmányok listája --}} @if($task->attachments->isEmpty())
{{ __('tasks.attach_none') }}
@else
@foreach($task->attachments as $attachment) @php $ext = strtolower(pathinfo($attachment->filename, PATHINFO_EXTENSION)); $iconColor = match(true) { in_array($ext, ['pdf']) => '#f06548', in_array($ext, ['doc','docx']) => '#405189', in_array($ext, ['xls','xlsx','csv']) => '#0ab39c', in_array($ext, ['ppt','pptx']) => '#f7b84b', in_array($ext, ['jpg','jpeg','png','gif','webp']) => '#7a5af8', in_array($ext, ['zip','rar']) => '#6c757d', default => '#adb5bd', }; @endphp
{{ $ext }}

{{ $attachment->filename }}

{{ $attachment->size_formatted }} · {{ $attachment->user->name ?? '—' }} · {{ $attachment->created_at->format('Y.m.d') }}

{{ __('tasks.attach_download') }}
@csrf @method('DELETE')
@endforeach
@endif
{{-- Jobb: Hozzászólások --}}
{{ __('tasks.comments') }} {{ $task->comments->count() }}
{{-- Komment írás --}}
@csrf @error('body')

{{ $message }}

@enderror
{{-- Kommentek listája --}} @if($task->comments->isEmpty())
{{ __('tasks.comment_none') }}
@else
@foreach($task->comments as $comment)
{{-- Avatar --}} @if($comment->user?->photo)
@else
{{ strtoupper(substr($comment->user->name ?? '?', 0, 1)) }}
@endif
{{ $comment->user->name ?? '—' }} {{ $comment->created_at->diffForHumans() }}
@if($comment->user_id === auth()->id() || auth()->user()->hasAnyRole(['super-admin', 'admin']))
@csrf @method('DELETE')
@endif

{{ $comment->body }}

@endforeach
@endif
@endsection