mirror of
https://github.com/10h30/MoveMate.git
synced 2026-06-05 15:07:35 +09:00
Fix bug: Mark Completed should be shown to loggged in user only
This commit is contained in:
@@ -12,7 +12,7 @@ class TaskController extends Controller
|
|||||||
public function index() {
|
public function index() {
|
||||||
$totalTasks = Task::count(); // Count all tasks
|
$totalTasks = Task::count(); // Count all tasks
|
||||||
$completedTasks = Task::where('completed', true)->count(); // Coun
|
$completedTasks = Task::where('completed', true)->count(); // Coun
|
||||||
$tasks = Task::latest('updated_at')->Paginate(20);
|
$tasks = Task::latest()->Paginate(20);
|
||||||
return view('task.index', compact('tasks','totalTasks','completedTasks'));
|
return view('task.index', compact('tasks','totalTasks','completedTasks'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
<div><strong>Time Estimate:</strong> {{ $task->time_estimate }} hour</div>
|
<div><strong>Time Estimate:</strong> {{ $task->time_estimate }} hour</div>
|
||||||
<div><strong>Category:</strong> {{ $task->category->name }}</div>
|
<div><strong>Category:</strong> {{ $task->category->name }}</div>
|
||||||
<div><strong>Owner:</strong> {{ $task->user->name }}</div>
|
<div><strong>Owner:</strong> {{ $task->user->name }}</div>
|
||||||
|
@auth
|
||||||
<div class="mt-4 mb-4">
|
<div class="mt-4 mb-4">
|
||||||
<form action="/task/{{ $task->id }}/toggle" method="POST" class="d-inline" >
|
<form action="/task/{{ $task->id }}/toggle" method="POST" class="d-inline" >
|
||||||
@csrf
|
@csrf
|
||||||
@@ -19,6 +20,7 @@
|
|||||||
<x-form-button>{{ (! $task->completed) ? 'Mark Completed' : "Greate! You nailed it!" }}</x-form-button>
|
<x-form-button>{{ (! $task->completed) ? 'Mark Completed' : "Greate! You nailed it!" }}</x-form-button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
@endauth
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-5">
|
<div class="mt-5">
|
||||||
<a href="/task/{{ $task->id }}/edit" class="text-sm text-blue-600 dark:text-blue-500 hover:underline">Edit</a>
|
<a href="/task/{{ $task->id }}/edit" class="text-sm text-blue-600 dark:text-blue-500 hover:underline">Edit</a>
|
||||||
|
|||||||
Reference in New Issue
Block a user