diff --git a/app/Infrastructure/Http/Controllers/VacationCalendarController.php b/app/Infrastructure/Http/Controllers/VacationCalendarController.php index 95353b3..c3d72a9 100644 --- a/app/Infrastructure/Http/Controllers/VacationCalendarController.php +++ b/app/Infrastructure/Http/Controllers/VacationCalendarController.php @@ -22,15 +22,19 @@ class VacationCalendarController extends Controller ?string $month = null, ): Response { $month = Month::fromNameOrCurrent((string)$month); + $currentUser = $request->user(); $yearPeriod = $yearPeriodRetriever->selected(); $carbonMonth = Carbon::create($yearPeriod->year, $month->toCarbonNumber()); $users = User::query() + ->where("id", "!=", $currentUser->id) ->orderBy("last_name") ->orderBy("first_name") ->get(); + $users->prepend($currentUser); + $calendar = $calendarGenerator->generate($carbonMonth); return inertia("Calendar", [ diff --git a/resources/js/Pages/Calendar.vue b/resources/js/Pages/Calendar.vue index 4c0ade2..20ae66a 100644 --- a/resources/js/Pages/Calendar.vue +++ b/resources/js/Pages/Calendar.vue @@ -17,7 +17,7 @@
|
@@ -71,7 +71,8 @@
v-for="day in calendar"
:key="day.dayOfMonth"
class="border border-gray-300 text-lg font-semibold text-gray-900 py-4 px-2"
- :class="{ 'text-blumilk-600 bg-blumilk-25 font-black': day.isToday }"
+ style="min-width: 46px;"
+ :class="{ 'bg-red-100 text-red-800': day.isWeekend || day.isHoliday, 'text-blumilk-600 bg-blumilk-25': day.isToday }"
>
{{ day.dayOfMonth }}
@@ -87,7 +88,9 @@
v-for="user in users.data"
:key="user.id"
>
-
+ |
|
-
+
@@ -106,7 +111,7 @@
v-for="day in calendar"
:key="day.dayOfMonth"
class="border border-gray-300"
- :class="{'bg-red-100': day.isWeekend || day.isHoliday, 'bg-blumilk-500': day.vacations.includes(user.id) }"
+ :class="{ 'bg-blumilk-25': day.isToday, 'bg-red-100': day.isWeekend || day.isHoliday, 'bg-blumilk-500': day.vacations.includes(user.id) }"
>
{{ user.name }}
null,
},
+ auth: {
+ type: Object,
+ default: () => null,
+ },
calendar: {
type: Object,
default: () => null,
|
|---|