@extends('layouts.app') @section('title', 'Pazarlama Kanban') @section('content')
Pazarlama / Projeler

Kanban Board

To do, aktif işler ve tamamlanan kayıtları tek ekranda yönetin.

@if ($canManage)
@endif
@forelse ($assignableUsers->take(6) as $member) @php $parts = preg_split('/\s+/', trim((string) ($member->name ?? ''))); $initials = ''; foreach (array_slice(array_filter($parts), 0, 2) as $part) { $initials .= mb_strtoupper(mb_substr($part, 0, 1, 'UTF-8'), 'UTF-8'); } $initials = $initials !== '' ? $initials : 'U'; @endphp {{ $initials }} @empty Üyeler yüklenemedi. @endforelse
Temizle
@if (session('success'))
{{ session('success') }}
@endif @if (session('error'))
{{ session('error') }}
@endif @if (!$ready)
Pazarlama modülü tabloları hazır değil. Lütfen migration çalıştırın.
@else @if ($canManage)
Yeni İş Kaydı
@csrf
Yeni Proje
@csrf
@endif @php $statusMap = [ 'todo' => ['label' => 'To Do', 'class' => 'lane-todo'], 'active' => ['label' => 'In Progress', 'class' => 'lane-active'], 'done' => ['label' => 'Done', 'class' => 'lane-done'], ]; $priorityMap = [ 'low' => ['label' => 'Low', 'class' => 'bg-info'], 'normal' => ['label' => 'Normal', 'class' => 'bg-secondary'], 'high' => ['label' => 'High', 'class' => 'bg-warning text-dark'], 'critical' => ['label' => 'Critical', 'class' => 'bg-danger'], ]; @endphp
@foreach (['todo', 'active', 'done'] as $columnKey) @php $columnTasks = $tasksByStatus->get($columnKey, collect()); $columnCfg = $statusMap[$columnKey]; @endphp
{{ $columnCfg['label'] }}
{{ $columnTasks->count() }}
@forelse ($columnTasks as $task) @php $priorityCfg = $priorityMap[(string) ($task->priority ?? 'normal')] ?? $priorityMap['normal']; $projectColor = trim((string) ($task->project_color ?? '')); $projectStyle = $projectColor !== '' ? 'background-color: ' . e($projectColor) . '; color: #fff;' : ''; $ownerName = trim((string) ($task->owner_name ?? '')); $ownerInitial = $ownerName !== '' ? mb_strtoupper(mb_substr($ownerName, 0, 1, 'UTF-8'), 'UTF-8') : '?'; $searchText = mb_strtolower(trim((string) ($task->title . ' ' . ($task->description ?? '') . ' ' . ($task->project_name ?? '') . ' ' . $ownerName)), 'UTF-8'); $detailData = json_decode((string) ($task->detail_json ?? ''), true); $detailData = is_array($detailData) ? $detailData : []; $detailProgress = isset($detailData['progress_percent']) && $detailData['progress_percent'] !== null ? max(0, min(100, (int) $detailData['progress_percent'])) : null; $modalPayload = [ 'id' => (int) $task->id, 'title' => (string) ($task->title ?? ''), 'description' => (string) ($task->description ?? ''), 'status' => (string) ($task->status ?? 'todo'), 'priority' => (string) ($task->priority ?? 'normal'), 'due_date' => (string) ($task->due_date ?? ''), 'owner_name' => $ownerName, 'project_name' => (string) ($task->project_name ?? ''), 'project_color' => $projectColor, 'status_url' => route('admin.marketing.tasks.status', ['id' => $task->id]), 'details_url' => route('admin.marketing.tasks.details', ['id' => $task->id]), 'delete_url' => route('admin.marketing.tasks.delete', ['id' => $task->id]), 'show_url' => route('admin.marketing.tasks.show', ['id' => $task->id]), 'detail' => $detailData, ]; $modalPayloadJson = json_encode( $modalPayload, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES ); @endphp
{{ $priorityCfg['label'] }} {{ $ownerInitial }}
{{ $task->title }}

{{ $task->description ?: 'Açıklama yok.' }}

{{ $task->project_name }} {{ $task->due_date ?: '-' }} @if ($detailProgress !== null) %{{ $detailProgress }} @endif
@if ($canManage)
@endif
@empty
Bu kolonda kayıt yok.
@endforelse
@endforeach
@endif
@endsection @push('styles') @endpush @push('modals') @endpush @push('scripts') @endpush @push('scripts') @endpush