Skip to content

Commit 0bc6b45

Browse files
committed
Add styling to task page (button and details)
1 parent 2223e70 commit 0bc6b45

File tree

2 files changed

+20
-17
lines changed

2 files changed

+20
-17
lines changed

resources/views/layouts/app.blade.php

+5
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
<meta http-equiv="X-UA-Compatible" content="ie=edge">
88
<title>Laravel 10 Task List App</title>
99
<script src="https://cdn.tailwindcss.com"></script>
10+
<style type="text/tailwindcss">
11+
.btn {
12+
@apply rounded-md px-2 py-1 text-center font-medium shadow-sm ring-1 ring-slate-700/10 hover:bg-slate-50 text-slate-700
13+
}
14+
</style>
1015
@yield('styles')
1116
</head>
1217

resources/views/show.blade.php

+15-17
Original file line numberDiff line numberDiff line change
@@ -8,41 +8,39 @@
88
class="font-medium text-gray-700 underline decoration-pink-500">← Go back to the task list!</a>
99
</div>
1010

11-
<p>{{ $task->description }}</p>
11+
<p class="mb-4 text-slate-700">{{ $task->description }}</p>
1212
@if ($task->long_description)
13-
<p>{{ $task->long_description }}</p>
13+
<p class="mb-4 text-slate-700">{{ $task->long_description }}</p>
1414
@endif
1515

16-
<p>{{ $task->created_at }}</p>
17-
<p>{{ $task->updated_at }}</p>
16+
<p class="mb-4 text-sm text-slate-500">Created {{ $task->created_at->diffForHumans() }} · Updated {{ $task->updated_at->diffForHumans() }}</p>
1817

19-
<p>
18+
<p class="mb-4">
2019
@if ($task->completed)
21-
Completed
20+
<span class="font-medium text-green-500">
21+
Completed
22+
</span>
2223
@else
23-
Not completed
24+
<span class="font-medium text-red-500">
25+
Not completed
26+
</span>
2427
@endif
2528
</p>
2629

27-
<div>
28-
<a href="{{ route('tasks.edit', ['task' => $task]) }}">Edit</a>
29-
</div>
30-
31-
<div>
30+
<div class="flex gap-2">
31+
<a href="{{ route('tasks.edit', ['task' => $task]) }}"
32+
class="btn">Edit</a>
3233
<form method="POST" action="{{ route('tasks.toggle-complete', ['task' => $task]) }}">
3334
@csrf
3435
@method('PUT')
35-
<button type="submit">
36+
<button type="submit" class="btn">
3637
Mark as {{ $task->completed ? 'not completed' : 'completed ' }}
3738
</button>
3839
</form>
39-
</div>
40-
41-
<div>
4240
<form action="{{ route('tasks.destroy', ['task' => $task]) }}" method="post">
4341
@csrf
4442
@method('DELETE')
45-
<button type="submit">Delete</button>
43+
<button type="submit" class="btn">Delete</button>
4644
</form>
4745
</div>
4846
@endsection

0 commit comments

Comments
 (0)