Projects/3BIT/winter-semester/IIS/xnecasr00/resources/views/winemaker/dashboard/planned-tasks.blade.php
2026-04-14 19:28:46 +02:00

546 lines
16 KiB
PHP

@extends('layouts.winemaker')
@section('content')
<style>
.section {
background: white;
border-radius: 12px;
padding: 2rem;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
margin-bottom: 2rem;
}
.section-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 1.5rem;
padding-bottom: 1rem;
border-bottom: 2px solid #e2e8f0;
}
.section-title {
font-size: 1.5rem;
font-weight: 700;
color: #2d3748;
display: flex;
align-items: center;
gap: 0.75rem;
}
.section-icon {
width: 32px;
height: 32px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 8px;
background: linear-gradient(135deg, #89b4d9 0%, #a8cce5 100%);
}
.section-icon svg {
width: 18px;
height: 18px;
fill: white;
}
/* Planned Actions Timeline */
.planned-timeline {
position: relative;
}
.planned-item {
display: flex;
gap: 1rem;
margin-bottom: 1.5rem;
position: relative;
}
.planned-item:last-child {
margin-bottom: 0;
}
.planned-item:not(:last-child)::before {
content: '';
position: absolute;
left: 20px;
top: 45px;
bottom: -10px;
width: 2px;
background: #e2e8f0;
}
.planned-icon {
width: 40px;
height: 40px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
border: 3px solid #fff;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
z-index: 1;
background: white;
}
.planned-icon svg {
width: 20px;
height: 20px;
}
.planned-icon.spraying {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.planned-icon.spraying svg {
fill: white;
}
.planned-icon.fertilization {
background: linear-gradient(135deg, #f6ad55 0%, #ed8936 100%);
}
.planned-icon.fertilization svg {
fill: white;
}
.planned-icon.watering {
background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
}
.planned-icon.watering svg {
fill: white;
}
.planned-icon.pruning {
background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}
.planned-icon.pruning svg {
fill: white;
}
.planned-icon.harvest {
background: linear-gradient(135deg, #ed64a6 0%, #d53f8c 100%);
}
.planned-icon.harvest svg {
fill: white;
}
.planned-content {
flex: 1;
background: #f7fafc;
border-radius: 8px;
padding: 1rem;
border: 1px solid #e2e8f0;
}
.planned-content.today {
background: linear-gradient(135deg, #fff5ec 0%, #f7fafc 100%);
border-color: #ed8936;
}
.planned-content.overdue {
background: linear-gradient(135deg, #fff5f5 0%, #f7fafc 100%);
border-color: #f56565;
}
.planned-header {
display: flex;
justify-content: space-between;
align-items: start;
margin-bottom: 0.5rem;
}
.planned-title {
font-size: 1rem;
font-weight: 600;
color: #2d3748;
}
.planned-date {
font-size: 0.875rem;
color: #4a5568;
white-space: nowrap;
font-weight: 600;
display: flex;
align-items: center;
gap: 0.5rem;
}
.date-badge {
display: inline-block;
padding: 0.125rem 0.5rem;
border-radius: 4px;
font-size: 0.75rem;
font-weight: 700;
text-transform: uppercase;
}
.date-badge.today {
background: #fed7aa;
color: #7c2d12;
}
.date-badge.overdue {
background: #fecaca;
color: #7f1d1d;
}
.planned-description {
font-size: 0.95rem;
color: #4a5568;
line-height: 1.5;
}
.planned-meta {
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
margin-top: 0.75rem;
font-size: 0.875rem;
}
.row-badge {
background: white;
color: #4a5568;
padding: 0.25rem 0.625rem;
border-radius: 4px;
font-weight: 500;
border: 1px solid #e2e8f0;
}
/* Activity Timeline */
.activity-timeline {
position: relative;
}
.activity-item {
display: flex;
gap: 1rem;
margin-bottom: 1.5rem;
position: relative;
}
.activity-item:last-child {
margin-bottom: 0;
}
.activity-item:not(:last-child)::before {
content: '';
position: absolute;
left: 20px;
top: 45px;
bottom: -10px;
width: 2px;
background: #e2e8f0;
}
.activity-icon {
width: 40px;
height: 40px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
border: 3px solid #fff;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
z-index: 1;
background: white;
}
.activity-icon svg {
width: 20px;
height: 20px;
}
.activity-icon.spraying {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.activity-icon.spraying svg {
fill: white;
}
.activity-icon.fertilization {
background: linear-gradient(135deg, #f6ad55 0%, #ed8936 100%);
}
.activity-icon.fertilization svg {
fill: white;
}
.activity-icon.watering {
background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
}
.activity-icon.watering svg {
fill: white;
}
.activity-icon.pruning {
background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}
.activity-icon.pruning svg {
fill: white;
}
.activity-icon.harvest {
background: linear-gradient(135deg, #ed64a6 0%, #d53f8c 100%);
}
.activity-icon.harvest svg {
fill: white;
}
.activity-icon.production {
background: linear-gradient(135deg, #f6ad55 0%, #ed8936 100%);
}
.activity-icon.production svg {
fill: white;
}
.activity-icon.sales {
background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}
.activity-icon.sales svg {
fill: white;
}
.activity-content {
flex: 1;
background: #f7fafc;
border-radius: 8px;
padding: 1rem;
border: 1px solid #e2e8f0;
}
.activity-header {
display: flex;
justify-content: space-between;
align-items: start;
margin-bottom: 0.5rem;
}
.activity-title {
font-size: 1rem;
font-weight: 600;
color: #2d3748;
}
.activity-time {
font-size: 0.875rem;
color: #4a5568;
white-space: nowrap;
font-weight: 600;
}
.activity-description {
font-size: 0.95rem;
color: #4a5568;
line-height: 1.5;
}
.activity-meta {
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
margin-top: 0.75rem;
font-size: 0.875rem;
}
.meta-badge {
background: white;
color: #4a5568;
padding: 0.25rem 0.625rem;
border-radius: 4px;
font-weight: 500;
border: 1px solid #e2e8f0;
}
.empty-state {
text-align: center;
padding: 3rem 2rem;
color: #718096;
}
.empty-state svg {
width: 80px;
height: 80px;
margin: 0 auto 1rem;
opacity: 0.3;
fill: #cbd5e0;
}
.empty-state-title {
font-size: 1.25rem;
font-weight: 600;
color: #4a5568;
margin-bottom: 0.5rem;
}
/* Stats cards */
.stats-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 1rem;
margin-bottom: 2rem;
}
.stat-card {
background: white;
border-radius: 12px;
padding: 1.5rem;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
border-top: 4px solid #89b4d9;
}
.stat-label {
font-size: 0.875rem;
color: #718096;
text-transform: uppercase;
letter-spacing: 0.05em;
margin-bottom: 0.5rem;
}
.stat-value {
font-size: 2rem;
font-weight: 700;
color: #2d3748;
}
.stat-description {
font-size: 0.875rem;
color: #a0aec0;
margin-top: 0.25rem;
}
.grid-2 {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 1.5rem;
}
.dashboard-container {
max-width: 900px;
margin: 0 auto;
}
</style>
<div class="page-header" style="text-align: center; margin-bottom: 3rem;">
<h1 class="page-title" style="font-size: 2rem; font-weight: 700; color: #2d3748; margin-bottom: 0.5rem;">
All Planned Tasks
</h1>
<p class="page-subtitle" style="color: #718096; font-size: 1rem; display: flex; align-items: center; gap: 0.5rem; text-align: left;">
<a href="{{ route('winemaker.dashboard') }}" style="color: #89b4d9; text-decoration: none; display: inline-flex; align-items: center; gap: 0.5rem;">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" style="width: 24px; height: 24px; fill: currentColor;">
<path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/>
</svg>
<span style="color: #718096; font-weight: 600;">Back to Dashboard</span>
</a>
</p>
</div>
<div class="dashboard-container">
<!-- Planned Actions Section -->
<div class="section">
<div class="section-header">
<h2 class="section-title">
<div class="section-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path d="M19 3h-4.18C14.4 1.84 13.3 1 12 1c-1.3 0-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm2 14H7v-2h7v2zm3-4H7v-2h10v2zm0-4H7V7h10v2z"/>
</svg>
</div>
All Planned Tasks
</h2>
</div>
@if($allPlannedTasks->isEmpty())
<div class="empty-state">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path d="M19 3h-4.18C14.4 1.84 13.3 1 12 1c-1.3 0-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm2 14H7v-2h7v2zm3-4H7v-2h10v2zm0-4H7V7h10v2z"/>
</svg>
<div class="empty-state-title">No Planned Tasks</div>
<p>You have no planned treatments or harvests.</p>
</div>
@else
<div class="planned-timeline">
@foreach($allPlannedTasks as $task)
@php
$isToday = $task->planned_date->isToday();
$isOverdue = $task->planned_date->isPast() && !$isToday;
$taskType = strtolower($task->type);
@endphp
<div class="planned-item">
<div class="planned-icon {{ $taskType }}">
@if($taskType === 'spraying')
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path d="M3,3V5A2,2 0 0,0 5,7H6V20A1,1 0 0,0 7,21H9A1,1 0 0,0 10,20V7H14V9H12V11H14V13H12V15H14V20A1,1 0 0,0 15,21H17A1,1 0 0,0 18,20V9H19A2,2 0 0,0 21,7V5H3M7,5H9V7H7V5M11,5H13V7H11V5M15,5H17V7H15V5Z"/>
</svg>
@elseif($taskType === 'fertilization')
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path d="M21,16V4H3V16H21M12,6A2,2 0 0,1 14,8A2,2 0 0,1 12,10A2,2 0 0,1 10,8A2,2 0 0,1 12,6M6,9H7.5L7,13H8L8.5,9H10L9.5,13H10.5L11,9H12.5L11.5,13H15.5L15,9H16.5L16,13H17L17.5,9H19L18.5,13C18.5,13 18.5,13.5 18,14H6C5.5,13.5 5.5,13 5.5,13L6,9M3,18V20H21V18H3Z"/>
</svg>
@elseif($taskType === 'watering')
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path d="M12 2c-5.33 4.55-8 8.48-8 11.8 0 4.98 3.8 8.2 8 8.2s8-3.22 8-8.2c0-3.32-2.67-7.25-8-11.8z"/>
</svg>
@elseif($taskType === 'pruning')
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path d="M9.64 7.64c.23-.5.36-1.05.36-1.64 0-2.21-1.79-4-4-4S2 3.79 2 6s1.79 4 4 4c.59 0 1.14-.13 1.64-.36L10 12l-2.36 2.36C7.14 14.13 6.59 14 6 14c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4c0-.59-.13-1.14-.36-1.64L12 14l7 7h3v-1L9.64 7.64zM6 8c-1.1 0-2-.89-2-2s.9-2 2-2 2 .89 2 2-.9 2-2 2zm0 12c-1.1 0-2-.89-2-2s.9-2 2-2 2 .89 2 2-.9 2-2 2zm6-7.5c-.28 0-.5-.22-.5-.5s.22-.5.5-.5.5.22.5.5-.22.5-.5.5zM19 3l-6 6 2 2 7-7V3z"/>
</svg>
@elseif($taskType === 'harvest')
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path d="M17.21 9l-4.38-6.56c-.19-.28-.51-.42-.83-.42-.32 0-.64.14-.83.43L6.79 9H2c-.55 0-1 .45-1 1 0 .09.01.18.04.27l2.54 9.27c.23.84 1 1.46 1.92 1.46h13c.92 0 1.69-.62 1.93-1.46l2.54-9.27L23 10c0-.55-.45-1-1-1h-4.79zM9 9l3-4.4L15 9H9zm3 8c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z"/>
</svg>
@endif
</div>
<div class="planned-content {{ $isToday ? 'today' : ($isOverdue ? 'overdue' : '') }}">
<div class="planned-header">
<div class="planned-title">{{ $task->type }}</div>
<div class="planned-date">
{{ $task->planned_date->format('M j, Y') }}
@if($isToday)
<span class="date-badge today">Today</span>
@elseif($isOverdue)
<span class="date-badge overdue">Overdue</span>
@endif
<a href="{{ route('planned-tasks.edit', $task->planned_task_id) }}"
style="display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; background: white; border: 1px solid #e2e8f0; border-radius: 6px; color: #4a5568; text-decoration: none; margin-left: 0.5rem; transition: all 0.2s;"
title="Edit task"
onmouseover="this.style.background='#f7fafc'; this.style.borderColor='#89b4d9'; this.style.color='#89b4d9';"
onmouseout="this.style.background='white'; this.style.borderColor='#e2e8f0'; this.style.color='#4a5568';">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 14px; height: 14px;">
<path d="M13.586 3.586a2 2 0 112.828 2.828l-.793.793-2.828-2.828.793-.793zM11.379 5.793L3 14.172V17h2.828l8.38-8.379-2.83-2.828z"/>
</svg>
</a>
</div>
</div>
@if($task->note)
<div class="planned-description">{{ $task->note }}</div>
@endif
@if($task->vineyard_rows->isNotEmpty())
<div class="planned-meta">
@foreach($task->vineyard_rows->sortBy('id') as $row)
<span class="row-badge">
Row {{ $row->id }}
</span>
@endforeach
</div>
@endif
</div>
</div>
@endforeach
</div>
@endif
</div>
</div>
@endsection