* - polishing calendar * wip * wip * #74 - wip * #74 - wip * #74 - wip * #74 - fix icons Co-authored-by: EwelinaLasowy <ewelina.lasowy@blumilk.pl>
This commit is contained in:
@@ -22,20 +22,25 @@ 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", [
|
||||
"calendar" => $calendar,
|
||||
"currentMonth" => $month->value,
|
||||
"current" => Month::current(),
|
||||
"selected" => $month->value,
|
||||
"users" => UserResource::collection($users),
|
||||
"can" => [
|
||||
"generateTimesheet" => $request->user()->can("generateTimesheet"),
|
||||
|
Reference in New Issue
Block a user