#22 - vacation calendar #51

Merged
Baakoma merged 31 commits from #22-vacation-calendar into main 2022-02-15 15:08:26 +01:00
9 changed files with 918 additions and 958 deletions
Showing only changes of commit 79d86b2491 - Show all commits

View File

@@ -64,19 +64,4 @@ class HolidayController extends Controller
->route("holidays.index") ->route("holidays.index")
->with("success", __("Holiday has been deleted")); ->with("success", __("Holiday has been deleted"));
} }
public function showCalendar(): Response
{
$users = User::query()
->withTrashed()
->orderBy("last_name")
->orderBy("first_name")
->paginate()
->withQueryString();
return inertia("Holidays/Calendar", [
"users" => UserResource::collection($users),
]);
}
} }

View File

@@ -0,0 +1,24 @@
<?php
declare(strict_types=1);
namespace Toby\Infrastructure\Http\Controllers;
use Inertia\Response;
use Toby\Eloquent\Models\User;
use Toby\Infrastructure\Http\Resources\UserResource;
class VacationCalendarController extends Controller
{
public function index(): Response
{
$users = User::query()
->orderBy("last_name")
->orderBy("first_name")
->paginate();
return inertia("Calendar", [
"users" => UserResource::collection($users),
]);
}
}

View File

@@ -20,15 +20,19 @@ class VacationRequestController extends Controller
{ {
public function index(Request $request): Response public function index(Request $request): Response
{ {
$status = $request->get("status", "all");
$vacationRequests = $request->user() $vacationRequests = $request->user()
->vacationRequests() ->vacationRequests()
->latest() ->latest()
->states(VacationRequestState::filterByStatus($request->query("status", "all"))) ->states(VacationRequestState::filterByStatus($status))
->paginate(); ->paginate();
return inertia("VacationRequest/Index", [ return inertia("VacationRequest/Index", [
"requests" => VacationRequestResource::collection($vacationRequests), "requests" => VacationRequestResource::collection($vacationRequests),
"filters" => $request->only("status"), "filters" => [
"status" => $status,
],
]); ]);
} }

View File

@@ -0,0 +1,130 @@
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
<template>
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
<InertiaHead title="Kalendarz urlopów" />
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
<div class="bg-white sm:rounded-lg shadow-md">
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
<div class="p-4 sm:px-6">
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
<h2 class="text-lg leading-6 font-medium text-gray-900">
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
Kalendarz urlopów
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
</h2>
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
</div>
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
<div class="overflow-x-auto">
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
<table class="w-full text-center border border-gray-300">
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
<thead>
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
<tr>
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
<th class="w-64 py-2 border border-gray-300">
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
<Menu
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
as="div"
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
class="relative inline-block text-left"
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
>
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
<div>
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
<MenuButton
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
class="inline-flex justify-center w-full rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-100 focus:ring-blumilk-500"
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
>
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
Styczeń
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
<ChevronDownIcon
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
class="-mr-1 ml-2 h-5 w-5"
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
aria-hidden="true"
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
/>
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
</MenuButton>
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
</div>
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
<transition
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
enter-active-class="transition ease-out duration-100"
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
enter-from-class="transform opacity-0 scale-95"
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
enter-to-class="transform opacity-100 scale-100"
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
leave-active-class="transition ease-in duration-75"
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
leave-from-class="transform opacity-100 scale-100"
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
leave-to-class="transform opacity-0 scale-95"
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
>
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
<MenuItems
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
class="origin-top-right absolute right-0 mt-2 w-56 rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5 focus:outline-none"
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
>
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
<div class="py-1">
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
<MenuItem>
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
<a
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
href="#"
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
class="text-gray-900 block px-4 py-2 text-sm"
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
>Styczeń</a>
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
</MenuItem>
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
<MenuItem>
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
<a
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
href="#"
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
class="text-gray-900 block px-4 py-2 text-sm"
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
>Luty</a>
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
</MenuItem>
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
<MenuItem>
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
<a
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
href="#"
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
class="text-gray-900 block px-4 py-2 text-sm"
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
>Marzec</a>
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
</MenuItem>
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
</div>
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
</MenuItems>
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
</transition>
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
</Menu>
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
</th>
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
<th
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
v-for="i in 31"
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
:key="i"
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
class="border border-gray-300 font-semibold text-gray-900 py-4 px-2 bg-gray-50"
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
>
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
{{ i }}
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
<p class="text-gray-800 font-normal mt-1">
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
Pt
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
</p>
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
</th>
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
</tr>
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
</thead>
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
<tbody>
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
<tr
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
v-for="user in users.data"
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
:key="user.id"
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
>
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
<th class="border border-gray-300 py-2 px-4">
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
<div class="flex justify-start items-center">
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
<span class="inline-flex items-center justify-center h-10 w-10 rounded-full">
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
<img
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
class="h-10 w-10 rounded-full"
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
:src="user.avatar"
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
alt=""
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
>
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
</span>
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
<div class="ml-3">
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
<div class="text-sm font-medium text-gray-900">
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
{{ user.name }}
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
</div>
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
</div>
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
</div>
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
</th>
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
<td
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
v-for="i in 31"
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
:key="i"
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
class="border border-gray-300 bg-blumilk-25"
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
/>
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
</tr>
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
</tbody>
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
</table>
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
</div>
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
</div>
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
</template>
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
<script>
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
import {Menu, MenuButton, MenuItem, MenuItems} from '@headlessui/vue'
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
import {ChevronDownIcon} from '@heroicons/vue/solid'
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
export default {
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
name: 'VacationCalendar',
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
components: {
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
Menu,
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
MenuButton,
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
MenuItem,
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
MenuItems,
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
ChevronDownIcon,
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
},
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
props: {
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
users: {
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
type: Object,
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
default: () => null,
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
},
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
},
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
}
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?
</script>
krzysztofrewak commented 2022-02-15 12:44:36 +01:00 (Migrated from github.com)
Review

Maybe you could move to another file?

Maybe you could move to another file?

View File

@@ -1,467 +1,374 @@
<template> <template>
<InertiaHead title="Strona główna" /> <InertiaHead title="Strona główna" />
<div class="grid grid-cols-1 gap-4 items-start lg:grid-cols-3 lg:gap-8"> <div class="grid grid-cols-1 gap-4 items-start lg:grid-cols-3 lg:gap-8">
<!-- Left column --> <!-- Left column -->
<div class="grid grid-cols-1 gap-4 lg:col-span-2"> <div class="grid grid-cols-1 gap-4 lg:col-span-2">
<!-- Welcome panel --> <!-- Welcome panel -->
<section aria-labelledby="profile-overview-title"> <section aria-labelledby="profile-overview-title">
<div class="rounded-lg bg-white overflow-hidden shadow"> <div class="rounded-lg bg-white overflow-hidden shadow">
<h2 <h2
id="profile-overview-title" id="profile-overview-title"
class="sr-only" class="sr-only"
> >
Profile Overview Profile Overview
</h2> </h2>
<div class="bg-white p-6"> <div class="bg-white p-6">
<div class="sm:flex sm:items-center sm:justify-between"> <div class="sm:flex sm:items-center sm:justify-between">
<div class="sm:flex sm:space-x-5"> <div class="sm:flex sm:space-x-5">
<div class="flex-shrink-0"> <div class="flex-shrink-0">
<img <img
class="mx-auto h-20 w-20 rounded-full" class="mx-auto h-20 w-20 rounded-full"
:src="user.avatar" :src="user.avatar"
alt="" alt=""
> >
</div>
<div class="mt-4 text-center sm:mt-0 sm:pt-1 sm:text-left">
<p class="text-sm font-medium text-gray-600">
Welcome back,
</p>
<p class="text-xl font-bold text-gray-900 sm:text-2xl">
{{ user.name }}
</p>
<p class="text-sm font-medium text-gray-600">
{{ user.role }}
</p>
</div>
</div>
<div class="mt-5 flex justify-center sm:mt-0">
<InertiaLink
href="#"
class="inline-flex items-center px-4 py-3 border border-transparent text-sm leading-4 font-medium rounded-md shadow-sm text-white bg-blumilk-600 hover:bg-blumilk-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blumilk-500"
>
View profile
</InertiaLink>
</div>
</div>
</div>
<div
class="border-t border-gray-200 bg-gray-50 grid grid-cols-1 divide-y divide-gray-200 sm:grid-cols-3 sm:divide-y-0 sm:divide-x"
>
<div
v-for="stat in stats"
:key="stat.label"
class="px-6 py-5 text-sm font-medium text-center"
>
<span class="text-gray-900">{{ stat.value }}</span>
{{ ' ' }}
<span class="text-gray-600">{{ stat.label }}</span>
</div>
</div>
</div> </div>
</section> <div class="mt-4 text-center sm:mt-0 sm:pt-1 sm:text-left">
<p class="text-sm font-medium text-gray-600">
<!-- Actions panel --> Welcome back,
<section aria-labelledby="quick-links-title"> </p>
<div <p class="text-xl font-bold text-gray-900 sm:text-2xl">
class="rounded-lg bg-gray-200 overflow-hidden shadow divide-y divide-gray-200 sm:divide-y-0 sm:grid sm:grid-cols-2 sm:gap-px" {{ user.name }}
</p>
<p class="text-sm font-medium text-gray-600">
{{ user.role }}
</p>
</div>
</div>
<div class="mt-5 flex justify-center sm:mt-0">
<InertiaLink
href="#"
class="inline-flex items-center px-4 py-3 border border-transparent text-sm leading-4 font-medium rounded-md shadow-sm text-white bg-blumilk-600 hover:bg-blumilk-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blumilk-500"
> >
<h2 View profile
id="quick-links-title" </InertiaLink>
class="sr-only" </div>
> </div>
Quick links </div>
</h2> <div
<div class="border-t border-gray-200 bg-gray-50 grid grid-cols-1 divide-y divide-gray-200 sm:grid-cols-3 sm:divide-y-0 sm:divide-x"
v-for="(action, actionIdx) in actions" >
:key="action.name" <div
:class="[actionIdx === 0 ? 'rounded-tl-lg rounded-tr-lg sm:rounded-tr-none' : '', actionIdx === 1 ? 'sm:rounded-tr-lg' : '', actionIdx === actions.length - 2 ? 'sm:rounded-bl-lg' : '', actionIdx === actions.length - 1 ? 'rounded-bl-lg rounded-br-lg sm:rounded-bl-none' : '', 'relative group bg-white p-6 focus-within:ring-2 focus-within:ring-inset focus-within:ring-cyan-500']" v-for="stat in stats"
> :key="stat.label"
<div> class="px-6 py-5 text-sm font-medium text-center"
<span >
:class="[action.iconBackground, action.iconForeground, 'rounded-lg inline-flex p-3 ring-4 ring-white']" <span class="text-gray-900">{{ stat.value }}</span>
> {{ ' ' }}
<component <span class="text-gray-600">{{ stat.label }}</span>
:is="action.icon" </div>
class="h-6 w-6" </div>
aria-hidden="true"
/>
</span>
</div>
<div class="mt-8">
<h3 class="text-lg font-medium">
<InertiaLink
:href="action.href"
class="focus:outline-none"
>
<!-- Extend touch target to entire panel -->
<span
class="absolute inset-0"
aria-hidden="true"
/>
{{ action.name }}
</InertiaLink>
</h3>
<p class="mt-2 text-sm text-gray-500">
Doloribus dolores nostrum quia qui natus officia quod et dolorem. Sit
repellendus qui ut at blanditiis et quo et molestiae.
</p>
</div>
<span
class="pointer-events-none absolute top-6 right-6 text-gray-300 group-hover:text-gray-400"
aria-hidden="true"
>
<svg
class="h-6 w-6"
xmlns="http://www.w3.org/2000/svg"
fill="currentColor"
viewBox="0 0 24 24"
>
<path
d="M20 4h1a1 1 0 00-1-1v1zm-1 12a1 1 0 102 0h-2zM8 3a1 1 0 000 2V3zM3.293 19.293a1 1 0 101.414 1.414l-1.414-1.414zM19 4v12h2V4h-2zm1-1H8v2h12V3zm-.707.293l-16 16 1.414 1.414 16-16-1.414-1.414z"
/>
</svg>
</span>
</div>
</div>
</section>
</div> </div>
</section>
<!-- Right column --> <!-- Actions panel -->
<div class="grid grid-cols-1 gap-4"> <section aria-labelledby="quick-links-title">
<!-- Announcements --> <div
<section aria-labelledby="announcements-title"> class="rounded-lg bg-gray-200 overflow-hidden shadow divide-y divide-gray-200 sm:divide-y-0 sm:grid sm:grid-cols-2 sm:gap-px"
<div class="rounded-lg bg-white overflow-hidden shadow"> >
<div class="p-6"> <h2
<h2 id="quick-links-title"
id="announcements-title" class="sr-only"
class="text-base font-medium text-gray-900" >
> Quick links
Announcements </h2>
</h2> <div
<div class="flow-root mt-6"> v-for="(action, actionIdx) in actions"
<ul :key="action.name"
role="list" :class="[actionIdx === 0 ? 'rounded-tl-lg rounded-tr-lg sm:rounded-tr-none' : '', actionIdx === 1 ? 'sm:rounded-tr-lg' : '', actionIdx === actions.length - 2 ? 'sm:rounded-bl-lg' : '', actionIdx === actions.length - 1 ? 'rounded-bl-lg rounded-br-lg sm:rounded-bl-none' : '', 'relative group bg-white p-6 focus-within:ring-2 focus-within:ring-inset focus-within:ring-cyan-500']"
class="-my-5 divide-y divide-gray-200" >
> <div>
<li <span
v-for="announcement in announcements" :class="[action.iconBackground, action.iconForeground, 'rounded-lg inline-flex p-3 ring-4 ring-white']"
:key="announcement.id" >
class="py-5" <component
> :is="action.icon"
<div class="relative focus-within:ring-2 focus-within:ring-cyan-500"> class="h-6 w-6"
<h3 class="text-sm font-semibold text-gray-800"> aria-hidden="true"
<InertiaLink />
:href="announcement.href" </span>
class="hover:underline focus:outline-none" </div>
> <div class="mt-8">
<!-- Extend touch target to entire panel --> <h3 class="text-lg font-medium">
<span <InertiaLink
class="absolute inset-0" :href="action.href"
aria-hidden="true" class="focus:outline-none"
/> >
{{ announcement.title }} <!-- Extend touch target to entire panel -->
</InertiaLink> <span
</h3> class="absolute inset-0"
<p class="mt-1 text-sm text-gray-600 line-clamp-2"> aria-hidden="true"
{{ announcement.preview }} />
</p> {{ action.name }}
</div> </InertiaLink>
</li> </h3>
</ul> <p class="mt-2 text-sm text-gray-500">
</div> Doloribus dolores nostrum quia qui natus officia quod et dolorem. Sit
<div class="mt-6"> repellendus qui ut at blanditiis et quo et molestiae.
<InertiaLink </p>
href="#" </div>
class="w-full flex justify-center items-center px-4 py-2 border border-gray-300 shadow-sm text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50" <span
> class="pointer-events-none absolute top-6 right-6 text-gray-300 group-hover:text-gray-400"
View all aria-hidden="true"
</InertiaLink> >
</div> <svg
</div> class="h-6 w-6"
</div> xmlns="http://www.w3.org/2000/svg"
</section> fill="currentColor"
viewBox="0 0 24 24"
<!-- Recent Hires --> >
<section aria-labelledby="recent-hires-title"> <path
<div class="rounded-lg bg-white overflow-hidden shadow"> d="M20 4h1a1 1 0 00-1-1v1zm-1 12a1 1 0 102 0h-2zM8 3a1 1 0 000 2V3zM3.293 19.293a1 1 0 101.414 1.414l-1.414-1.414zM19 4v12h2V4h-2zm1-1H8v2h12V3zm-.707.293l-16 16 1.414 1.414 16-16-1.414-1.414z"
<div class="p-6"> />
<h2 </svg>
id="recent-hires-title" </span>
class="text-base font-medium text-gray-900" </div>
>
Recent Hires
</h2>
<div class="flow-root mt-6">
<ul
role="list"
class="-my-5 divide-y divide-gray-200"
>
<li
v-for="person in recentHires"
:key="person.handle"
class="py-4"
>
<div class="flex items-center space-x-4">
<div class="flex-shrink-0">
<img
class="h-8 w-8 rounded-full"
:src="person.imageUrl"
alt=""
>
</div>
<div class="flex-1 min-w-0">
<p class="text-sm font-medium text-gray-900 truncate">
{{ person.name }}
</p>
<p class="text-sm text-gray-500 truncate">
{{ '@' + person.handle }}
</p>
</div>
<div>
<InertiaLink
:href="person.href"
class="inline-flex items-center shadow-sm px-2.5 py-0.5 border border-gray-300 text-sm leading-5 font-medium rounded-full text-gray-700 bg-white hover:bg-gray-50"
>
View
</InertiaLink>
</div>
</div>
</li>
</ul>
</div>
<div class="mt-6">
<InertiaLink
href="#"
class="w-full flex justify-center items-center px-4 py-2 border border-gray-300 shadow-sm text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50"
>
View all
</InertiaLink>
</div>
</div>
</div>
</section>
</div> </div>
</section>
</div> </div>
<!-- Right column -->
<div class="grid grid-cols-1 gap-4">
<!-- Announcements -->
<section aria-labelledby="announcements-title">
<div class="rounded-lg bg-white overflow-hidden shadow">
<div class="p-6">
<h2
id="announcements-title"
class="text-base font-medium text-gray-900"
>
Announcements
</h2>
<div class="flow-root mt-6">
<ul
role="list"
class="-my-5 divide-y divide-gray-200"
>
<li
v-for="announcement in announcements"
:key="announcement.id"
class="py-5"
>
<div class="relative focus-within:ring-2 focus-within:ring-cyan-500">
<h3 class="text-sm font-semibold text-gray-800">
<InertiaLink
:href="announcement.href"
class="hover:underline focus:outline-none"
>
<!-- Extend touch target to entire panel -->
<span
class="absolute inset-0"
aria-hidden="true"
/>
{{ announcement.title }}
</InertiaLink>
</h3>
<p class="mt-1 text-sm text-gray-600 line-clamp-2">
{{ announcement.preview }}
</p>
</div>
</li>
</ul>
</div>
<div class="mt-6">
<InertiaLink
href="#"
class="w-full flex justify-center items-center px-4 py-2 border border-gray-300 shadow-sm text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50"
>
View all
</InertiaLink>
</div>
</div>
</div>
</section>
<!-- Recent Hires -->
<section aria-labelledby="recent-hires-title">
<div class="rounded-lg bg-white overflow-hidden shadow">
<div class="p-6">
<h2
id="recent-hires-title"
class="text-base font-medium text-gray-900"
>
Recent Hires
</h2>
<div class="flow-root mt-6">
<ul
role="list"
class="-my-5 divide-y divide-gray-200"
>
<li
v-for="person in recentHires"
:key="person.handle"
class="py-4"
>
<div class="flex items-center space-x-4">
<div class="flex-shrink-0">
<img
class="h-8 w-8 rounded-full"
:src="person.imageUrl"
alt=""
>
</div>
<div class="flex-1 min-w-0">
<p class="text-sm font-medium text-gray-900 truncate">
{{ person.name }}
</p>
<p class="text-sm text-gray-500 truncate">
{{ '@' + person.handle }}
</p>
</div>
<div>
<InertiaLink
:href="person.href"
class="inline-flex items-center shadow-sm px-2.5 py-0.5 border border-gray-300 text-sm leading-5 font-medium rounded-full text-gray-700 bg-white hover:bg-gray-50"
>
View
</InertiaLink>
</div>
</div>
</li>
</ul>
</div>
<div class="mt-6">
<InertiaLink
href="#"
class="w-full flex justify-center items-center px-4 py-2 border border-gray-300 shadow-sm text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50"
>
View all
</InertiaLink>
</div>
</div>
</div>
</section>
</div>
</div>
</template> </template>
<script> <script>
import { import {
AcademicCapIcon, AcademicCapIcon,
BadgeCheckIcon, BadgeCheckIcon,
CashIcon, CashIcon,
ClockIcon, ClockIcon,
ReceiptRefundIcon, ReceiptRefundIcon,
UsersIcon, UsersIcon,
} from '@heroicons/vue/outline'; } from '@heroicons/vue/outline'
import {computed} from 'vue'; import {computed} from 'vue'
import {usePage} from '@inertiajs/inertia-vue3'; import {usePage} from '@inertiajs/inertia-vue3'
export default { export default {
name: 'Dashboard', name: 'Dashboard',
setup() { setup() {
const user = computed(() => usePage().props.value.auth.user); const user = computed(() => usePage().props.value.auth.user)
const stats = [ const stats = [
{label: 'Vacation days left', value: 12}, {label: 'Vacation days left', value: 12},
{label: 'Sick days left', value: 4}, {label: 'Sick days left', value: 4},
{label: 'Personal days left', value: 2}, {label: 'Personal days left', value: 2},
]; ]
const actions = [ const actions = [
{ {
icon: ClockIcon, icon: ClockIcon,
name: 'Request time off', name: 'Request time off',
href: '#', href: '#',
iconForeground: 'text-teal-700', iconForeground: 'text-teal-700',
iconBackground: 'bg-teal-50', iconBackground: 'bg-teal-50',
}, },
{ {
icon: BadgeCheckIcon, icon: BadgeCheckIcon,
name: 'Benefits', name: 'Benefits',
href: '#', href: '#',
iconForeground: 'text-purple-700', iconForeground: 'text-purple-700',
iconBackground: 'bg-purple-50', iconBackground: 'bg-purple-50',
}, },
{ {
icon: UsersIcon, icon: UsersIcon,
name: 'Schedule a one-on-one', name: 'Schedule a one-on-one',
href: '#', href: '#',
iconForeground: 'text-sky-700', iconForeground: 'text-sky-700',
iconBackground: 'bg-sky-50', iconBackground: 'bg-sky-50',
}, },
{ {
icon: CashIcon, icon: CashIcon,
name: 'Payroll', name: 'Payroll',
href: '#', href: '#',
iconForeground: 'text-yellow-700', iconForeground: 'text-yellow-700',
iconBackground: 'bg-yellow-50', iconBackground: 'bg-yellow-50',
}, },
{ {
icon: ReceiptRefundIcon, icon: ReceiptRefundIcon,
name: 'Submit an expense', name: 'Submit an expense',
href: '#', href: '#',
iconForeground: 'text-rose-700', iconForeground: 'text-rose-700',
iconBackground: 'bg-rose-50', iconBackground: 'bg-rose-50',
}, },
{ {
icon: AcademicCapIcon, icon: AcademicCapIcon,
name: 'Training', name: 'Training',
href: '#', href: '#',
iconForeground: 'text-indigo-700', iconForeground: 'text-indigo-700',
iconBackground: 'bg-indigo-50', iconBackground: 'bg-indigo-50',
}, },
]; ]
const recentHires = [ const recentHires = [
{ {
name: 'Leonard Krasner', name: 'Leonard Krasner',
handle: 'leonardkrasner', handle: 'leonardkrasner',
imageUrl: imageUrl:
'https://images.unsplash.com/photo-1519345182560-3f2917c472ef?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80', 'https://images.unsplash.com/photo-1519345182560-3f2917c472ef?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80',
href: '#', href: '#',
}, },
{ {
name: 'Floyd Miles', name: 'Floyd Miles',
handle: 'floydmiles', handle: 'floydmiles',
imageUrl: imageUrl:
'https://images.unsplash.com/photo-1463453091185-61582044d556?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80', 'https://images.unsplash.com/photo-1463453091185-61582044d556?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80',
href: '#', href: '#',
}, },
{ {
name: 'Emily Selman', name: 'Emily Selman',
handle: 'emilyselman', handle: 'emilyselman',
imageUrl: imageUrl:
'https://images.unsplash.com/photo-1502685104226-ee32379fefbe?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80', 'https://images.unsplash.com/photo-1502685104226-ee32379fefbe?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80',
href: '#', href: '#',
}, },
{ {
name: 'Kristin Watson', name: 'Kristin Watson',
handle: 'kristinwatson', handle: 'kristinwatson',
imageUrl: imageUrl:
'https://images.unsplash.com/photo-1500917293891-ef795e70e1f6?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80', 'https://images.unsplash.com/photo-1500917293891-ef795e70e1f6?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80',
href: '#', href: '#',
}, },
]; ]
const announcements = [ const announcements = [
{ {
id: 1, id: 1,
title: 'Office closed on July 2nd', title: 'Office closed on July 2nd',
href: '#', href: '#',
preview: preview:
'Cum qui rem deleniti. Suscipit in dolor veritatis sequi aut. Vero ut earum quis deleniti. Ut a sunt eum cum ut repudiandae possimus. Nihil ex tempora neque cum consectetur dolores.', 'Cum qui rem deleniti. Suscipit in dolor veritatis sequi aut. Vero ut earum quis deleniti. Ut a sunt eum cum ut repudiandae possimus. Nihil ex tempora neque cum consectetur dolores.',
}, },
{ {
id: 2, id: 2,
title: 'New password policy', title: 'New password policy',
href: '#', href: '#',
preview: preview:
'Alias inventore ut autem optio voluptas et repellendus. Facere totam quaerat quam quo laudantium cumque eaque excepturi vel. Accusamus maxime ipsam reprehenderit rerum id repellendus rerum. Culpa cum vel natus. Est sit autem mollitia.', 'Alias inventore ut autem optio voluptas et repellendus. Facere totam quaerat quam quo laudantium cumque eaque excepturi vel. Accusamus maxime ipsam reprehenderit rerum id repellendus rerum. Culpa cum vel natus. Est sit autem mollitia.',
}, },
{ {
id: 3, id: 3,
title: 'Office closed on July 2nd', title: 'Office closed on July 2nd',
href: '#', href: '#',
preview: preview:
'Tenetur libero voluptatem rerum occaecati qui est molestiae exercitationem. Voluptate quisquam iure assumenda consequatur ex et recusandae. Alias consectetur voluptatibus. Accusamus a ab dicta et. Consequatur quis dignissimos voluptatem nisi.', 'Tenetur libero voluptatem rerum occaecati qui est molestiae exercitationem. Voluptate quisquam iure assumenda consequatur ex et recusandae. Alias consectetur voluptatibus. Accusamus a ab dicta et. Consequatur quis dignissimos voluptatem nisi.',
}, },
]; ]
return { return {
user, user,
stats, stats,
actions, actions,
recentHires, recentHires,
announcements, announcements,
}; }
}, },
}; }
</script> </script>
<!--<script>-->
<!--import { ref } from 'vue';-->
<!--import {-->
<!-- Dialog,-->
<!-- DialogOverlay,-->
<!-- Menu,-->
<!-- MenuButton,-->
<!-- MenuItem,-->
<!-- MenuItems,-->
<!-- TransitionChild,-->
<!-- TransitionRoot,-->
<!--} from '@headlessui/vue';-->
<!--import {-->
<!-- BellIcon,-->
<!-- ClockIcon,-->
<!-- CogIcon,-->
<!-- CreditCardIcon,-->
<!-- DocumentReportIcon,-->
<!-- HomeIcon,-->
<!-- MenuAlt1Icon,-->
<!-- QuestionMarkCircleIcon,-->
<!-- ScaleIcon,-->
<!-- ShieldCheckIcon,-->
<!-- UserGroupIcon,-->
<!-- XIcon,-->
<!--} from '@heroicons/vue/outline';-->
<!--import {-->
<!-- CalendarIcon,-->
<!-- CashIcon,-->
<!-- CheckCircleIcon,-->
<!-- ChevronDownIcon,-->
<!-- ChevronRightIcon,-->
<!-- OfficeBuildingIcon,-->
<!-- SearchIcon, SunIcon,-->
<!--} from '@heroicons/vue/solid';-->
<!--const cards = [-->
<!-- { name: 'Account balance', href: '#', icon: ScaleIcon, amount: '$30,659.45' },-->
<!--];-->
<!--const transactions = [-->
<!-- {-->
<!-- id: 1,-->
<!-- name: 'Payment to Molly Sanders',-->
<!-- href: '#',-->
<!-- amount: '$20,000',-->
<!-- currency: 'USD',-->
<!-- status: 'success',-->
<!-- date: 'July 11, 2020',-->
<!-- datetime: '2020-07-11',-->
<!-- },-->
<!--];-->
<!--const statusStyles = {-->
<!-- success: 'bg-green-100 text-green-800',-->
<!-- processing: 'bg-yellow-100 text-yellow-800',-->
<!-- failed: 'bg-gray-100 text-gray-800',-->
<!--};-->
<!--export default {-->
<!-- components: {-->
<!-- Dialog,-->
<!-- DialogOverlay,-->
<!-- Menu,-->
<!-- MenuButton,-->
<!-- MenuItem,-->
<!-- MenuItems,-->
<!-- TransitionChild,-->
<!-- TransitionRoot,-->
<!-- BellIcon,-->
<!-- CashIcon,-->
<!-- CheckCircleIcon,-->
<!-- ChevronDownIcon,-->
<!-- ChevronRightIcon,-->
<!-- MenuAlt1Icon,-->
<!-- OfficeBuildingIcon,-->
<!-- SearchIcon,-->
<!-- XIcon,-->
<!-- HomeIcon,-->
<!-- UserGroupIcon,-->
<!-- SunIcon,-->
<!-- CalendarIcon,-->
<!-- },-->
<!-- setup() {-->
<!-- const sidebarOpen = ref(false);-->
<!-- return {-->
<!-- cards,-->
<!-- transactions,-->
<!-- statusStyles,-->
<!-- sidebarOpen,-->
<!-- };-->
<!-- },-->
<!--};-->
<!--</script>-->

View File

@@ -1,97 +0,0 @@
<template>
<InertiaHead title="Kalendarz" />
<div class="bg-white sm:rounded-lg shadow-md">
<div class="p-4 sm:px-6">
<h2 class="text-lg leading-6 font-medium text-gray-900">
Kalendarz
</h2>
</div>
<div class="grid grid-cols-38 justify-items-center divide-x divide-gray-300">
<div class="w-full text-center col-span-7">
<Menu as="div" class="relative inline-block text-left">
<div>
<MenuButton class="inline-flex justify-center w-full rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-100 focus:ring-blumilk-500">
Styczeń
<ChevronDownIcon class="-mr-1 ml-2 h-5 w-5" aria-hidden="true" />
</MenuButton>
</div>
<transition enter-active-class="transition ease-out duration-100" enter-from-class="transform opacity-0 scale-95" enter-to-class="transform opacity-100 scale-100" leave-active-class="transition ease-in duration-75" leave-from-class="transform opacity-100 scale-100" leave-to-class="transform opacity-0 scale-95">
<MenuItems class="origin-top-right absolute right-0 mt-2 w-56 rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5 focus:outline-none">
<div class="py-1">
<MenuItem>
<a href="#" class="text-gray-900 block px-4 py-2 text-sm">Styczeń</a>
</MenuItem>
<MenuItem>
<a href="#" class="text-gray-900 block px-4 py-2 text-sm">Luty</a>
</MenuItem>
<MenuItem>
<a href="#" class="text-gray-900 block px-4 py-2 text-sm">Marzec</a>
</MenuItem>
</div>
</MenuItems>
</transition>
</Menu>
</div>
<div class="w-full text-center font-semibold text-gray-900 py-4 bg-gray-50" v-for="n in 31">{{ n }}
<p class="text-gray-800 font-normal mt-1">Pt</p>
</div>
</div>
<div class="grid grid-cols-38 justify-items-start divide-x divide-gray-300 border-t border-gray-300" v-for="user in users.data"
:key="user.id">
<div class="col-span-7 px-4 py-2 whitespace-nowrap">
<div class="flex justify-start items-center">
<span
class="inline-flex items-center justify-center h-10 w-10 rounded-full"
>
<img
class="h-10 w-10 rounded-full"
:src="user.avatar"
alt=""
>
</span>
<div class="ml-3">
<div class="text-sm font-medium break-all text-gray-900">
{{ user.name }}
</div>
</div>
</div>
</div>
<div class="w-full bg-blumilk-25 divide-x divide-gray-300 flex justify-center" v-for="n in 31">
<!-- <div class="bg-blumilk-500 items-center w-96 m-1 rounded-lg"></div>-->
</div>
</div>
</div>
</template>
<script>
import FlatPickr from 'vue-flatpickr-component';
import {Listbox, ListboxButton, ListboxLabel, ListboxOption, ListboxOptions} from '@headlessui/vue';
import { Menu, MenuButton, MenuItem, MenuItems } from '@headlessui/vue'
import {CheckIcon, SelectorIcon} from '@heroicons/vue/solid';
import { ChevronDownIcon } from '@heroicons/vue/solid'
export default {
components: {
FlatPickr,
Listbox,
ListboxButton,
ListboxLabel,
ListboxOption,
ListboxOptions,
Menu,
MenuButton,
MenuItem,
MenuItems,
CheckIcon,
SelectorIcon,
ChevronDownIcon,
},
props: {
users: {
type: Object,
default: () => null,
},
},
};
</script>

View File

@@ -1,297 +1,336 @@
<template> <template>
<TransitionRoot <TransitionRoot
as="template" as="template"
:show="sidebarOpen" :show="sidebarOpen"
>
<Dialog
as="div"
class="fixed inset-0 flex z-40 lg:hidden"
@close="sidebarOpen = false"
> >
<Dialog <TransitionChild
as="div" as="template"
class="fixed inset-0 flex z-40 lg:hidden" enter="transition-opacity ease-linear duration-300"
@close="sidebarOpen = false" enter-from="opacity-0"
> enter-to="opacity-100"
<TransitionChild leave="transition-opacity ease-linear duration-300"
as="template" leave-from="opacity-100"
enter="transition-opacity ease-linear duration-300" leave-to="opacity-0"
enter-from="opacity-0" >
enter-to="opacity-100" <DialogOverlay class="fixed inset-0 bg-gray-600 bg-opacity-75" />
leave="transition-opacity ease-linear duration-300" </TransitionChild>
leave-from="opacity-100" <TransitionChild
leave-to="opacity-0" as="template"
> enter="transition ease-in-out duration-300 transform"
<DialogOverlay class="fixed inset-0 bg-gray-600 bg-opacity-75" /> enter-from="-translate-x-full"
</TransitionChild> enter-to="translate-x-0"
<TransitionChild leave="transition ease-in-out duration-300 transform"
as="template" leave-from="translate-x-0"
enter="transition ease-in-out duration-300 transform" leave-to="-translate-x-full"
enter-from="-translate-x-full" >
enter-to="translate-x-0" <div class="relative flex-1 flex flex-col max-w-xs w-full pt-5 pb-4 bg-blumilk-700">
leave="transition ease-in-out duration-300 transform" <TransitionChild
leave-from="translate-x-0" as="template"
leave-to="-translate-x-full" enter="ease-in-out duration-300"
> enter-from="opacity-0"
<div class="relative flex-1 flex flex-col max-w-xs w-full pt-5 pb-4 bg-blumilk-700"> enter-to="opacity-100"
<TransitionChild leave="ease-in-out duration-300"
as="template" leave-from="opacity-100"
enter="ease-in-out duration-300" leave-to="opacity-0"
enter-from="opacity-0" >
enter-to="opacity-100" <div class="absolute top-0 right-0 -mr-12 pt-2">
leave="ease-in-out duration-300" <button
leave-from="opacity-100"
leave-to="opacity-0"
>
<div class="absolute top-0 right-0 -mr-12 pt-2">
<button
type="button"
class="ml-1 flex items-center justify-center h-10 w-10 rounded-full focus:outline-none focus:ring-2 focus:ring-inset focus:ring-white"
@click="sidebarOpen = false"
>
<span class="sr-only">Close sidebar</span>
<XIcon
class="h-6 w-6 text-white"
aria-hidden="true"
/>
</button>
</div>
</TransitionChild>
<div class="flex-shrink-0 flex items-center px-4">
<InertiaLink href="/">
<img
class="h-8 w-auto"
src="/img/logo-white.png"
alt="Workflow"
>
</InertiaLink>
</div>
<nav
class="mt-5 flex-shrink-0 h-full divide-y divide-blumilk-800 overflow-y-auto"
aria-label="Sidebar"
>
<div class="px-2 space-y-1">
<a
v-for="item in navigation"
:key="item.name"
:href="item.href"
:class="[item.current ? 'bg-blumilk-800 text-white' : 'text-blumilk-100 hover:text-white hover:bg-blumilk-600', 'group flex items-center px-2 py-2 text-base font-medium rounded-md']"
:aria-current="item.current ? 'page' : undefined"
>
<component
:is="item.icon"
class="mr-4 flex-shrink-0 h-6 w-6 text-blumilk-200"
aria-hidden="true"
/>
{{ item.name }}
</a>
</div>
<div class="mt-6 pt-6">
<div class="px-2 space-y-1">
<a
v-for="item in secondaryNavigation"
:key="item.name"
:href="item.href"
class="group flex items-center px-2 py-2 text-base font-medium rounded-md text-blumilk-100 hover:text-white hover:bg-blumilk-600"
>
<component
:is="item.icon"
class="mr-4 h-6 w-6 text-blumilk-200"
aria-hidden="true"
/>
{{ item.name }}
</a>
</div>
</div>
</nav>
</div>
</TransitionChild>
<div
class="flex-shrink-0 w-14"
aria-hidden="true"
>
<!-- Dummy element to force sidebar to shrink to fit close icon -->
</div>
</Dialog>
</TransitionRoot>
<!-- Static sidebar for desktop -->
<div class="hidden lg:flex lg:w-64 lg:flex-col lg:fixed lg:inset-y-0">
<!-- Sidebar component, swap this element with another sidebar if you like -->
<div class="flex flex-col flex-grow bg-blumilk-700 pt-5 pb-4 overflow-y-auto">
<div class="flex items-center flex-shrink-0 px-4">
<InertiaLink href="/">
<img
class="h-8 w-auto"
src="/img/logo-white.png"
alt="Workflow"
>
</InertiaLink>
</div>
<nav
class="mt-5 flex-1 flex flex-col divide-y divide-blumilk-800 overflow-y-auto"
aria-label="Sidebar"
>
<div class="px-2 space-y-1">
<a
v-for="item in navigation"
:key="item.name"
:href="item.href"
:class="[item.current ? 'bg-blumilk-800 text-white' : 'text-blumilk-100 hover:text-white hover:bg-blumilk-600', 'group flex items-center px-2 py-2 text-sm leading-6 font-medium rounded-md']"
:aria-current="item.current ? 'page' : undefined"
>
<component
:is="item.icon"
class="mr-4 flex-shrink-0 h-6 w-6 text-blumilk-200"
aria-hidden="true"
/>
{{ item.name }}
</a>
</div>
<div class="mt-6 pt-6">
<div class="px-2 space-y-1">
<a
v-for="item in secondaryNavigation"
:key="item.name"
:href="item.href"
class="group flex items-center px-2 py-2 text-sm leading-6 font-medium rounded-md text-blumilk-100 hover:text-white hover:bg-blumilk-600"
>
<component
:is="item.icon"
class="mr-4 h-6 w-6 text-blumilk-200"
aria-hidden="true"
/>
{{ item.name }}
</a>
</div>
</div>
</nav>
</div>
</div>
<div class="lg:pl-64 flex flex-col flex-1">
<div class="relative z-10 flex-shrink-0 flex h-16 bg-white border-b border-gray-200">
<button
type="button" type="button"
class="px-4 border-r border-gray-200 text-gray-400 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-blumilk-500 lg:hidden" class="ml-1 flex items-center justify-center h-10 w-10 rounded-full focus:outline-none focus:ring-2 focus:ring-inset focus:ring-white"
@click="sidebarOpen = true" @click="sidebarOpen = false"
> >
<span class="sr-only">Open sidebar</span> <span class="sr-only">Close sidebar</span>
<MenuAlt1Icon <XIcon
class="h-6 w-6" class="h-6 w-6 text-white"
aria-hidden="true" aria-hidden="true"
/> />
</button> </button>
<div class="flex-1 px-4 flex justify-between sm:px-6 lg:max-w-7xl lg:mx-auto lg:px-8">
<div class="flex items-center">
<div>
<Menu
as="div"
class="relative inline-block text-left"
>
<div>
<MenuButton class="inline-flex justify-center w-full rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blumilk-500">
{{ years.current }}
<ChevronDownIcon class="-mr-1 ml-2 h-5 w-5" />
</MenuButton>
</div>
<transition
enter-active-class="transition ease-out duration-100"
enter-from-class="transform opacity-0 scale-95"
enter-to-class="transform opacity-100 scale-100"
leave-active-class="transition ease-in duration-75"
leave-from-class="transform opacity-100 scale-100"
leave-to-class="transform opacity-0 scale-95"
>
<MenuItems class="origin-top-right absolute right-0 mt-2 w-32 rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5 focus:outline-none">
<div class="py-1">
<MenuItem
v-for="(item, index) in years.navigation"
:key="index"
v-slot="{ active }"
>
<InertiaLink
:href="item.link"
as="button"
method="post"
:preserve-state="false"
:class="[active ? 'bg-gray-100 text-gray-900' : 'text-gray-700', 'flex w-full px-4 py-2 text-sm']"
>
{{ item.year }}
<CheckIcon
v-if="item.year === years.current"
class="h-5 w-5 text-blumilk-500 ml-2"
/>
</InertiaLink>
</MenuItem>
</div>
</MenuItems>
</transition>
</Menu>
</div>
</div>
<div class="ml-4 flex items-center md:ml-6">
<button
type="button"
class="bg-white p-1 rounded-full text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blumilk-500"
>
<span class="sr-only">View notifications</span>
<BellIcon
class="h-6 w-6"
aria-hidden="true"
/>
</button>
<!-- Profile dropdown -->
<Menu
as="div"
class="ml-3 relative"
>
<div>
<MenuButton class="max-w-xs bg-white rounded-full flex items-center text-sm focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blumilk-500 lg:p-2 lg:rounded-md lg:hover:bg-gray-50">
<img
class="h-8 w-8 rounded-full"
:src="user.avatar"
alt="Avatar"
>
<span class="hidden ml-3 text-gray-700 text-sm font-medium lg:block"><span class="sr-only">Open user menu for </span>{{ user.name }}</span>
<ChevronDownIcon
class="hidden flex-shrink-0 ml-1 h-5 w-5 text-gray-400 lg:block"
aria-hidden="true"
/>
</MenuButton>
</div>
<transition
enter-active-class="transition ease-out duration-100"
enter-from-class="transform opacity-0 scale-95"
enter-to-class="transform opacity-100 scale-100"
leave-active-class="transition ease-in duration-75"
leave-from-class="transform opacity-100 scale-100"
leave-to-class="transform opacity-0 scale-95"
>
<MenuItems class="origin-top-right absolute right-0 mt-2 w-48 rounded-md shadow-lg py-1 bg-white ring-1 ring-black ring-opacity-5 focus:outline-none">
<MenuItem
v-for="item in userNavigation"
:key="item.name"
v-slot="{ active }"
>
<InertiaLink
:href="item.href"
:method="item.method"
:as="item.as"
:class="[active ? 'bg-gray-100' : '', 'block w-full text-left px-4 py-2 text-sm text-gray-700']"
>
{{ item.name }}
</InertiaLink>
</MenuItem>
</MenuItems>
</transition>
</Menu>
</div>
</div> </div>
</TransitionChild>
<div class="flex-shrink-0 flex items-center px-4">
<InertiaLink href="/">
<img
class="h-8 w-auto"
src="/img/logo-white.png"
alt="Workflow"
>
</InertiaLink>
</div>
<nav
class="mt-5 flex-shrink-0 h-full divide-y divide-blumilk-800 overflow-y-auto"
aria-label="Sidebar"
>
<div class="px-2 space-y-1">
<InertiaLink
v-for="item in navigation"
:key="item.name"
:href="item.href"
:class="[item.current ? 'bg-blumilk-800 text-white' : 'text-blumilk-100 hover:text-white hover:bg-blumilk-600', 'group flex items-center px-2 py-2 text-base font-medium rounded-md']"
:aria-current="item.current ? 'page' : undefined"
>
<component
:is="item.icon"
class="mr-4 flex-shrink-0 h-6 w-6 text-blumilk-200"
aria-hidden="true"
/>
{{ item.name }}
</InertiaLink>
</div>
<div class="mt-6 pt-6">
<div class="px-2 space-y-1">
<InertiaLink
v-for="item in secondaryNavigation"
:key="item.name"
:href="item.href"
class="group flex items-center px-2 py-2 text-base font-medium rounded-md text-blumilk-100 hover:text-white hover:bg-blumilk-600"
>
<component
:is="item.icon"
class="mr-4 h-6 w-6 text-blumilk-200"
aria-hidden="true"
/>
{{ item.name }}
</InertiaLink>
</div>
</div>
</nav>
</div> </div>
</TransitionChild>
<div
class="flex-shrink-0 w-14"
aria-hidden="true"
/>
</Dialog>
</TransitionRoot>
<!-- Static sidebar for desktop -->
<div class="hidden lg:flex lg:w-64 lg:flex-col lg:fixed lg:inset-y-0">
<!-- Sidebar component, swap this element with another sidebar if you like -->
<div class="flex flex-col flex-grow bg-blumilk-700 pt-5 pb-4 overflow-y-auto">
<div class="flex items-center flex-shrink-0 px-4">
<InertiaLink href="/">
<img
class="h-8 w-auto"
src="/img/logo-white.png"
alt="Workflow"
>
</InertiaLink>
</div>
<nav
class="mt-5 flex-1 flex flex-col divide-y divide-blumilk-800 overflow-y-auto"
aria-label="Sidebar"
>
<div class="px-2 space-y-1">
<InertiaLink
v-for="item in navigation"
:key="item.name"
:href="item.href"
:class="[item.current ? 'bg-blumilk-800 text-white' : 'text-blumilk-100 hover:text-white hover:bg-blumilk-600', 'group flex items-center px-2 py-2 text-sm leading-6 font-medium rounded-md']"
:aria-current="item.current ? 'page' : undefined"
>
<component
:is="item.icon"
class="mr-4 flex-shrink-0 h-6 w-6 text-blumilk-200"
aria-hidden="true"
/>
{{ item.name }}
</InertiaLink>
</div>
<div class="mt-6 pt-6">
<div class="px-2 space-y-1">
<InertiaLink
v-for="item in secondaryNavigation"
:key="item.name"
:href="item.href"
class="group flex items-center px-2 py-2 text-sm leading-6 font-medium rounded-md text-blumilk-100 hover:text-white hover:bg-blumilk-600"
>
<component
:is="item.icon"
class="mr-4 h-6 w-6 text-blumilk-200"
aria-hidden="true"
/>
{{ item.name }}
</InertiaLink>
</div>
</div>
</nav>
</div> </div>
</div>
<div class="lg:pl-64 flex flex-col flex-1">
<div class="relative z-10 flex-shrink-0 flex h-16 bg-white border-b border-gray-200">
<button
type="button"
class="px-4 border-r border-gray-200 text-gray-400 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-blumilk-500 lg:hidden"
@click="sidebarOpen = true"
>
<span class="sr-only">Open sidebar</span>
<MenuAlt1Icon
class="h-6 w-6"
aria-hidden="true"
/>
</button>
<div class="flex-1 px-4 flex justify-between sm:px-6 lg:px-8">
<div class="flex items-center">
<div>
<Menu
as="div"
class="relative inline-block text-left"
>
<div class="flex justify-center items-center">
<div class="mr-4">
Wybrany rok:
</div>
<div>
<MenuButton
class="inline-flex justify-center w-full rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blumilk-500"
>
{{ years.current }}
<ChevronDownIcon class="-mr-1 ml-2 h-5 w-5" />
</MenuButton>
</div>
</div>
<transition
enter-active-class="transition ease-out duration-100"
enter-from-class="transform opacity-0 scale-95"
enter-to-class="transform opacity-100 scale-100"
leave-active-class="transition ease-in duration-75"
leave-from-class="transform opacity-100 scale-100"
leave-to-class="transform opacity-0 scale-95"
>
<MenuItems
class="origin-top-right absolute right-0 mt-2 w-32 rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5 focus:outline-none"
>
<div class="py-1">
<MenuItem
v-for="(item, index) in years.navigation"
:key="index"
v-slot="{ active }"
>
<InertiaLink
:href="item.link"
as="button"
method="post"
:preserve-state="false"
:class="[active ? 'bg-gray-100 text-gray-900' : 'text-gray-700', 'flex w-full px-4 py-2 text-sm']"
>
{{ item.year }}
<CheckIcon
v-if="item.year === years.current"
class="h-5 w-5 text-blumilk-500 ml-2"
/>
</InertiaLink>
</MenuItem>
</div>
</MenuItems>
</transition>
</Menu>
</div>
</div>
<div class="ml-4 flex items-center md:ml-6">
<!-- Profile dropdown -->
<Menu
as="div"
class="ml-3 relative"
>
<div>
<MenuButton
class="max-w-xs bg-white rounded-full flex items-center text-sm focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blumilk-500 lg:p-2 lg:rounded-md lg:hover:bg-gray-50"
>
<img
class="h-8 w-8 rounded-full"
:src="user.avatar"
alt="Avatar"
>
<span class="hidden ml-3 text-gray-700 text-sm font-medium lg:block"><span class="sr-only">Open user menu for </span>{{
user.name
}}</span>
<ChevronDownIcon
class="hidden flex-shrink-0 ml-1 h-5 w-5 text-gray-400 lg:block"
aria-hidden="true"
/>
</MenuButton>
</div>
<transition
enter-active-class="transition ease-out duration-100"
enter-from-class="transform opacity-0 scale-95"
enter-to-class="transform opacity-100 scale-100"
leave-active-class="transition ease-in duration-75"
leave-from-class="transform opacity-100 scale-100"
leave-to-class="transform opacity-0 scale-95"
>
<MenuItems
class="origin-top-right absolute right-0 mt-2 w-48 rounded-md shadow-lg py-1 bg-white ring-1 ring-black ring-opacity-5 focus:outline-none"
>
<MenuItem
v-for="item in userNavigation"
:key="item.name"
v-slot="{ active }"
>
<InertiaLink
:href="item.href"
:method="item.method"
:as="item.as"
:class="[active ? 'bg-gray-100' : '', 'block w-full text-left px-4 py-2 text-sm text-gray-700']"
>
{{ item.name }}
</InertiaLink>
</MenuItem>
</MenuItems>
</transition>
</Menu>
</div>
</div>
</div>
</div>
</template> </template>
<script> <script>
import { ref } from 'vue'; import {ref} from 'vue'
import { import {
Dialog,
DialogOverlay,
Menu,
MenuButton,
MenuItem,
MenuItems,
TransitionChild,
TransitionRoot,
} from '@headlessui/vue'
import {
BellIcon,
CogIcon,
HomeIcon,
CollectionIcon,
MenuAlt1Icon,
QuestionMarkCircleIcon,
ShieldCheckIcon,
UserGroupIcon,
XIcon,
SunIcon,
StarIcon,
CalendarIcon,
} from '@heroicons/vue/outline'
import {
CashIcon,
CheckCircleIcon,
CheckIcon,
ChevronDownIcon,
ChevronRightIcon,
OfficeBuildingIcon,
SearchIcon,
} from '@heroicons/vue/solid'
import {computed} from 'vue'
import {usePage} from '@inertiajs/inertia-vue3'
export default {
components: {
Dialog, Dialog,
DialogOverlay, DialogOverlay,
Menu, Menu,
@@ -300,86 +339,55 @@ import {
MenuItems, MenuItems,
TransitionChild, TransitionChild,
TransitionRoot, TransitionRoot,
} from '@headlessui/vue';
import {
BellIcon, BellIcon,
CogIcon,
HomeIcon,
MenuAlt1Icon,
QuestionMarkCircleIcon,
ShieldCheckIcon,
UserGroupIcon,
XIcon,
SunIcon,
StarIcon,
CalendarIcon,
} from '@heroicons/vue/outline';
import {
CashIcon, CashIcon,
CheckCircleIcon, CheckCircleIcon,
ChevronDownIcon, ChevronDownIcon,
ChevronRightIcon, ChevronRightIcon,
MenuAlt1Icon,
OfficeBuildingIcon, OfficeBuildingIcon,
SearchIcon, SearchIcon,
} from '@heroicons/vue/solid'; XIcon,
import {computed} from 'vue'; StarIcon,
import {usePage} from '@inertiajs/inertia-vue3'; HomeIcon,
CheckIcon,
UserGroupIcon,
SunIcon,
CalendarIcon,
},
setup() {
const sidebarOpen = ref(false)
const secondaryNavigation = [ const user = computed(() => usePage().props.value.auth.user)
{ name: 'Settings', href: '#', icon: CogIcon }, const years = computed(() => usePage().props.value.years)
{ name: 'Help', href: '#', icon: QuestionMarkCircleIcon },
{ name: 'Privacy', href: '#', icon: ShieldCheckIcon },
];
export default { const navigation = [
components: { {name: 'Strona główna', href: '/', icon: HomeIcon, current: true},
Dialog, {name: 'Użytkownicy', href: '/users', icon: UserGroupIcon, current: false},
DialogOverlay, {name: 'Dostępne urlopy', href: '/vacation-limits', icon: SunIcon, current: false},
Menu, {name: 'Twoje wnioski', href: '/vacation-requests', icon: CollectionIcon, current: false},
MenuButton, {name: 'Dni wolne', href: '/holidays', icon: StarIcon, current: false},
MenuItem, {name: 'Kalendarz urlopów', href: '/vacation-calendar', icon: CalendarIcon, current: false},
MenuItems, ]
TransitionChild, const userNavigation = [
TransitionRoot, {name: 'Your Profile', href: '#'},
BellIcon, {name: 'Settings', href: '#'},
CashIcon, {name: 'Wyloguj się', href: '/logout', method: 'post', as: 'button'},
CheckCircleIcon, ]
ChevronDownIcon,
ChevronRightIcon, const secondaryNavigation = [
MenuAlt1Icon, {name: 'Settings', href: '#', icon: CogIcon},
OfficeBuildingIcon, {name: 'Help', href: '#', icon: QuestionMarkCircleIcon},
SearchIcon, {name: 'Privacy', href: '#', icon: ShieldCheckIcon},
XIcon, ]
StarIcon, return {
HomeIcon, user,
UserGroupIcon, years,
SunIcon, navigation,
CalendarIcon, secondaryNavigation,
}, userNavigation,
setup() { sidebarOpen,
const sidebarOpen = ref(false); }
const user = computed(() => usePage().props.value.auth.user); },
const years = computed(() => usePage().props.value.years); }
const navigation = [
{name: 'Strona główna', href: '/', icon: HomeIcon, current: true},
{name: 'Użytkownicy', href: '/users', icon: UserGroupIcon, current: false},
{name: 'Dostępne urlopy', href: '/vacation-limits', icon: SunIcon, current: false},
{name: 'Dni wolne', href: '/holidays', icon: StarIcon, current: false},
{name: 'Kalendarz', href: '/calendar', icon: CalendarIcon, current: false},
];
const userNavigation = [
{name: 'Your Profile', href: '#'},
{name: 'Settings', href: '#'},
{name: 'Wyloguj się', href: '/logout', method: 'post', as: 'button'},
];
return {
user,
years,
navigation,
secondaryNavigation,
userNavigation,
sidebarOpen,
};
},
};
</script> </script>

View File

@@ -8,6 +8,7 @@ use Toby\Infrastructure\Http\Controllers\HolidayController;
use Toby\Infrastructure\Http\Controllers\LogoutController; use Toby\Infrastructure\Http\Controllers\LogoutController;
use Toby\Infrastructure\Http\Controllers\SelectYearPeriodController; use Toby\Infrastructure\Http\Controllers\SelectYearPeriodController;
use Toby\Infrastructure\Http\Controllers\UserController; use Toby\Infrastructure\Http\Controllers\UserController;
use Toby\Infrastructure\Http\Controllers\VacationCalendarController;
use Toby\Infrastructure\Http\Controllers\VacationLimitController; use Toby\Infrastructure\Http\Controllers\VacationLimitController;
use Toby\Infrastructure\Http\Controllers\VacationRequestController; use Toby\Infrastructure\Http\Controllers\VacationRequestController;
@@ -23,7 +24,8 @@ Route::middleware("auth")->group(function (): void {
Route::get("/vacation-limits", [VacationLimitController::class, "edit"]) Route::get("/vacation-limits", [VacationLimitController::class, "edit"])
->name("vacation.limits"); ->name("vacation.limits");
Route::get("/calendar", [HolidayController::class,"showCalendar"]); Route::get("/vacation-calendar", [VacationCalendarController::class, "index"])
->name("vacation.calendar");
Route::get("/vacation-limits", [VacationLimitController::class, "edit"])->name("vacation.limits"); Route::get("/vacation-limits", [VacationLimitController::class, "edit"])->name("vacation.limits");
Route::put("/vacation-limits", [VacationLimitController::class, "update"]); Route::put("/vacation-limits", [VacationLimitController::class, "update"]);

View File

@@ -1,37 +1,34 @@
const defaultTheme = require('tailwindcss/defaultTheme'); const defaultTheme = require('tailwindcss/defaultTheme')
module.exports = { module.exports = {
content: [ content: [
'./resources/**/*.vue', './resources/**/*.vue',
], ],
theme: { theme: {
extend: { extend: {
fontFamily: { fontFamily: {
sans: ['Inter var', ...defaultTheme.fontFamily.sans], sans: ['Inter var', ...defaultTheme.fontFamily.sans],
}, },
colors: { colors: {
'blumilk': { 'blumilk': {
'25': '#F4F8FD', '25': '#F4F8FD',
'50': '#D5DFEE', '50': '#D5DFEE',
'100': '#C7D4E9', '100': '#C7D4E9',
'200': '#AABDDD', '200': '#AABDDD',
'300': '#8CA7D1', '300': '#8CA7D1',
'400': '#6F90C6', '400': '#6F90C6',
'500': '#527ABA', '500': '#527ABA',
'600': '#3C5F97', '600': '#3C5F97',
'700': '#2C466F', '700': '#2C466F',
'800': '#1C2D47', '800': '#1C2D47',
'900': '#0C141F' '900': '#0C141F',
},
},
gridTemplateColumns: {
'38': 'repeat(38, minmax(0, 1fr))',
}
}, },
},
}, },
plugins: [ },
require('@tailwindcss/forms'), plugins: [
require('@tailwindcss/typography'), require('@tailwindcss/forms'),
require('@tailwindcss/line-clamp') require('@tailwindcss/typography'),
], require('@tailwindcss/line-clamp'),
}; ],
}