vernova/storage/framework/views/98463ca068fc45f46d96fd75afccf591.php
2026-07-26 19:58:27 +03:30

168 lines
12 KiB
PHP

<?php $__env->startSection('content'); ?>
<div class="max-w-3xl mx-auto space-y-6">
<!-- Page Header -->
<div class="flex items-center gap-4">
<a href="<?php echo e(isset($task) ? route('tasks.show', $task) : route('tasks.index')); ?>" class="p-2 text-gray-500 hover:text-gray-900 hover:bg-gray-100 rounded-lg transition-colors">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 19l-7-7m0 0l7-7m-7 7h18"/></svg>
</a>
<h1 class="text-2xl font-bold text-gray-900">
<?php echo e(isset($task) ? __('task.edit_task') : __('task.create_task')); ?>
</h1>
</div>
<!-- Form -->
<form method="POST" action="<?php echo e(isset($task) ? route('tasks.update', $task) : route('tasks.store')); ?>" class="bg-white rounded-xl border border-gray-200 p-6 space-y-5">
<?php echo csrf_field(); ?>
<?php if(isset($task)): ?>
<?php echo method_field('PUT'); ?>
<?php endif; ?>
<div class="grid grid-cols-1 md:grid-cols-2 gap-5">
<!-- Title -->
<div class="md:col-span-2">
<label for="title" class="block text-sm font-medium text-gray-700 mb-1"><?php echo e(__('task.title')); ?> <span class="text-red-500">*</span></label>
<input type="text" id="title" name="title" value="<?php echo e(old('title', $task->title ?? '')); ?>"
class="w-full px-3 py-2 border <?php echo e($errors->has('title') ? 'border-red-500' : 'border-gray-300'); ?> rounded-lg text-sm focus:ring-2 focus:ring-teal-500 focus:border-teal-500"
required>
<?php $__errorArgs = ['title'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><p class="mt-1 text-xs text-red-500"><?php echo e($message); ?></p><?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
</div>
<!-- Project -->
<div>
<label for="project_id" class="block text-sm font-medium text-gray-700 mb-1"><?php echo e(__('task.project')); ?> <span class="text-red-500">*</span></label>
<select id="project_id" 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" required>
<option value=""><?php echo e(__('common.select')); ?></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(old('project_id', $task->project_id ?? $preselectedProject ?? '') == $project->id ? 'selected' : ''); ?>><?php echo e($project->name); ?></option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
<?php $__errorArgs = ['project_id'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><p class="mt-1 text-xs text-red-500"><?php echo e($message); ?></p><?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
</div>
<!-- Assignee -->
<div>
<label for="assignee_id" class="block text-sm font-medium text-gray-700 mb-1"><?php echo e(__('task.assignee')); ?></label>
<select id="assignee_id" 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.select')); ?></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(old('assignee_id', $task->assignee_id ?? '') == $user->id ? 'selected' : ''); ?>><?php echo e($user->name); ?></option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
</div>
<!-- Status -->
<div>
<label for="status" class="block text-sm font-medium text-gray-700 mb-1"><?php echo e(__('task.status')); ?></label>
<select id="status" 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">
<?php $__currentLoopData = $statuses; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $status): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($status); ?>" <?php echo e(old('status', $task->status ?? 'pending') === $status ? 'selected' : ''); ?>><?php echo e(__('task.status_' . $status)); ?></option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
</div>
<!-- Priority -->
<div>
<label for="priority" class="block text-sm font-medium text-gray-700 mb-1"><?php echo e(__('task.priority')); ?></label>
<select id="priority" 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">
<?php $__currentLoopData = $priorities; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $priority): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($priority); ?>" <?php echo e(old('priority', $task->priority ?? 'medium') === $priority ? 'selected' : ''); ?>><?php echo e(__('task.priority_' . $priority)); ?></option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
</div>
<!-- Start Date -->
<div>
<label for="start_date" class="block text-sm font-medium text-gray-700 mb-1"><?php echo e(__('task.start_date')); ?></label>
<?php if (isset($component)) { $__componentOriginal2c7cd37e2e80199b9dbc9a9aa91b96b1 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal2c7cd37e2e80199b9dbc9a9aa91b96b1 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.date-input','data' => ['name' => 'start_date','value' => old('start_date', isset($task) && $task->start_date ? $task->start_date->format('Y-m-d') : '')]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('date-input'); ?>
<?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(['name' => 'start_date','value' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute(old('start_date', isset($task) && $task->start_date ? $task->start_date->format('Y-m-d') : ''))]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal2c7cd37e2e80199b9dbc9a9aa91b96b1)): ?>
<?php $attributes = $__attributesOriginal2c7cd37e2e80199b9dbc9a9aa91b96b1; ?>
<?php unset($__attributesOriginal2c7cd37e2e80199b9dbc9a9aa91b96b1); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal2c7cd37e2e80199b9dbc9a9aa91b96b1)): ?>
<?php $component = $__componentOriginal2c7cd37e2e80199b9dbc9a9aa91b96b1; ?>
<?php unset($__componentOriginal2c7cd37e2e80199b9dbc9a9aa91b96b1); ?>
<?php endif; ?>
</div>
<!-- Due Date -->
<div>
<label for="due_date" class="block text-sm font-medium text-gray-700 mb-1"><?php echo e(__('task.due_date')); ?></label>
<?php if (isset($component)) { $__componentOriginal2c7cd37e2e80199b9dbc9a9aa91b96b1 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal2c7cd37e2e80199b9dbc9a9aa91b96b1 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.date-input','data' => ['name' => 'due_date','value' => old('due_date', isset($task) && $task->due_date ? $task->due_date->format('Y-m-d') : '')]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('date-input'); ?>
<?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(['name' => 'due_date','value' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute(old('due_date', isset($task) && $task->due_date ? $task->due_date->format('Y-m-d') : ''))]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal2c7cd37e2e80199b9dbc9a9aa91b96b1)): ?>
<?php $attributes = $__attributesOriginal2c7cd37e2e80199b9dbc9a9aa91b96b1; ?>
<?php unset($__attributesOriginal2c7cd37e2e80199b9dbc9a9aa91b96b1); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal2c7cd37e2e80199b9dbc9a9aa91b96b1)): ?>
<?php $component = $__componentOriginal2c7cd37e2e80199b9dbc9a9aa91b96b1; ?>
<?php unset($__componentOriginal2c7cd37e2e80199b9dbc9a9aa91b96b1); ?>
<?php endif; ?>
</div>
<!-- Estimated Hours -->
<div>
<label for="estimated_hours" class="block text-sm font-medium text-gray-700 mb-1"><?php echo e(__('task.estimated_hours')); ?></label>
<input type="number" id="estimated_hours" name="estimated_hours" value="<?php echo e(old('estimated_hours', $task->estimated_hours ?? '')); ?>" min="0"
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">
</div>
<!-- Description -->
<div class="md:col-span-2">
<label for="description" class="block text-sm font-medium text-gray-700 mb-1"><?php echo e(__('task.description')); ?></label>
<textarea id="description" name="description" rows="4"
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"><?php echo e(old('description', $task->description ?? '')); ?></textarea>
</div>
</div>
<!-- Actions -->
<div class="flex items-center justify-end gap-3 pt-4 border-t border-gray-200">
<a href="<?php echo e(isset($task) ? route('tasks.show', $task) : route('tasks.index')); ?>" class="px-4 py-2 text-sm font-medium text-gray-700 bg-gray-100 rounded-lg hover:bg-gray-200 transition-colors">
<?php echo e(__('common.cancel')); ?>
</a>
<button type="submit" class="px-6 py-2 text-sm font-medium text-white bg-teal-600 rounded-lg hover:bg-teal-700 transition-colors">
<?php echo e(isset($task) ? __('common.save_changes') : __('common.create')); ?>
</button>
</div>
</form>
</div>
<?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/form.blade.php ENDPATH**/ ?>