#42 - wip
This commit is contained in:
parent
d026d41715
commit
d4c2f80eec
@ -29,9 +29,7 @@ class GoogleController extends Controller
|
||||
} catch (ModelNotFoundException) {
|
||||
return redirect()
|
||||
->route("login")
|
||||
->withErrors([
|
||||
"oauth" => __("User does not exist."),
|
||||
]);
|
||||
->with("error", __("User does not exist."));
|
||||
}
|
||||
|
||||
$auth->guard()->login($user, true);
|
||||
|
@ -35,7 +35,7 @@ class HolidayController extends Controller
|
||||
|
||||
return redirect()
|
||||
->route("holidays.index")
|
||||
->with("success", __("Holiday has been created"));
|
||||
->with("success", __("Holiday has been created."));
|
||||
}
|
||||
|
||||
public function edit(Holiday $holiday): Response
|
||||
@ -51,7 +51,7 @@ class HolidayController extends Controller
|
||||
|
||||
return redirect()
|
||||
->route("holidays.index")
|
||||
->with("success", __("Holiday has been updated"));
|
||||
->with("success", __("Holiday has been updated."));
|
||||
}
|
||||
|
||||
public function destroy(Holiday $holiday): RedirectResponse
|
||||
@ -60,6 +60,6 @@ class HolidayController extends Controller
|
||||
|
||||
return redirect()
|
||||
->route("holidays.index")
|
||||
->with("success", __("Holiday has been deleted"));
|
||||
->with("success", __("Holiday has been deleted."));
|
||||
}
|
||||
}
|
||||
|
@ -17,6 +17,6 @@ class SelectYearPeriodController extends Controller
|
||||
|
||||
return redirect()
|
||||
->back()
|
||||
->with("success", __("Selected year period has been changed"));
|
||||
->with("success", __("Selected year period has been changed."));
|
||||
}
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ class UserController extends Controller
|
||||
|
||||
return redirect()
|
||||
->route("users.index")
|
||||
->with("success", __("User has been created"));
|
||||
->with("success", __("User has been created."));
|
||||
}
|
||||
|
||||
public function edit(User $user): Response
|
||||
@ -64,7 +64,7 @@ class UserController extends Controller
|
||||
|
||||
return redirect()
|
||||
->route("users.index")
|
||||
->with("success", __("User has been updated"));
|
||||
->with("success", __("User has been updated."));
|
||||
}
|
||||
|
||||
public function destroy(User $user): RedirectResponse
|
||||
@ -73,7 +73,7 @@ class UserController extends Controller
|
||||
|
||||
return redirect()
|
||||
->route("users.index")
|
||||
->with("success", __("User has been deleted"));
|
||||
->with("success", __("User has been deleted."));
|
||||
}
|
||||
|
||||
public function restore(User $user): RedirectResponse
|
||||
@ -82,6 +82,6 @@ class UserController extends Controller
|
||||
|
||||
return redirect()
|
||||
->route("users.index")
|
||||
->with("success", __("User has been restored"));
|
||||
->with("success", __("User has been restored."));
|
||||
}
|
||||
}
|
||||
|
@ -35,6 +35,6 @@ class VacationLimitController extends Controller
|
||||
|
||||
return redirect()
|
||||
->back()
|
||||
->with("success", __("Vacation limits have been updated"));
|
||||
->with("success", __("Vacation limits have been updated."));
|
||||
}
|
||||
}
|
||||
|
@ -93,7 +93,8 @@ class VacationRequestController extends Controller
|
||||
$stateManager->markAsCreated($vacationRequest);
|
||||
|
||||
return redirect()
|
||||
->route("vacation.requests.index");
|
||||
->route("vacation.requests.show", $vacationRequest)
|
||||
->with("success", __("Vacation request has been created."));
|
||||
}
|
||||
|
||||
public function reject(
|
||||
@ -102,7 +103,8 @@ class VacationRequestController extends Controller
|
||||
): RedirectResponse {
|
||||
$stateManager->reject($vacationRequest);
|
||||
|
||||
return redirect()->back();
|
||||
return redirect()->back()
|
||||
->with("success", __("Vacation request has been rejected."));
|
||||
}
|
||||
|
||||
public function cancel(
|
||||
@ -111,7 +113,8 @@ class VacationRequestController extends Controller
|
||||
): RedirectResponse {
|
||||
$stateManager->cancel($vacationRequest);
|
||||
|
||||
return redirect()->back();
|
||||
return redirect()->back()
|
||||
->with("success", __("Vacation request has been canceled."));
|
||||
}
|
||||
|
||||
public function acceptAsTechnical(
|
||||
@ -120,7 +123,8 @@ class VacationRequestController extends Controller
|
||||
): RedirectResponse {
|
||||
$stateManager->acceptAsTechnical($vacationRequest);
|
||||
|
||||
return redirect()->back();
|
||||
return redirect()->back()
|
||||
->with("success", __("Vacation request has been accepted."));
|
||||
}
|
||||
|
||||
public function acceptAsAdministrative(
|
||||
@ -129,6 +133,7 @@ class VacationRequestController extends Controller
|
||||
): RedirectResponse {
|
||||
$stateManager->acceptAsAdministrative($vacationRequest);
|
||||
|
||||
return redirect()->back();
|
||||
return redirect()->back()
|
||||
->with("success", __("Vacation request has been accepted."));
|
||||
}
|
||||
}
|
||||
|
@ -1,41 +1,5 @@
|
||||
<template>
|
||||
<InertiaHead title="Zaloguj się" />
|
||||
<transition
|
||||
enter-active-class="transform ease-out duration-300 transition"
|
||||
enter-from-class="translate-y-2 opacity-0 sm:translate-y-0 sm:translate-x-2"
|
||||
enter-to-class="translate-y-0 opacity-100 sm:translate-x-0"
|
||||
leave-active-class="transition ease-in duration-100"
|
||||
leave-from-class="opacity-100"
|
||||
leave-to-class="opacity-0"
|
||||
>
|
||||
<div
|
||||
v-if="errors.oauth"
|
||||
class="absolute inset-x-2 top-2 sm:mx-auto sm:w-full sm:max-w-md bg-red-500 shadow-lg rounded-lg pointer-events-auto ring-1 ring-black ring-opacity-5 overflow-hidden"
|
||||
>
|
||||
<div class="p-4">
|
||||
<div class="flex items-center">
|
||||
<div class="w-0 flex-1 flex justify-between">
|
||||
<ExclamationIcon class="h-5 w-5 text-white" />
|
||||
<p class="w-0 flex-1 text-sm font-medium text-white">
|
||||
{{ errors.oauth }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="ml-4 flex-shrink-0 flex">
|
||||
<button
|
||||
class="bg-red-500 rounded-md inline-flex text-red-100 hover:text-red-400 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-600"
|
||||
@click="delete errors.oauth"
|
||||
>
|
||||
<span class="sr-only">Close</span>
|
||||
<XIcon
|
||||
class="h-5 w-5"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</transition>
|
||||
<div
|
||||
class="sm:mx-auto sm:w-full sm:max-w-md text-white space-y-4 flex flex-col items-center rounded-lg px-4 py-8"
|
||||
dusk="login-link"
|
||||
@ -66,21 +30,10 @@
|
||||
|
||||
<script>
|
||||
import GuestLayout from '@/Shared/Layout/GuestLayout'
|
||||
import {XIcon} from '@heroicons/vue/solid'
|
||||
import {ExclamationIcon} from '@heroicons/vue/solid'
|
||||
|
||||
export default {
|
||||
name: 'LoginPage',
|
||||
components: {
|
||||
XIcon,
|
||||
ExclamationIcon,
|
||||
},
|
||||
|
||||
layout: GuestLayout,
|
||||
props: {
|
||||
errors: {
|
||||
type: Object,
|
||||
default: () => ({oauth: null}),
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
97
resources/js/Shared/FlashMessage.vue
Normal file
97
resources/js/Shared/FlashMessage.vue
Normal file
@ -0,0 +1,97 @@
|
||||
<template>
|
||||
<transition
|
||||
enter-active-class="transform ease-out duration-300 transition"
|
||||
enter-from-class="opacity-0"
|
||||
enter-to-class="opacity-100"
|
||||
leave-active-class="transition ease-in duration-100"
|
||||
leave-from-class="opacity-100"
|
||||
leave-to-class="opacity-0"
|
||||
>
|
||||
<div
|
||||
v-if="$page.props.flash.success && show"
|
||||
class="fixed bottom-4 right-0 mx-auto w-full max-w-md bg-green-500 shadow-lg rounded-lg pointer-events-auto ring-1 ring-black ring-opacity-5 overflow-hidden z-50 sm:mr-4"
|
||||
>
|
||||
<div class="p-4">
|
||||
<div class="flex items-center">
|
||||
<div class="w-0 flex-1 flex justify-between">
|
||||
<CheckCircleIcon class="h-5 w-5 text-white mr-2" />
|
||||
<p class="w-0 flex-1 text-sm font-medium text-white">
|
||||
{{ $page.props.flash.success }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="ml-4 flex-shrink-0 flex">
|
||||
<button
|
||||
class="bg-green-500 rounded-md inline-flex text-green-100 hover:text-green-400 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-600"
|
||||
@click="show = false"
|
||||
>
|
||||
<span class="sr-only">Close</span>
|
||||
<XIcon
|
||||
class="h-5 w-5"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</transition>
|
||||
<div
|
||||
v-if="($page.props.flash.error) && show"
|
||||
class="fixed bottom-4 right-0 mx-auto w-full max-w-md bg-red-500 shadow-lg rounded-lg pointer-events-auto ring-1 ring-black ring-opacity-5 overflow-hidden z-50 sm:mr-4"
|
||||
>
|
||||
<div class="p-4">
|
||||
<div class="flex items-center">
|
||||
<div class="w-0 flex-1 flex justify-between">
|
||||
<ExclamationIcon class="h-5 w-5 text-white mr-2" />
|
||||
<p class="w-0 flex-1 text-sm font-medium text-white">
|
||||
{{ $page.props.flash.error }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="ml-4 flex-shrink-0 flex">
|
||||
<button
|
||||
class="bg-red-500 rounded-md inline-flex text-red-100 hover:text-red-400 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-600"
|
||||
@click="show = false"
|
||||
>
|
||||
<span class="sr-only">Close</span>
|
||||
<XIcon
|
||||
class="h-5 w-5"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {XIcon} from '@heroicons/vue/outline'
|
||||
import {ExclamationIcon, CheckCircleIcon} from '@heroicons/vue/solid'
|
||||
|
||||
export default {
|
||||
name: 'FlashMessage',
|
||||
components: {
|
||||
CheckCircleIcon,
|
||||
ExclamationIcon,
|
||||
XIcon,
|
||||
},
|
||||
props: {
|
||||
flash: Object,
|
||||
default: () => ({success: null, error: null}),
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
show:true,
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$page.props.flash': {
|
||||
handler() {
|
||||
this.show = true
|
||||
setTimeout(() => this.show = false, 6000)
|
||||
},
|
||||
},
|
||||
deep: true,
|
||||
},
|
||||
}
|
||||
</script>
|
@ -2,6 +2,7 @@
|
||||
<div class="min-h-full">
|
||||
<MainMenu />
|
||||
<main class="lg:ml-64 flex flex-col flex-1 py-8">
|
||||
<FlashMessage />
|
||||
<div>
|
||||
<slot />
|
||||
</div>
|
||||
@ -11,9 +12,13 @@
|
||||
|
||||
<script>
|
||||
import MainMenu from '@/Shared/MainMenu'
|
||||
import FlashMessage from '@/Shared/FlashMessage'
|
||||
|
||||
export default {
|
||||
name: 'AppLayout',
|
||||
components: {MainMenu},
|
||||
components: {
|
||||
FlashMessage,
|
||||
MainMenu,
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
@ -1,12 +1,14 @@
|
||||
|
||||
<template>
|
||||
<div class="min-h-screen flex flex-col justify-center py-12 sm:px-6 lg:px-8 bg-blumilk-25">
|
||||
<FlashMessage />
|
||||
<slot />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import FlashMessage from '@/Shared/FlashMessage'
|
||||
export default {
|
||||
name: 'GuestLayout',
|
||||
components: {FlashMessage},
|
||||
}
|
||||
</script>
|
||||
|
@ -363,11 +363,11 @@ export default {
|
||||
|
||||
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: 'Twoje wnioski', href: '/vacation-requests', icon: CollectionIcon, current: false},
|
||||
{name: 'Dni wolne', href: '/holidays', icon: StarIcon, current: false},
|
||||
{name: 'Wnioski urlopowe', href: '/vacation-requests', icon: CollectionIcon, current: false},
|
||||
{name: 'Kalendarz urlopów', href: '/vacation-calendar', icon: CalendarIcon, current: false},
|
||||
{name: 'Dni wolne', href: '/holidays', icon: StarIcon, current: false},
|
||||
{name: 'Limity urlopów', href: '/vacation-limits', icon: SunIcon, current: false},
|
||||
{name: 'Użytkownicy', href: '/users', icon: UserGroupIcon, current: false},
|
||||
]
|
||||
const userNavigation = [
|
||||
{name: 'Your Profile', href: '#'},
|
||||
|
@ -30,5 +30,19 @@
|
||||
"You have approved vacation request in this range.": "Masz zaakceptowany wniosek urlopowy w tym zakresie dat.",
|
||||
"You have exceeded your vacation limit.": "Przekroczyłeś/aś limit urlopu.",
|
||||
"Vacation needs minimum one day.": "Urlop musi być co najmniej na jeden dzień.",
|
||||
"The vacation request cannot be created at the turn of the year.": "Wniosek urlopowy nie może zostać złożony na przełomie roku."
|
||||
"The vacation request cannot be created at the turn of the year.": "Wniosek urlopowy nie może zostać złożony na przełomie roku.",
|
||||
"User has been created.": "Użytkownik został utworzony.",
|
||||
"User has been updated.": "Użytkownik został zaktualizowany.",
|
||||
"User has been deleted.": "Użytkownik został usunięty.",
|
||||
"User has been restored.": "Użytkownik został przywrócony.",
|
||||
"Holiday has been created.": "Dzień wolny został utworzony.",
|
||||
"Holiday has been updated.": "Dzień wolny został zaktualizowany.",
|
||||
"Holiday has been deleted.": "Dzień wolny został usunięty.",
|
||||
"Selected year period has been changed.": "Wybrany rok został zmieniony.",
|
||||
"Vacation limits have been updated.": "Limity urlopów zostały zaktualizowane.",
|
||||
"Vacation request has been created.": "Wniosek urlopowy został utworzony.",
|
||||
"Vacation request has been accepted.": "Wniosek urlopowy został zaakceptowany.",
|
||||
"Vacation request has been rejected.": "Wniosek urlopowy został odrzucony.",
|
||||
"Vacation request has been canceled.": "Wniosek urlopowy został anulowany."
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user