158 lines
10 KiB
PHP
158 lines
10 KiB
PHP
<?php $__env->startSection('content'); ?>
|
|
<div class="space-y-6">
|
|
<!-- Page Header -->
|
|
<div class="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4">
|
|
<h1 class="text-2xl font-bold text-gray-900"><?php echo e(__('task.tasks')); ?></h1>
|
|
<div class="flex items-center gap-2">
|
|
<a href="<?php echo e(route('tasks.kanban')); ?>" class="px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 transition-colors">
|
|
<?php echo e(__('task.kanban_view')); ?>
|
|
|
|
</a>
|
|
<a href="<?php echo e(route('tasks.create')); ?>" class="inline-flex items-center gap-2 px-4 py-2 bg-teal-600 text-white text-sm font-medium rounded-lg hover:bg-teal-700 transition-colors">
|
|
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4"/></svg>
|
|
<?php echo e(__('task.new')); ?>
|
|
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 4-Filter Bar -->
|
|
<div class="bg-white rounded-xl border border-gray-200 p-4">
|
|
<form method="GET" action="<?php echo e(route('tasks.index')); ?>" class="flex flex-wrap gap-3 items-end">
|
|
<div class="w-44">
|
|
<label class="block text-xs font-medium text-gray-500 mb-1"><?php echo e(__('task.project')); ?></label>
|
|
<select name="project_id" class="w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:ring-2 focus:ring-teal-500 focus:border-teal-500">
|
|
<option value=""><?php echo e(__('common.all')); ?></option>
|
|
<?php $__currentLoopData = $projects; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $project): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
<option value="<?php echo e($project->id); ?>" <?php echo e(request('project_id') == $project->id ? 'selected' : ''); ?>><?php echo e($project->name); ?></option>
|
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
</select>
|
|
</div>
|
|
<div class="w-36">
|
|
<label class="block text-xs font-medium text-gray-500 mb-1"><?php echo e(__('task.status')); ?></label>
|
|
<select name="status" class="w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:ring-2 focus:ring-teal-500 focus:border-teal-500">
|
|
<option value=""><?php echo e(__('common.all')); ?></option>
|
|
<?php $__currentLoopData = $statuses; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $status): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
<option value="<?php echo e($status); ?>" <?php echo e(request('status') === $status ? 'selected' : ''); ?>><?php echo e(__('task.status_' . $status)); ?></option>
|
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
</select>
|
|
</div>
|
|
<div class="w-36">
|
|
<label class="block text-xs font-medium text-gray-500 mb-1"><?php echo e(__('task.priority')); ?></label>
|
|
<select name="priority" class="w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:ring-2 focus:ring-teal-500 focus:border-teal-500">
|
|
<option value=""><?php echo e(__('common.all')); ?></option>
|
|
<?php $__currentLoopData = $priorities; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $priority): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
<option value="<?php echo e($priority); ?>" <?php echo e(request('priority') === $priority ? 'selected' : ''); ?>><?php echo e(__('task.priority_' . $priority)); ?></option>
|
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
</select>
|
|
</div>
|
|
<div class="w-44">
|
|
<label class="block text-xs font-medium text-gray-500 mb-1"><?php echo e(__('task.assignee')); ?></label>
|
|
<select name="assignee_id" class="w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:ring-2 focus:ring-teal-500 focus:border-teal-500">
|
|
<option value=""><?php echo e(__('common.all')); ?></option>
|
|
<?php $__currentLoopData = $users; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $user): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
<option value="<?php echo e($user->id); ?>" <?php echo e(request('assignee_id') == $user->id ? 'selected' : ''); ?>><?php echo e($user->name); ?></option>
|
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
</select>
|
|
</div>
|
|
<button type="submit" class="px-4 py-2 bg-gray-100 text-gray-700 text-sm font-medium rounded-lg hover:bg-gray-200 transition-colors">
|
|
<?php echo e(__('common.filter')); ?>
|
|
|
|
</button>
|
|
<a href="<?php echo e(route('tasks.index')); ?>" class="px-4 py-2 text-gray-500 text-sm hover:text-gray-700"><?php echo e(__('common.reset')); ?></a>
|
|
</form>
|
|
</div>
|
|
|
|
<!-- Task List -->
|
|
<div class="bg-white rounded-xl border border-gray-200">
|
|
<div class="divide-y divide-gray-100">
|
|
<?php $__empty_1 = true; $__currentLoopData = $tasks; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $task): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
|
|
<div class="flex items-center gap-4 px-5 py-4 hover:bg-gray-50 transition-colors">
|
|
<!-- Priority Indicator -->
|
|
<?php if (isset($component)) { $__componentOriginalb3f3930a96171a12366c9551b2dd3c07 = $component; } ?>
|
|
<?php if (isset($attributes)) { $__attributesOriginalb3f3930a96171a12366c9551b2dd3c07 = $attributes; } ?>
|
|
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.priority-badge','data' => ['priority' => $task->priority]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
|
|
<?php $component->withName('priority-badge'); ?>
|
|
<?php if ($component->shouldRender()): ?>
|
|
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
|
|
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
|
|
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
|
|
<?php endif; ?>
|
|
<?php $component->withAttributes(['priority' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($task->priority)]); ?>
|
|
<?php echo $__env->renderComponent(); ?>
|
|
<?php endif; ?>
|
|
<?php if (isset($__attributesOriginalb3f3930a96171a12366c9551b2dd3c07)): ?>
|
|
<?php $attributes = $__attributesOriginalb3f3930a96171a12366c9551b2dd3c07; ?>
|
|
<?php unset($__attributesOriginalb3f3930a96171a12366c9551b2dd3c07); ?>
|
|
<?php endif; ?>
|
|
<?php if (isset($__componentOriginalb3f3930a96171a12366c9551b2dd3c07)): ?>
|
|
<?php $component = $__componentOriginalb3f3930a96171a12366c9551b2dd3c07; ?>
|
|
<?php unset($__componentOriginalb3f3930a96171a12366c9551b2dd3c07); ?>
|
|
<?php endif; ?>
|
|
|
|
<!-- Task Info -->
|
|
<div class="flex-1 min-w-0">
|
|
<a href="<?php echo e(route('tasks.show', $task)); ?>" class="text-sm font-medium text-gray-900 hover:text-teal-600"><?php echo e($task->title); ?></a>
|
|
<div class="flex items-center gap-2 mt-0.5 text-xs text-gray-500">
|
|
<span><?php echo e($task->project?->name); ?></span>
|
|
<?php if($task->due_date): ?>
|
|
<span>•</span>
|
|
<span><?php echo e(calendar_date($task->due_date)); ?></span>
|
|
<?php endif; ?>
|
|
<?php if($task->assignee): ?>
|
|
<span>•</span>
|
|
<span><?php echo e($task->assignee->name); ?></span>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Quick Status Change -->
|
|
<select onchange="updateTaskStatus(<?php echo e($task->id); ?>, this.value)"
|
|
class="px-2 py-1 text-xs border border-gray-200 rounded-lg focus:ring-2 focus:ring-teal-500 bg-white">
|
|
<?php $__currentLoopData = $statuses; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $s): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
<option value="<?php echo e($s); ?>" <?php echo e($task->status === $s ? 'selected' : ''); ?>><?php echo e(__('task.status_' . $s)); ?></option>
|
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
</select>
|
|
</div>
|
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
|
|
<div class="text-center py-12">
|
|
<svg class="w-12 h-12 mx-auto text-gray-300" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"/></svg>
|
|
<p class="mt-2 text-gray-500"><?php echo e(__('task.no_tasks')); ?></p>
|
|
</div>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Pagination -->
|
|
<div class="flex justify-center">
|
|
<?php echo e($tasks->withQueryString()->links()); ?>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<?php $__env->startPush('scripts'); ?>
|
|
<script>
|
|
async function updateTaskStatus(taskId, status) {
|
|
try {
|
|
const response = await fetch(`/tasks/${taskId}/status`, {
|
|
method: 'PUT',
|
|
headers: {
|
|
'Content-Type': 'application/json',
|
|
'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]').content,
|
|
'Accept': 'application/json',
|
|
},
|
|
body: JSON.stringify({ status })
|
|
});
|
|
const data = await response.json();
|
|
if (data.success) {
|
|
// Optionally show a toast
|
|
}
|
|
} catch (e) {
|
|
console.error(e);
|
|
}
|
|
}
|
|
</script>
|
|
<?php $__env->stopPush(); ?>
|
|
<?php $__env->stopSection(); ?>
|
|
|
|
<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\xampp\htdocs\projectra\resources\views/tasks/index.blade.php ENDPATH**/ ?>
|