Add images to tasks

Everyone who may comment on a task sends images to it, e.g. photos
taken with a phone. The server stores an upright, at most 2560 px JPEG
without EXIF data (no location) and a 400 px thumbnail on the private
disk, served only to those who see the job. Uploaders change captions
(also the alt text) and remove their own images; admin and management
may remove anyone's (jobs.remove-any-task-image). Removing a task also
removes its image files.

Livewire's temporary upload limit is raised to PHP's 40 MB so that the
page's own 12 MB limit gives a translated message.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
2026-11-25 07:46:53 +02:00
co-authored by Claude Sonnet 5.5
parent 4fb8ea1c5f
commit ae8172898d
40 changed files with 2250 additions and 8 deletions
@@ -81,9 +81,10 @@ new class extends Component
}
/**
* A task's comments changed: the task cards show their number.
* A task's comments or images changed: the task cards show their number.
*/
#[On('task-comments-changed')]
#[On('task-images-changed')]
public function refreshTasks(): void
{
unset($this->tasks);
@@ -419,6 +420,12 @@ new class extends Component
<dd>{{ $task->commentCount }}</dd>
</div>
@endif
@if ($task->imageCount > 0)
<div class="flex flex-wrap gap-x-1">
<dt class="font-medium">{{ __('jobs.tasks.images.title') }}:</dt>
<dd>{{ $task->imageCount }}</dd>
</div>
@endif
</dl>
</div>
@@ -456,6 +463,8 @@ new class extends Component
<livewire:jobs::task-comments :job-id="$job->id" :task-id="$task->id" :task-title="$task->title" :wire:key="'comments-'.$task->id" />
<livewire:jobs::task-images :job-id="$job->id" :task-id="$task->id" :task-title="$task->title" :wire:key="'images-'.$task->id" />
<div class="flex flex-wrap items-end gap-3">
@if ($canChangeStatus)
<div class="w-full sm:w-56">