mirror of
https://github.com/10h30/MoveMate.git
synced 2026-06-05 15:07:35 +09:00
Add ToggleComplete for TaskController
This commit is contained in:
@@ -9,18 +9,25 @@
|
||||
<div class="mb-5">
|
||||
<a class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded" href="/task/create">Create new task</a>
|
||||
</div>
|
||||
|
||||
<div class="mb-5">
|
||||
Progress: {{ $completedTasks}} / {{ $totalTasks }} completed.
|
||||
</div>
|
||||
@foreach ($tasks as $task)
|
||||
<div class="block border-2 border-gray-500 p-2">
|
||||
<div><a href="/task/{{ $task->id }}">
|
||||
<h3 class="text-2xl tracking-tight text-blue-800">{{ $task->name }}<h3>
|
||||
</a></div>
|
||||
<div><strong>Where to go:</strong> {{ $task->location }}</div>
|
||||
<div><strong>Time Estimate:</strong> {{ $task->time_estimate }}</div>
|
||||
<div class="flex items-center justify-between">
|
||||
<div>
|
||||
<div><a href="/task/{{ $task->id }}">
|
||||
<h3 class="text-2xl tracking-tight text-blue-800">{{ $task->name }}<h3>
|
||||
</a></div>
|
||||
<div><strong>Where to go:</strong> {{ $task->location }}</div>
|
||||
<div><strong>Time Estimate:</strong> {{ $task->time_estimate }}</div>
|
||||
</div>
|
||||
<div>
|
||||
<p>{{ ($task->completed) ? "Completed" : "" }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
<div class="mt-2">{{$tasks -> links()}}</div>
|
||||
</x-layout>
|
||||
|
||||
$completedCount = Task::where('completed', true)->count();
|
||||
</x-layout>
|
||||
Reference in New Issue
Block a user