* wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * lint fixes * missing empty lines * translations * fix vue version * #134 - fixes * fix * fix * #134 - fix * fix * fix * #134 - added tests * #134 - fix to translations * #134 - tests * #134 - fix * Update database/factories/ResumeFactory.php Co-authored-by: Krzysztof Rewak <krzysztof.rewak@gmail.com> * #134 - fix * #134 - fix Co-authored-by: EwelinaLasowy <ewelina.lasowy@blumilk.pl> Co-authored-by: Krzysztof Rewak <krzysztof.rewak@gmail.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
@import 'flatpickr/dist/themes/light.css';
|
||||
@import 'flatpickr/dist/plugins/monthSelect/style.css';
|
||||
@import 'vue-toastification/dist/index.css';
|
||||
|
||||
@tailwind base;
|
||||
@@ -28,7 +29,8 @@
|
||||
.flatpickr-day.endRange.prevMonthDay,
|
||||
.flatpickr-day.selected.nextMonthDay,
|
||||
.flatpickr-day.startRange.nextMonthDay,
|
||||
.flatpickr-day.endRange.nextMonthDay {
|
||||
.flatpickr-day.endRange.nextMonthDay,
|
||||
.flatpickr-monthSelect-month.selected {
|
||||
background: #527ABA;
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none;
|
||||
|
89
resources/js/Composables/useLevels.js
Normal file
89
resources/js/Composables/useLevels.js
Normal file
@@ -0,0 +1,89 @@
|
||||
const technologyLevels = [
|
||||
{
|
||||
level: 1,
|
||||
name: 'Beginner',
|
||||
activeColor: 'bg-rose-400',
|
||||
backgroundColor: 'bg-rose-100',
|
||||
textColor: 'text-rose-400',
|
||||
},
|
||||
{
|
||||
level: 2,
|
||||
name: 'Junior',
|
||||
activeColor: 'bg-orange-400',
|
||||
backgroundColor: 'bg-orange-100',
|
||||
textColor: 'text-orange-400',
|
||||
},
|
||||
{
|
||||
level: 3,
|
||||
name: 'Regular',
|
||||
activeColor: 'bg-amber-400',
|
||||
backgroundColor: 'bg-amber-100',
|
||||
textColor: 'text-yellow-500',
|
||||
},
|
||||
{
|
||||
level: 4,
|
||||
name: 'Advanced',
|
||||
activeColor: 'bg-emerald-400',
|
||||
backgroundColor: 'bg-emerald-100',
|
||||
textColor: 'text-emerald-400',
|
||||
},
|
||||
{
|
||||
level: 5,
|
||||
name: 'Expert',
|
||||
activeColor: 'bg-blumilk-400',
|
||||
backgroundColor: 'bg-blumilk-100',
|
||||
textColor: 'text-blumilk-400',
|
||||
},
|
||||
]
|
||||
|
||||
const languageLevels = [
|
||||
{
|
||||
level: 1,
|
||||
name: 'A1',
|
||||
activeColor: 'bg-rose-400',
|
||||
backgroundColor: 'bg-rose-100',
|
||||
textColor: 'text-rose-400',
|
||||
},
|
||||
{
|
||||
level: 2,
|
||||
name: 'A2',
|
||||
activeColor: 'bg-orange-400',
|
||||
backgroundColor: 'bg-orange-100',
|
||||
textColor: 'text-orange-400',
|
||||
},
|
||||
{
|
||||
level: 3,
|
||||
name: 'B1',
|
||||
activeColor: 'bg-amber-400',
|
||||
backgroundColor: 'bg-amber-100',
|
||||
textColor: 'text-yellow-500',
|
||||
},
|
||||
{
|
||||
level: 4,
|
||||
name: 'B2',
|
||||
activeColor: 'bg-emerald-400',
|
||||
backgroundColor: 'bg-emerald-100',
|
||||
textColor: 'text-emerald-400',
|
||||
},
|
||||
{
|
||||
level: 5,
|
||||
name: 'C1',
|
||||
activeColor: 'bg-blumilk-400',
|
||||
backgroundColor: 'bg-blumilk-100',
|
||||
textColor: 'text-blumilk-400',
|
||||
},
|
||||
{
|
||||
level: 6,
|
||||
name: 'C2',
|
||||
activeColor: 'bg-gray-700',
|
||||
backgroundColor: 'bg-gray-200',
|
||||
textColor: 'text-gray-700',
|
||||
},
|
||||
]
|
||||
|
||||
export default function () {
|
||||
return {
|
||||
technologyLevels,
|
||||
languageLevels,
|
||||
}
|
||||
}
|
647
resources/js/Pages/Resumes/Create.vue
Normal file
647
resources/js/Pages/Resumes/Create.vue
Normal file
@@ -0,0 +1,647 @@
|
||||
<template>
|
||||
<InertiaHead title="Dodawanie CV" />
|
||||
<div class="mx-auto w-full max-w-7xl bg-white shadow-md">
|
||||
<div class="p-4 sm:px-6">
|
||||
<h2 class="text-lg font-medium leading-6 text-gray-900">
|
||||
Dodaj CV
|
||||
</h2>
|
||||
</div>
|
||||
<form
|
||||
class="flex flex-col justify-center py-8 px-6 space-y-8 border-t border-gray-200"
|
||||
@submit.prevent="submitResume"
|
||||
>
|
||||
<div class="space-y-8 sm:space-y-5">
|
||||
<div>
|
||||
<h3 class="text-lg font-medium leading-6 text-gray-900">
|
||||
Dane podstawowe
|
||||
</h3>
|
||||
<div class="grid grid-cols-2 gap-8 py-4">
|
||||
<Listbox
|
||||
v-model="form.user"
|
||||
as="div"
|
||||
>
|
||||
<ListboxLabel class="block text-sm font-medium text-gray-700">
|
||||
Użytkownik
|
||||
</ListboxLabel>
|
||||
<div class="relative mt-2">
|
||||
<ListboxButton
|
||||
class="relative py-2 pr-10 pl-3 w-full max-w-md h-10 text-left bg-white rounded-md border border-gray-300 focus:border-blumilk-500 focus:outline-none focus:ring-1 focus:ring-blumilk-500 shadow-sm cursor-default sm:text-sm"
|
||||
>
|
||||
<span v-if="form.user === null">
|
||||
Nie istnieje w bazie
|
||||
</span>
|
||||
<span
|
||||
v-else
|
||||
class="flex items-center"
|
||||
>
|
||||
<img
|
||||
:src="form.user.avatar"
|
||||
class="shrink-0 w-6 h-6 rounded-full"
|
||||
>
|
||||
<span class="block ml-3 truncate">{{ form.user.name }}</span>
|
||||
</span>
|
||||
<span class="flex absolute inset-y-0 right-0 items-center pr-2 pointer-events-none">
|
||||
<SelectorIcon class="w-5 h-5 text-gray-400" />
|
||||
</span>
|
||||
</ListboxButton>
|
||||
|
||||
<transition
|
||||
leave-active-class="transition ease-in duration-100"
|
||||
leave-from-class="opacity-100"
|
||||
leave-to-class="opacity-0"
|
||||
>
|
||||
<ListboxOptions
|
||||
class="overflow-auto absolute z-10 py-1 mt-1 w-full max-w-lg max-h-60 text-base bg-white rounded-md focus:outline-none ring-1 ring-black ring-opacity-5 shadow-lg sm:text-sm"
|
||||
>
|
||||
<ListboxOption
|
||||
v-slot="{ active }"
|
||||
as="template"
|
||||
:value="null"
|
||||
>
|
||||
<li
|
||||
:class="[active ? 'bg-gray-100' : 'text-gray-900', 'cursor-default select-none relative py-2 pl-3 pr-9']"
|
||||
>
|
||||
<div class="flex items-center">
|
||||
Nie istnieje w bazie
|
||||
</div>
|
||||
|
||||
<span
|
||||
v-if="form.user === null"
|
||||
:class="['text-blumilk-600 absolute inset-y-0 right-0 flex items-center pr-4']"
|
||||
>
|
||||
<CheckIcon class="w-5 h-5" />
|
||||
</span>
|
||||
</li>
|
||||
</ListboxOption>
|
||||
<ListboxOption
|
||||
v-for="user in users.data"
|
||||
:key="user.id"
|
||||
v-slot="{ active }"
|
||||
as="template"
|
||||
:value="user"
|
||||
>
|
||||
<li
|
||||
:class="[active ? 'bg-gray-100' : 'text-gray-900', 'cursor-default select-none relative py-2 pl-3 pr-9']"
|
||||
>
|
||||
<div class="flex items-center">
|
||||
<img
|
||||
:src="user.avatar"
|
||||
class="shrink-0 w-6 h-6 rounded-full"
|
||||
>
|
||||
<span
|
||||
:class="[form.user?.id === user.id ? 'font-semibold' : 'font-normal', 'ml-3 block truncate']"
|
||||
>
|
||||
{{ user.name }}
|
||||
</span>
|
||||
</div>
|
||||
<span
|
||||
v-if="form.user?.id === user.id"
|
||||
:class="['text-blumilk-600 absolute inset-y-0 right-0 flex items-center pr-4']"
|
||||
>
|
||||
<CheckIcon class="w-5 h-5" />
|
||||
</span>
|
||||
</li>
|
||||
</ListboxOption>
|
||||
</ListboxOptions>
|
||||
</transition>
|
||||
</div>
|
||||
</Listbox>
|
||||
<div v-if="form.user === null">
|
||||
<label
|
||||
for="name"
|
||||
class="block text-sm font-medium text-gray-700 sm:mt-px"
|
||||
>
|
||||
Imię i nazwisko
|
||||
</label>
|
||||
<div class="mt-2">
|
||||
<input
|
||||
id="name"
|
||||
v-model="form.name"
|
||||
type="text"
|
||||
class="block w-full max-w-md rounded-md shadow-sm sm:text-sm"
|
||||
:class="{ 'border-red-300 text-red-900 focus:outline-none focus:ring-red-500 focus:border-red-500': form.errors.name, 'focus:ring-blumilk-500 focus:border-blumilk-500 sm:text-sm border-gray-300': !form.errors.name }"
|
||||
>
|
||||
<p
|
||||
v-if="form.errors.name"
|
||||
class="mt-2 text-sm text-red-600"
|
||||
>
|
||||
{{ form.errors.name }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<DynamicSection
|
||||
v-model="form.educations"
|
||||
header="Edukacja"
|
||||
add-label="Dodaj szkołę"
|
||||
@add-item="addEducation"
|
||||
@remove-item="(index) => form.educations.splice(index, 1)"
|
||||
>
|
||||
<template #itemHeader="{ element, index }">
|
||||
<template v-if="hasAnyErrorInSection('education', index)">
|
||||
<ExclamationCircleIcon class="h-6 w-6 mr-2 text-red-600 inline-block" />
|
||||
</template>
|
||||
{{ element.school ? element.school : '(Nieokreślony)' }}
|
||||
</template>
|
||||
<template #form="{ element, index }">
|
||||
<div class="items-center py-4 sm:grid sm:grid-cols-2">
|
||||
<label class="block text-sm font-medium text-gray-700 sm:mt-px">
|
||||
Szkoła
|
||||
</label>
|
||||
<div class="mt-1 sm:mt-0">
|
||||
<input
|
||||
v-model="element.school"
|
||||
type="text"
|
||||
class="block w-full rounded-md shadow-sm sm:text-sm"
|
||||
:class="{ 'border-red-300 text-red-900 focus:outline-none focus:ring-red-500 focus:border-red-500': form.errors[`education.${index}.school`], 'focus:ring-blumilk-500 focus:border-blumilk-500 sm:text-sm border-gray-300': !form.errors[`education.${index}.school`] }"
|
||||
>
|
||||
<p
|
||||
v-if="form.errors[`education.${index}.school`]"
|
||||
class="mt-2 text-sm text-red-600"
|
||||
>
|
||||
{{ form.errors[`education.${index}.school`] }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="items-center py-4 sm:grid sm:grid-cols-2">
|
||||
<label class="block text-sm font-medium text-gray-700 sm:mt-px">
|
||||
Stopień
|
||||
</label>
|
||||
<div class="mt-1 sm:mt-0">
|
||||
<input
|
||||
v-model="element.degree"
|
||||
type="text"
|
||||
class="block w-full rounded-md shadow-sm sm:text-sm"
|
||||
:class="{ 'border-red-300 text-red-900 focus:outline-none focus:ring-red-500 focus:border-red-500': form.errors[`education.${index}.degree`], 'focus:ring-blumilk-500 focus:border-blumilk-500 sm:text-sm border-gray-300': !form.errors[`education.${index}.degree`] }"
|
||||
>
|
||||
<p
|
||||
v-if="form.errors[`education.${index}.degree`]"
|
||||
class="mt-2 text-sm text-red-600"
|
||||
>
|
||||
{{ form.errors[`education.${index}.degree`] }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="items-center py-4 sm:grid sm:grid-cols-2">
|
||||
<label class="block text-sm font-medium text-gray-700 sm:mt-px">
|
||||
Kierunek/Specjalizacja
|
||||
</label>
|
||||
<div class="mt-1 sm:mt-0">
|
||||
<input
|
||||
v-model="element.fieldOfStudy"
|
||||
type="text"
|
||||
class="block w-full rounded-md shadow-sm sm:text-sm"
|
||||
:class="{ 'border-red-300 text-red-900 focus:outline-none focus:ring-red-500 focus:border-red-500': form.errors[`education.${index}.fieldOfStudy`], 'focus:ring-blumilk-500 focus:border-blumilk-500 sm:text-sm border-gray-300': !form.errors[`education.${index}.fieldOfStudy`] }"
|
||||
>
|
||||
<p
|
||||
v-if="form.errors[`education.${index}.fieldOfStudy`]"
|
||||
class="mt-2 text-sm text-red-600"
|
||||
>
|
||||
{{ form.errors[`education.${index}.fieldOfStudy`] }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="items-center py-4 sm:grid sm:grid-cols-2">
|
||||
<label class="block text-sm font-medium text-gray-700 sm:mt-px">
|
||||
Data rozpoczęcia
|
||||
</label>
|
||||
<div class="mt-1 sm:mt-0">
|
||||
<MonthPicker
|
||||
v-model="element.startDate"
|
||||
placeholder="Wybierz datę"
|
||||
class="block w-full rounded-md shadow-sm sm:text-sm"
|
||||
:class="{ 'border-red-300 text-red-900 focus:outline-none focus:ring-red-500 focus:border-red-500': form.errors[`education.${index}.startDate`], 'focus:ring-blumilk-500 focus:border-blumilk-500 sm:text-sm border-gray-300': !form.errors[`education.${index}.startDate`] }"
|
||||
/>
|
||||
<p
|
||||
v-if="form.errors[`education.${index}.startDate`]"
|
||||
class="mt-2 text-sm text-red-600"
|
||||
>
|
||||
{{ form.errors[`education.${index}.startDate`] }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="items-center py-4 sm:grid sm:grid-cols-2">
|
||||
<label class="block text-sm font-medium text-gray-700 sm:mt-px">
|
||||
Data zakończenia
|
||||
</label>
|
||||
<div class="mt-1 sm:mt-0">
|
||||
<div class="space-y-2">
|
||||
<label class="block text-sm font-medium text-gray-700 sm:mt-px">
|
||||
<input
|
||||
v-model="element.current"
|
||||
type="checkbox"
|
||||
class="focus:ring-blumilk-500 h-4 w-4 text-blumilk-600 border-gray-300 rounded mr-1"
|
||||
>
|
||||
W trakcie
|
||||
</label>
|
||||
<MonthPicker
|
||||
v-model="element.endDate"
|
||||
placeholder="Wybierz datę"
|
||||
:disabled="element.current"
|
||||
class="block w-full rounded-md shadow-sm sm:text-sm disabled:bg-gray-100"
|
||||
:class="{ 'border-red-300 text-red-900 focus:outline-none focus:ring-red-500 focus:border-red-500': form.errors[`education.${index}.endDate`], 'focus:ring-blumilk-500 focus:border-blumilk-500 sm:text-sm border-gray-300': !form.errors[`education.${index}.endDate`] }"
|
||||
/>
|
||||
</div>
|
||||
<p
|
||||
v-if="form.errors[`education.${index}.endDate`]"
|
||||
class="mt-2 text-sm text-red-600"
|
||||
>
|
||||
{{ form.errors[`education.${index}.endDate`] }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</DynamicSection>
|
||||
<DynamicSection
|
||||
v-model="form.languages"
|
||||
header="Języki"
|
||||
add-label="Dodaj język"
|
||||
@add-item="addLanguage"
|
||||
@remove-item="(index) => form.languages.splice(index, 1)"
|
||||
>
|
||||
<template #itemHeader="{ element, index }">
|
||||
<template v-if="hasAnyErrorInSection('languages', index)">
|
||||
<ExclamationCircleIcon class="h-6 w-6 mr-2 text-red-600 inline-block" />
|
||||
</template>
|
||||
<template v-if="element.name">
|
||||
{{ element.name }} - <span :class="element.level.textColor">{{ element.level.name }}</span>
|
||||
</template>
|
||||
<template v-else>
|
||||
(Nieokreślony)
|
||||
</template>
|
||||
</template>
|
||||
<template #form="{ element, index }">
|
||||
<div class="gap-4 md:grid md:grid-cols-2 ">
|
||||
<div class="py-4">
|
||||
<label
|
||||
:for="`language-${index}-level`"
|
||||
class="block text-sm font-medium text-gray-700"
|
||||
>
|
||||
Język
|
||||
</label>
|
||||
<div class="mt-2">
|
||||
<Combobox
|
||||
:id="`language-${index}-level`"
|
||||
v-model="element.name"
|
||||
:items="languages"
|
||||
/>
|
||||
<p
|
||||
v-if="form.errors[`languages.${index}.name`]"
|
||||
class="mt-2 text-sm text-red-600"
|
||||
>
|
||||
{{ form.errors[`languages.${index}.name`] }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="py-4">
|
||||
<label
|
||||
:for="`language-level-${index}`"
|
||||
class="block text-sm font-medium text-gray-700"
|
||||
>
|
||||
Poziom - <span :class="element.level.textColor">{{ element.level.name }}</span>
|
||||
</label>
|
||||
<div class="mt-2">
|
||||
<LevelPicker
|
||||
v-model.number="element.level"
|
||||
:levels="languageLevels"
|
||||
/>
|
||||
<p
|
||||
v-if="form.errors[`languages.${index}.level`]"
|
||||
class="mt-2 text-sm text-red-600"
|
||||
>
|
||||
{{ form.errors[`languages.${index}.level`] }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</DynamicSection>
|
||||
<DynamicSection
|
||||
v-model="form.technologies"
|
||||
header="Technologie"
|
||||
add-label="Dodaj technologię"
|
||||
@add-item="addTechnology"
|
||||
@remove-item="(index) => form.technologies.splice(index, 1)"
|
||||
>
|
||||
<template #itemHeader="{ element, index }">
|
||||
<template v-if="hasAnyErrorInSection('technologies', index)">
|
||||
<ExclamationCircleIcon class="h-6 w-6 mr-2 text-red-600 inline-block" />
|
||||
</template>
|
||||
<template v-if="element.name">
|
||||
{{ element.name }} - <span :class="element.level.textColor">{{ element.level.name }}</span>
|
||||
</template>
|
||||
<template v-else>
|
||||
(Nieokreślony)
|
||||
</template>
|
||||
</template>
|
||||
<template #form="{ element, index }">
|
||||
<div class="gap-4 md:grid md:grid-cols-2 ">
|
||||
<div class="py-4">
|
||||
<label
|
||||
:for="`technology-${index}-level`"
|
||||
class="block text-sm font-medium text-gray-700"
|
||||
>
|
||||
Technologia
|
||||
</label>
|
||||
<div class="mt-2">
|
||||
<Combobox
|
||||
:id="`technology-${index}-level`"
|
||||
v-model="element.name"
|
||||
:items="technologies"
|
||||
/>
|
||||
<p
|
||||
v-if="form.errors[`technologies.${index}.name`]"
|
||||
class="mt-2 text-sm text-red-600"
|
||||
>
|
||||
{{ form.errors[`technologies.${index}.name`] }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="py-4">
|
||||
<label
|
||||
:for="`technology-level-${index}`"
|
||||
class="block text-sm font-medium text-gray-700"
|
||||
>
|
||||
Poziom - <span :class="element.level.textColor">{{ element.level.name }}</span>
|
||||
</label>
|
||||
<div class="mt-2">
|
||||
<LevelPicker
|
||||
v-model.number="element.level"
|
||||
:levels="technologyLevels"
|
||||
/>
|
||||
<p
|
||||
v-if="form.errors[`technologies.${index}.level`]"
|
||||
class="mt-2 text-sm text-red-600"
|
||||
>
|
||||
{{ form.errors[`technologies.${index}.level`] }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</DynamicSection>
|
||||
<DynamicSection
|
||||
v-model="form.projects"
|
||||
header="Projekty"
|
||||
add-label="Dodaj projekt"
|
||||
@add-item="addProject"
|
||||
@remove-item="(index) => form.projects.splice(index, 1)"
|
||||
>
|
||||
<template #itemHeader="{ element, index }">
|
||||
<template v-if="hasAnyErrorInSection('projects', index)">
|
||||
<ExclamationCircleIcon class="h-6 w-6 mr-2 text-red-600 inline-block" />
|
||||
</template>
|
||||
{{ element.description ? element.description : '(Nieokreślony)' }}
|
||||
</template>
|
||||
<template #form="{ element, index }">
|
||||
<div class="items-center py-4 sm:grid sm:grid-cols-2">
|
||||
<label
|
||||
:for="`project-description-${index}`"
|
||||
class="block text-sm font-medium text-gray-700 sm:mt-px"
|
||||
>
|
||||
Opis projektu
|
||||
</label>
|
||||
<div class="mt-1 sm:mt-0">
|
||||
<textarea
|
||||
:id="`project-description-${index}`"
|
||||
v-model="element.description"
|
||||
rows="5"
|
||||
class="block w-full rounded-md shadow-sm sm:text-sm"
|
||||
:class="{ 'border-red-300 text-red-900 focus:outline-none focus:ring-red-500 focus:border-red-500': form.errors[`projects.${index}.description`], 'focus:ring-blumilk-500 focus:border-blumilk-500 sm:text-sm border-gray-300': !form.errors[`projects.${index}.description`] }"
|
||||
/>
|
||||
<p
|
||||
v-if="form.errors[`projects.${index}.description`]"
|
||||
class="mt-2 text-sm text-red-600"
|
||||
>
|
||||
{{ form.errors[`projects.${index}.description`] }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="items-center py-4 sm:grid sm:grid-cols-2">
|
||||
<label
|
||||
:for="`project-technologies-${index}`"
|
||||
class="block text-sm font-medium text-gray-700 sm:mt-px"
|
||||
>
|
||||
Technologie
|
||||
</label>
|
||||
<div class="mt-1 sm:mt-0">
|
||||
<MultipleCombobox
|
||||
:id="`project-technologies-${index}`"
|
||||
v-model="element.technologies"
|
||||
:items="technologies"
|
||||
/>
|
||||
<p
|
||||
v-if="form.errors[`projects.${index}.technologies`]"
|
||||
class="mt-2 text-sm text-red-600"
|
||||
>
|
||||
{{ form.errors[`projects.${index}.technologies`] }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="items-center py-4 sm:grid sm:grid-cols-2">
|
||||
<label
|
||||
:for="`project-startDate-${index}`"
|
||||
class="block text-sm font-medium text-gray-700 sm:mt-px"
|
||||
>
|
||||
Data rozpoczęcia
|
||||
</label>
|
||||
<div class="mt-1 sm:mt-0">
|
||||
<MonthPicker
|
||||
:id="`project-startDate-${index}`"
|
||||
v-model="element.startDate"
|
||||
placeholder="Wybierz datę"
|
||||
class="block w-full rounded-md shadow-sm sm:text-sm"
|
||||
:class="{ 'border-red-300 text-red-900 focus:outline-none focus:ring-red-500 focus:border-red-500': form.errors[`projects.${index}.startDate`], 'focus:ring-blumilk-500 focus:border-blumilk-500 sm:text-sm border-gray-300': !form.errors[`projects.${index}.startDate`] }"
|
||||
/>
|
||||
<p
|
||||
v-if="form.errors[`projects.${index}.startDate`]"
|
||||
class="mt-2 text-sm text-red-600"
|
||||
>
|
||||
{{ form.errors[`projects.${index}.startDate`] }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="items-center py-4 sm:grid sm:grid-cols-2">
|
||||
<label
|
||||
:for="`project-endDate-${index}`"
|
||||
class="block text-sm font-medium text-gray-700 sm:mt-px"
|
||||
>
|
||||
Data zakończenia
|
||||
</label>
|
||||
<div class="mt-1 sm:mt-0">
|
||||
<div class="space-y-2">
|
||||
<label class="block text-sm font-medium text-gray-700 sm:mt-px">
|
||||
<input
|
||||
v-model="element.current"
|
||||
type="checkbox"
|
||||
class="focus:ring-blumilk-500 h-4 w-4 text-blumilk-600 border-gray-300 rounded mr-1"
|
||||
>
|
||||
W trakcie
|
||||
</label>
|
||||
<MonthPicker
|
||||
:id="`project-endDate-${index}`"
|
||||
v-model="element.endDate"
|
||||
placeholder="Wybierz datę"
|
||||
:disabled="element.current"
|
||||
class="block w-full rounded-md shadow-sm sm:text-sm disabled:bg-gray-100"
|
||||
:class="{ 'border-red-300 text-red-900 focus:outline-none focus:ring-red-500 focus:border-red-500': form.errors[`projects.${index}.endDate`], 'focus:ring-blumilk-500 focus:border-blumilk-500 sm:text-sm border-gray-300': !form.errors[`projects.${index}.endDate`] }"
|
||||
/>
|
||||
</div>
|
||||
<p
|
||||
v-if="form.errors[`projects.${index}.endDate`]"
|
||||
class="mt-2 text-sm text-red-600"
|
||||
>
|
||||
{{ form.errors[`projects.${index}.endDate`] }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="items-center py-4 sm:grid sm:grid-cols-2">
|
||||
<label
|
||||
:for="`project-tasks-${index}`"
|
||||
class="block text-sm font-medium text-gray-700 sm:mt-px"
|
||||
>
|
||||
Zadania
|
||||
</label>
|
||||
<div class="mt-1 sm:mt-0">
|
||||
<textarea
|
||||
:id="`project-tasks-${index}`"
|
||||
v-model="element.tasks"
|
||||
rows="5"
|
||||
class="block w-full rounded-md shadow-sm sm:text-sm"
|
||||
:class="{ 'border-red-300 text-red-900 focus:outline-none focus:ring-red-500 focus:border-red-500': form.errors[`projects.${index}.tasks`], 'focus:ring-blumilk-500 focus:border-blumilk-500 sm:text-sm border-gray-300': !form.errors[`projects.${index}.tasks`] }"
|
||||
/>
|
||||
<p
|
||||
v-if="form.errors[`projects.${index}.tasks`]"
|
||||
class="mt-2 text-sm text-red-600"
|
||||
>
|
||||
{{ form.errors[`projects.${index}.tasks`] }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</DynamicSection>
|
||||
<div class="pt-5">
|
||||
<div class="flex justify-end">
|
||||
<InertiaLink
|
||||
href="/resumes"
|
||||
class="py-2 px-4 text-sm font-medium text-gray-700 bg-white hover:bg-gray-50 rounded-md border border-gray-300 focus:outline-none focus:ring-2 focus:ring-blumilk-500 focus:ring-offset-2 shadow-sm"
|
||||
>
|
||||
Anuluj
|
||||
</InertiaLink>
|
||||
<button
|
||||
type="submit"
|
||||
class="inline-flex justify-center py-2 px-4 ml-3 text-sm font-medium text-white bg-blumilk-600 hover:bg-blumilk-700 rounded-md border border-transparent focus:outline-none focus:ring-2 focus:ring-blumilk-500 focus:ring-offset-2 shadow-sm"
|
||||
>
|
||||
Zapisz
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { Listbox, ListboxOption, ListboxOptions, ListboxLabel, ListboxButton } from '@headlessui/vue'
|
||||
import { SelectorIcon, CheckIcon } from '@heroicons/vue/outline'
|
||||
import { ExclamationCircleIcon } from '@heroicons/vue/solid'
|
||||
import { useForm } from '@inertiajs/inertia-vue3'
|
||||
import MonthPicker from '@/Shared/Forms/MonthPicker'
|
||||
import DynamicSection from '@/Shared/Forms/DynamicSection'
|
||||
import Combobox from '@/Shared/Forms/Combobox'
|
||||
import MultipleCombobox from '@/Shared/Forms/MultipleCombobox'
|
||||
import LevelPicker from '@/Shared/Forms/LevelPicker'
|
||||
import useLevels from '@/Composables/useLevels'
|
||||
|
||||
const props = defineProps({
|
||||
users: Object,
|
||||
technologies: Array,
|
||||
})
|
||||
|
||||
const { technologyLevels, languageLevels } = useLevels()
|
||||
|
||||
const languages = [
|
||||
'Polish',
|
||||
'English',
|
||||
'German',
|
||||
]
|
||||
|
||||
const form = useForm('createResume',{
|
||||
user: props.users.data[0],
|
||||
name: null,
|
||||
educations: [],
|
||||
projects: [],
|
||||
technologies: [],
|
||||
languages: [],
|
||||
})
|
||||
|
||||
function addProject() {
|
||||
form.projects.push({
|
||||
description: null,
|
||||
technologies: [],
|
||||
tasks: null,
|
||||
startDate: null,
|
||||
endDate: null,
|
||||
current: false,
|
||||
})
|
||||
}
|
||||
|
||||
function addTechnology() {
|
||||
form.technologies.push({
|
||||
name: null,
|
||||
level: technologyLevels[0],
|
||||
})
|
||||
}
|
||||
|
||||
function addEducation() {
|
||||
form.educations.push({
|
||||
school: null,
|
||||
degree: null,
|
||||
fieldOfStudy: null,
|
||||
startDate: null,
|
||||
endDate: null,
|
||||
current: false,
|
||||
})
|
||||
}
|
||||
|
||||
function addLanguage() {
|
||||
form.languages.push({
|
||||
name: null,
|
||||
level: languageLevels[0],
|
||||
})
|
||||
}
|
||||
|
||||
function hasAnyErrorInSection(section, index) {
|
||||
return Object
|
||||
.keys(form.errors)
|
||||
.some((error) => error.startsWith(`${section}.${index}.`))
|
||||
}
|
||||
|
||||
function submitResume() {
|
||||
form
|
||||
.transform((data) => ({
|
||||
user: data.user?.id,
|
||||
name: data.name,
|
||||
education: data.educations.map(education => ({
|
||||
...education,
|
||||
current: !!education.current,
|
||||
endDate: education.current ? null: education.endDate,
|
||||
})),
|
||||
languages: data.languages.map(language => ({
|
||||
name: language.name,
|
||||
level: language.level.level,
|
||||
})),
|
||||
technologies: data.technologies.map(technology => ({
|
||||
name: technology.name,
|
||||
level: technology.level.level,
|
||||
})),
|
||||
projects: data.projects.map(project => ({
|
||||
...project,
|
||||
current: !!project.current,
|
||||
endDate: project.current ? null : project.endDate,
|
||||
})),
|
||||
}))
|
||||
.post('/resumes')
|
||||
}
|
||||
</script>
|
654
resources/js/Pages/Resumes/Edit.vue
Normal file
654
resources/js/Pages/Resumes/Edit.vue
Normal file
@@ -0,0 +1,654 @@
|
||||
<template>
|
||||
<InertiaHead title="Edycja CV" />
|
||||
<div class="mx-auto w-full max-w-7xl bg-white shadow-md">
|
||||
<div class="p-4 sm:px-6">
|
||||
<h2 class="text-lg font-medium leading-6 text-gray-900">
|
||||
Edytuj CV
|
||||
</h2>
|
||||
</div>
|
||||
<form
|
||||
class="flex flex-col justify-center py-8 px-6 space-y-8 border-t border-gray-200"
|
||||
@submit.prevent="submitResume"
|
||||
>
|
||||
<div class="space-y-8 sm:space-y-5">
|
||||
<div>
|
||||
<h3 class="text-lg font-medium leading-6 text-gray-900">
|
||||
Dane podstawowe
|
||||
</h3>
|
||||
<div class="grid grid-cols-2 gap-8 py-4">
|
||||
<Listbox
|
||||
v-model="form.user"
|
||||
as="div"
|
||||
>
|
||||
<ListboxLabel class="block text-sm font-medium text-gray-700">
|
||||
Użytkownik
|
||||
</ListboxLabel>
|
||||
<div class="relative mt-2">
|
||||
<ListboxButton
|
||||
class="relative py-2 pr-10 pl-3 w-full max-w-md h-10 text-left bg-white rounded-md border border-gray-300 focus:border-blumilk-500 focus:outline-none focus:ring-1 focus:ring-blumilk-500 shadow-sm cursor-default sm:text-sm"
|
||||
>
|
||||
<span v-if="form.user === null">
|
||||
Nie istnieje w bazie
|
||||
</span>
|
||||
<span
|
||||
v-else
|
||||
class="flex items-center"
|
||||
>
|
||||
<img
|
||||
:src="form.user.avatar"
|
||||
class="shrink-0 w-6 h-6 rounded-full"
|
||||
>
|
||||
<span class="block ml-3 truncate">{{ form.user.name }}</span>
|
||||
</span>
|
||||
<span class="flex absolute inset-y-0 right-0 items-center pr-2 pointer-events-none">
|
||||
<SelectorIcon class="w-5 h-5 text-gray-400" />
|
||||
</span>
|
||||
</ListboxButton>
|
||||
|
||||
<transition
|
||||
leave-active-class="transition ease-in duration-100"
|
||||
leave-from-class="opacity-100"
|
||||
leave-to-class="opacity-0"
|
||||
>
|
||||
<ListboxOptions
|
||||
class="overflow-auto absolute z-10 py-1 mt-1 w-full max-w-lg max-h-60 text-base bg-white rounded-md focus:outline-none ring-1 ring-black ring-opacity-5 shadow-lg sm:text-sm"
|
||||
>
|
||||
<ListboxOption
|
||||
v-slot="{ active }"
|
||||
as="template"
|
||||
:value="null"
|
||||
>
|
||||
<li
|
||||
:class="[active ? 'bg-gray-100' : 'text-gray-900', 'cursor-default select-none relative py-2 pl-3 pr-9']"
|
||||
>
|
||||
<div class="flex items-center">
|
||||
Nie istnieje w bazie
|
||||
</div>
|
||||
|
||||
<span
|
||||
v-if="form.user === null"
|
||||
:class="['text-blumilk-600 absolute inset-y-0 right-0 flex items-center pr-4']"
|
||||
>
|
||||
<CheckIcon class="w-5 h-5" />
|
||||
</span>
|
||||
</li>
|
||||
</ListboxOption>
|
||||
<ListboxOption
|
||||
v-for="user in users.data"
|
||||
:key="user.id"
|
||||
v-slot="{ active }"
|
||||
as="template"
|
||||
:value="user"
|
||||
>
|
||||
<li
|
||||
:class="[active ? 'bg-gray-100' : 'text-gray-900', 'cursor-default select-none relative py-2 pl-3 pr-9']"
|
||||
>
|
||||
<div class="flex items-center">
|
||||
<img
|
||||
:src="user.avatar"
|
||||
class="shrink-0 w-6 h-6 rounded-full"
|
||||
>
|
||||
<span
|
||||
:class="[form.user?.id === user.id ? 'font-semibold' : 'font-normal', 'ml-3 block truncate']"
|
||||
>
|
||||
{{ user.name }}
|
||||
</span>
|
||||
</div>
|
||||
<span
|
||||
v-if="form.user?.id === user.id"
|
||||
:class="['text-blumilk-600 absolute inset-y-0 right-0 flex items-center pr-4']"
|
||||
>
|
||||
<CheckIcon class="w-5 h-5" />
|
||||
</span>
|
||||
</li>
|
||||
</ListboxOption>
|
||||
</ListboxOptions>
|
||||
</transition>
|
||||
</div>
|
||||
</Listbox>
|
||||
<div v-if="form.user === null">
|
||||
<label
|
||||
for="name"
|
||||
class="block text-sm font-medium text-gray-700 sm:mt-px"
|
||||
>
|
||||
Imię i nazwisko
|
||||
</label>
|
||||
<div class="mt-2">
|
||||
<input
|
||||
id="name"
|
||||
v-model="form.name"
|
||||
type="text"
|
||||
class="block w-full max-w-md rounded-md shadow-sm sm:text-sm"
|
||||
:class="{ 'border-red-300 text-red-900 focus:outline-none focus:ring-red-500 focus:border-red-500': form.errors.name, 'focus:ring-blumilk-500 focus:border-blumilk-500 sm:text-sm border-gray-300': !form.errors.name }"
|
||||
>
|
||||
<p
|
||||
v-if="form.errors.name"
|
||||
class="mt-2 text-sm text-red-600"
|
||||
>
|
||||
{{ form.errors.name }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<DynamicSection
|
||||
v-model="form.educations"
|
||||
header="Edukacja"
|
||||
add-label="Dodaj szkołę"
|
||||
@add-item="addEducation"
|
||||
@remove-item="(index) => form.educations.splice(index, 1)"
|
||||
>
|
||||
<template #itemHeader="{ element, index }">
|
||||
<template v-if="hasAnyErrorInSection('education', index)">
|
||||
<ExclamationCircleIcon class="h-6 w-6 mr-2 text-red-600 inline-block" />
|
||||
</template>
|
||||
{{ element.school ? element.school : '(Nieokreślony)' }}
|
||||
</template>
|
||||
<template #form="{ element, index }">
|
||||
<div class="items-center py-4 sm:grid sm:grid-cols-2">
|
||||
<label class="block text-sm font-medium text-gray-700 sm:mt-px">
|
||||
Szkoła
|
||||
</label>
|
||||
<div class="mt-1 sm:mt-0">
|
||||
<input
|
||||
v-model="element.school"
|
||||
type="text"
|
||||
class="block w-full rounded-md shadow-sm sm:text-sm"
|
||||
:class="{ 'border-red-300 text-red-900 focus:outline-none focus:ring-red-500 focus:border-red-500': form.errors[`education.${index}.school`], 'focus:ring-blumilk-500 focus:border-blumilk-500 sm:text-sm border-gray-300': !form.errors[`education.${index}.school`] }"
|
||||
>
|
||||
<p
|
||||
v-if="form.errors[`education.${index}.school`]"
|
||||
class="mt-2 text-sm text-red-600"
|
||||
>
|
||||
{{ form.errors[`education.${index}.school`] }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="items-center py-4 sm:grid sm:grid-cols-2">
|
||||
<label class="block text-sm font-medium text-gray-700 sm:mt-px">
|
||||
Stopień
|
||||
</label>
|
||||
<div class="mt-1 sm:mt-0">
|
||||
<input
|
||||
v-model="element.degree"
|
||||
type="text"
|
||||
class="block w-full rounded-md shadow-sm sm:text-sm"
|
||||
:class="{ 'border-red-300 text-red-900 focus:outline-none focus:ring-red-500 focus:border-red-500': form.errors[`education.${index}.degree`], 'focus:ring-blumilk-500 focus:border-blumilk-500 sm:text-sm border-gray-300': !form.errors[`education.${index}.degree`] }"
|
||||
>
|
||||
<p
|
||||
v-if="form.errors[`education.${index}.degree`]"
|
||||
class="mt-2 text-sm text-red-600"
|
||||
>
|
||||
{{ form.errors[`education.${index}.degree`] }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="items-center py-4 sm:grid sm:grid-cols-2">
|
||||
<label class="block text-sm font-medium text-gray-700 sm:mt-px">
|
||||
Kierunek/Specjalizacja
|
||||
</label>
|
||||
<div class="mt-1 sm:mt-0">
|
||||
<input
|
||||
v-model="element.fieldOfStudy"
|
||||
type="text"
|
||||
class="block w-full rounded-md shadow-sm sm:text-sm"
|
||||
:class="{ 'border-red-300 text-red-900 focus:outline-none focus:ring-red-500 focus:border-red-500': form.errors[`education.${index}.fieldOfStudy`], 'focus:ring-blumilk-500 focus:border-blumilk-500 sm:text-sm border-gray-300': !form.errors[`education.${index}.fieldOfStudy`] }"
|
||||
>
|
||||
<p
|
||||
v-if="form.errors[`education.${index}.fieldOfStudy`]"
|
||||
class="mt-2 text-sm text-red-600"
|
||||
>
|
||||
{{ form.errors[`education.${index}.fieldOfStudy`] }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="items-center py-4 sm:grid sm:grid-cols-2">
|
||||
<label class="block text-sm font-medium text-gray-700 sm:mt-px">
|
||||
Data rozpoczęcia
|
||||
</label>
|
||||
<div class="mt-1 sm:mt-0">
|
||||
<MonthPicker
|
||||
v-model="element.startDate"
|
||||
placeholder="Wybierz datę"
|
||||
class="block w-full rounded-md shadow-sm sm:text-sm"
|
||||
:class="{ 'border-red-300 text-red-900 focus:outline-none focus:ring-red-500 focus:border-red-500': form.errors[`education.${index}.startDate`], 'focus:ring-blumilk-500 focus:border-blumilk-500 sm:text-sm border-gray-300': !form.errors[`education.${index}.startDate`] }"
|
||||
/>
|
||||
<p
|
||||
v-if="form.errors[`education.${index}.startDate`]"
|
||||
class="mt-2 text-sm text-red-600"
|
||||
>
|
||||
{{ form.errors[`education.${index}.startDate`] }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="items-center py-4 sm:grid sm:grid-cols-2">
|
||||
<label class="block text-sm font-medium text-gray-700 sm:mt-px">
|
||||
Data zakończenia
|
||||
</label>
|
||||
<div class="mt-1 sm:mt-0">
|
||||
<div class="space-y-2">
|
||||
<label class="block text-sm font-medium text-gray-700 sm:mt-px">
|
||||
<input
|
||||
v-model="element.current"
|
||||
type="checkbox"
|
||||
class="focus:ring-blumilk-500 h-4 w-4 text-blumilk-600 border-gray-300 rounded mr-1"
|
||||
>
|
||||
W trakcie
|
||||
</label>
|
||||
<MonthPicker
|
||||
v-model="element.endDate"
|
||||
placeholder="Wybierz datę"
|
||||
:disabled="element.current"
|
||||
class="block w-full rounded-md shadow-sm sm:text-sm disabled:bg-gray-100"
|
||||
:class="{ 'border-red-300 text-red-900 focus:outline-none focus:ring-red-500 focus:border-red-500': form.errors[`education.${index}.endDate`], 'focus:ring-blumilk-500 focus:border-blumilk-500 sm:text-sm border-gray-300': !form.errors[`education.${index}.endDate`] }"
|
||||
/>
|
||||
</div>
|
||||
<p
|
||||
v-if="form.errors[`education.${index}.endDate`]"
|
||||
class="mt-2 text-sm text-red-600"
|
||||
>
|
||||
{{ form.errors[`education.${index}.endDate`] }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</DynamicSection>
|
||||
<DynamicSection
|
||||
v-model="form.languages"
|
||||
header="Języki"
|
||||
add-label="Dodaj język"
|
||||
@add-item="addLanguage"
|
||||
@remove-item="(index) => form.languages.splice(index, 1)"
|
||||
>
|
||||
<template #itemHeader="{ element, index }">
|
||||
<template v-if="hasAnyErrorInSection('languages', index)">
|
||||
<ExclamationCircleIcon class="h-6 w-6 mr-2 text-red-600 inline-block" />
|
||||
</template>
|
||||
<template v-if="element.name">
|
||||
{{ element.name }} - <span :class="element.level.textColor">{{ element.level.name }}</span>
|
||||
</template>
|
||||
<template v-else>
|
||||
(Nieokreślony)
|
||||
</template>
|
||||
</template>
|
||||
<template #form="{ element, index }">
|
||||
<div class="gap-4 md:grid md:grid-cols-2 ">
|
||||
<div class="py-4">
|
||||
<label
|
||||
:for="`language-${index}-level`"
|
||||
class="block text-sm font-medium text-gray-700"
|
||||
>
|
||||
Język
|
||||
</label>
|
||||
<div class="mt-2">
|
||||
<Combobox
|
||||
:id="`language-${index}-level`"
|
||||
v-model="element.name"
|
||||
:items="languages"
|
||||
/>
|
||||
<p
|
||||
v-if="form.errors[`languages.${index}.name`]"
|
||||
class="mt-2 text-sm text-red-600"
|
||||
>
|
||||
{{ form.errors[`languages.${index}.name`] }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="py-4">
|
||||
<label
|
||||
:for="`language-level-${index}`"
|
||||
class="block text-sm font-medium text-gray-700"
|
||||
>
|
||||
Poziom - <span :class="element.level.textColor">{{ element.level.name }}</span>
|
||||
</label>
|
||||
<div class="mt-2">
|
||||
<LevelPicker
|
||||
v-model.number="element.level"
|
||||
:levels="languageLevels"
|
||||
/>
|
||||
<p
|
||||
v-if="form.errors[`languages.${index}.level`]"
|
||||
class="mt-2 text-sm text-red-600"
|
||||
>
|
||||
{{ form.errors[`languages.${index}.level`] }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</DynamicSection>
|
||||
<DynamicSection
|
||||
v-model="form.technologies"
|
||||
header="Technologie"
|
||||
add-label="Dodaj technologię"
|
||||
@add-item="addTechnology"
|
||||
@remove-item="(index) => form.technologies.splice(index, 1)"
|
||||
>
|
||||
<template #itemHeader="{ element, index }">
|
||||
<template v-if="hasAnyErrorInSection('technologies', index)">
|
||||
<ExclamationCircleIcon class="h-6 w-6 mr-2 text-red-600 inline-block" />
|
||||
</template>
|
||||
<template v-if="element.name">
|
||||
{{ element.name }} - <span :class="element.level.textColor">{{ element.level.name }}</span>
|
||||
</template>
|
||||
<template v-else>
|
||||
(Nieokreślony)
|
||||
</template>
|
||||
</template>
|
||||
<template #form="{ element, index }">
|
||||
<div class="gap-4 md:grid md:grid-cols-2 ">
|
||||
<div class="py-4">
|
||||
<label
|
||||
:for="`technology-${index}-level`"
|
||||
class="block text-sm font-medium text-gray-700"
|
||||
>
|
||||
Technologia
|
||||
</label>
|
||||
<div class="mt-2">
|
||||
<Combobox
|
||||
:id="`technology-${index}-level`"
|
||||
v-model="element.name"
|
||||
:items="technologies"
|
||||
/>
|
||||
<p
|
||||
v-if="form.errors[`technologies.${index}.name`]"
|
||||
class="mt-2 text-sm text-red-600"
|
||||
>
|
||||
{{ form.errors[`technologies.${index}.name`] }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="py-4">
|
||||
<label
|
||||
:for="`technology-level-${index}`"
|
||||
class="block text-sm font-medium text-gray-700"
|
||||
>
|
||||
Poziom - <span :class="element.level.textColor">{{ element.level.name }}</span>
|
||||
</label>
|
||||
<div class="mt-2">
|
||||
<LevelPicker
|
||||
v-model.number="element.level"
|
||||
:levels="technologyLevels"
|
||||
/>
|
||||
<p
|
||||
v-if="form.errors[`technologies.${index}.level`]"
|
||||
class="mt-2 text-sm text-red-600"
|
||||
>
|
||||
{{ form.errors[`technologies.${index}.level`] }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</DynamicSection>
|
||||
<DynamicSection
|
||||
v-model="form.projects"
|
||||
header="Projekty"
|
||||
add-label="Dodaj projekt"
|
||||
@add-item="addProject"
|
||||
@remove-item="(index) => form.projects.splice(index, 1)"
|
||||
>
|
||||
<template #itemHeader="{ element, index }">
|
||||
<template v-if="hasAnyErrorInSection('projects', index)">
|
||||
<ExclamationCircleIcon class="h-6 w-6 mr-2 text-red-600 inline-block" />
|
||||
</template>
|
||||
{{ element.description ? element.description : '(Nieokreślony)' }}
|
||||
</template>
|
||||
<template #form="{ element, index }">
|
||||
<div class="items-center py-4 sm:grid sm:grid-cols-2">
|
||||
<label
|
||||
:for="`project-description-${index}`"
|
||||
class="block text-sm font-medium text-gray-700 sm:mt-px"
|
||||
>
|
||||
Opis projektu
|
||||
</label>
|
||||
<div class="mt-1 sm:mt-0">
|
||||
<textarea
|
||||
:id="`project-description-${index}`"
|
||||
v-model="element.description"
|
||||
rows="5"
|
||||
class="block w-full rounded-md shadow-sm sm:text-sm"
|
||||
:class="{ 'border-red-300 text-red-900 focus:outline-none focus:ring-red-500 focus:border-red-500': form.errors[`projects.${index}.description`], 'focus:ring-blumilk-500 focus:border-blumilk-500 sm:text-sm border-gray-300': !form.errors[`projects.${index}.description`] }"
|
||||
/>
|
||||
<p
|
||||
v-if="form.errors[`projects.${index}.description`]"
|
||||
class="mt-2 text-sm text-red-600"
|
||||
>
|
||||
{{ form.errors[`projects.${index}.description`] }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="items-center py-4 sm:grid sm:grid-cols-2">
|
||||
<label
|
||||
:for="`project-technologies-${index}`"
|
||||
class="block text-sm font-medium text-gray-700 sm:mt-px"
|
||||
>
|
||||
Technologie
|
||||
</label>
|
||||
<div class="mt-1 sm:mt-0">
|
||||
<MultipleCombobox
|
||||
:id="`project-technologies-${index}`"
|
||||
v-model="element.technologies"
|
||||
:items="technologies"
|
||||
/>
|
||||
<p
|
||||
v-if="form.errors[`projects.${index}.technologies`]"
|
||||
class="mt-2 text-sm text-red-600"
|
||||
>
|
||||
{{ form.errors[`projects.${index}.technologies`] }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="items-center py-4 sm:grid sm:grid-cols-2">
|
||||
<label
|
||||
:for="`project-startDate-${index}`"
|
||||
class="block text-sm font-medium text-gray-700 sm:mt-px"
|
||||
>
|
||||
Data rozpoczęcia
|
||||
</label>
|
||||
<div class="mt-1 sm:mt-0">
|
||||
<MonthPicker
|
||||
:id="`project-startDate-${index}`"
|
||||
v-model="element.startDate"
|
||||
placeholder="Wybierz datę"
|
||||
class="block w-full rounded-md shadow-sm sm:text-sm"
|
||||
:class="{ 'border-red-300 text-red-900 focus:outline-none focus:ring-red-500 focus:border-red-500': form.errors[`projects.${index}.startDate`], 'focus:ring-blumilk-500 focus:border-blumilk-500 sm:text-sm border-gray-300': !form.errors[`projects.${index}.startDate`] }"
|
||||
/>
|
||||
<p
|
||||
v-if="form.errors[`projects.${index}.startDate`]"
|
||||
class="mt-2 text-sm text-red-600"
|
||||
>
|
||||
{{ form.errors[`projects.${index}.startDate`] }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="items-center py-4 sm:grid sm:grid-cols-2">
|
||||
<label
|
||||
:for="`project-endDate-${index}`"
|
||||
class="block text-sm font-medium text-gray-700 sm:mt-px"
|
||||
>
|
||||
Data zakończenia
|
||||
</label>
|
||||
<div class="mt-1 sm:mt-0">
|
||||
<div class="space-y-2">
|
||||
<label class="block text-sm font-medium text-gray-700 sm:mt-px">
|
||||
<input
|
||||
v-model="element.current"
|
||||
type="checkbox"
|
||||
class="focus:ring-blumilk-500 h-4 w-4 text-blumilk-600 border-gray-300 rounded mr-1"
|
||||
>
|
||||
W trakcie
|
||||
</label>
|
||||
<MonthPicker
|
||||
:id="`project-endDate-${index}`"
|
||||
v-model="element.endDate"
|
||||
placeholder="Wybierz datę"
|
||||
:disabled="element.current"
|
||||
class="block w-full rounded-md shadow-sm sm:text-sm disabled:bg-gray-100"
|
||||
:class="{ 'border-red-300 text-red-900 focus:outline-none focus:ring-red-500 focus:border-red-500': form.errors[`projects.${index}.endDate`], 'focus:ring-blumilk-500 focus:border-blumilk-500 sm:text-sm border-gray-300': !form.errors[`projects.${index}.endDate`] }"
|
||||
/>
|
||||
</div>
|
||||
<p
|
||||
v-if="form.errors[`projects.${index}.endDate`]"
|
||||
class="mt-2 text-sm text-red-600"
|
||||
>
|
||||
{{ form.errors[`projects.${index}.endDate`] }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="items-center py-4 sm:grid sm:grid-cols-2">
|
||||
<label
|
||||
:for="`project-tasks-${index}`"
|
||||
class="block text-sm font-medium text-gray-700 sm:mt-px"
|
||||
>
|
||||
Zadania
|
||||
</label>
|
||||
<div class="mt-1 sm:mt-0">
|
||||
<textarea
|
||||
:id="`project-tasks-${index}`"
|
||||
v-model="element.tasks"
|
||||
rows="5"
|
||||
class="block w-full rounded-md shadow-sm sm:text-sm"
|
||||
:class="{ 'border-red-300 text-red-900 focus:outline-none focus:ring-red-500 focus:border-red-500': form.errors[`projects.${index}.tasks`], 'focus:ring-blumilk-500 focus:border-blumilk-500 sm:text-sm border-gray-300': !form.errors[`projects.${index}.tasks`] }"
|
||||
/>
|
||||
<p
|
||||
v-if="form.errors[`projects.${index}.tasks`]"
|
||||
class="mt-2 text-sm text-red-600"
|
||||
>
|
||||
{{ form.errors[`projects.${index}.tasks`] }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</DynamicSection>
|
||||
<div class="pt-5">
|
||||
<div class="flex justify-end">
|
||||
<InertiaLink
|
||||
href="/resumes"
|
||||
class="py-2 px-4 text-sm font-medium text-gray-700 bg-white hover:bg-gray-50 rounded-md border border-gray-300 focus:outline-none focus:ring-2 focus:ring-blumilk-500 focus:ring-offset-2 shadow-sm"
|
||||
>
|
||||
Anuluj
|
||||
</InertiaLink>
|
||||
<button
|
||||
type="submit"
|
||||
class="inline-flex justify-center py-2 px-4 ml-3 text-sm font-medium text-white bg-blumilk-600 hover:bg-blumilk-700 rounded-md border border-transparent focus:outline-none focus:ring-2 focus:ring-blumilk-500 focus:ring-offset-2 shadow-sm"
|
||||
>
|
||||
Zapisz
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { Listbox, ListboxOption, ListboxOptions, ListboxLabel, ListboxButton } from '@headlessui/vue'
|
||||
import { SelectorIcon, CheckIcon } from '@heroicons/vue/outline'
|
||||
import { ExclamationCircleIcon } from '@heroicons/vue/solid'
|
||||
import { useForm } from '@inertiajs/inertia-vue3'
|
||||
import MonthPicker from '@/Shared/Forms/MonthPicker'
|
||||
import DynamicSection from '@/Shared/Forms/DynamicSection'
|
||||
import Combobox from '@/Shared/Forms/Combobox'
|
||||
import MultipleCombobox from '@/Shared/Forms/MultipleCombobox'
|
||||
import LevelPicker from '@/Shared/Forms/LevelPicker'
|
||||
import useLevels from '@/Composables/useLevels'
|
||||
|
||||
const props = defineProps({
|
||||
users: Object,
|
||||
technologies: Array,
|
||||
resume: Object,
|
||||
})
|
||||
|
||||
const { technologyLevels, languageLevels } = useLevels()
|
||||
|
||||
const languages = [
|
||||
'Polish',
|
||||
'English',
|
||||
'German',
|
||||
]
|
||||
|
||||
const form = useForm(`EditResume:${props.resume.id}`,{
|
||||
user: props.users.data.find((user) => user.id === props.resume.user) ?? null,
|
||||
name: props.resume.name ?? null ,
|
||||
educations: props.resume.education ?? [],
|
||||
projects: props.resume.projects ?? [],
|
||||
technologies: props.resume.technologies.map((technology) => ({
|
||||
name: technology.name,
|
||||
level: technologyLevels.find((level) => level.level === technology.level),
|
||||
})) ?? [],
|
||||
languages: props.resume.languages.map((language) => ({
|
||||
name: language.name,
|
||||
level: languageLevels.find((level) => level.level === language.level),
|
||||
})) ?? [],
|
||||
})
|
||||
|
||||
function addProject() {
|
||||
form.projects.push({
|
||||
description: null,
|
||||
technologies: [],
|
||||
tasks: null,
|
||||
startDate: null,
|
||||
endDate: null,
|
||||
current: false,
|
||||
})
|
||||
}
|
||||
|
||||
function addTechnology() {
|
||||
form.technologies.push({
|
||||
name: null,
|
||||
level: technologyLevels[0],
|
||||
})
|
||||
}
|
||||
|
||||
function addEducation() {
|
||||
form.educations.push({
|
||||
school: null,
|
||||
degree: null,
|
||||
fieldOfStudy: null,
|
||||
startDate: null,
|
||||
endDate: null,
|
||||
current: false,
|
||||
})
|
||||
}
|
||||
|
||||
function addLanguage() {
|
||||
form.languages.push({
|
||||
name: null,
|
||||
level: languageLevels[0],
|
||||
})
|
||||
}
|
||||
|
||||
function hasAnyErrorInSection(section, index) {
|
||||
return Object
|
||||
.keys(form.errors)
|
||||
.some((error) => error.startsWith(`${section}.${index}.`))
|
||||
}
|
||||
|
||||
function submitResume() {
|
||||
form
|
||||
.transform((data) => ({
|
||||
user: data.user?.id,
|
||||
name: data.name,
|
||||
education: data.educations.map(education => ({
|
||||
...education,
|
||||
current: !!education.current,
|
||||
endDate: education.current ? null: education.endDate,
|
||||
})),
|
||||
languages: data.languages.map(language => ({
|
||||
name: language.name,
|
||||
level: language.level.level,
|
||||
})),
|
||||
technologies: data.technologies.map(technology => ({
|
||||
name: technology.name,
|
||||
level: technology.level.level,
|
||||
})),
|
||||
projects: data.projects.map(project => ({
|
||||
...project,
|
||||
current: !!project.current,
|
||||
endDate: project.current ? null : project.endDate,
|
||||
})),
|
||||
}))
|
||||
.put(`/resumes/${props.resume.id}`)
|
||||
}
|
||||
</script>
|
199
resources/js/Pages/Resumes/Index.vue
Normal file
199
resources/js/Pages/Resumes/Index.vue
Normal file
@@ -0,0 +1,199 @@
|
||||
<template>
|
||||
<InertiaHead title="CV" />
|
||||
<div class="bg-white shadow-md">
|
||||
<div class="flex justify-between items-center p-4 sm:px-6">
|
||||
<h2 class="text-lg font-medium leading-6 text-gray-900">
|
||||
Lista CV
|
||||
</h2>
|
||||
<div>
|
||||
<InertiaLink
|
||||
href="resumes/create"
|
||||
class="inline-flex items-center py-3 px-4 text-sm font-medium leading-4 text-white bg-blumilk-600 hover:bg-blumilk-700 rounded-md border border-transparent focus:outline-none focus:ring-2 focus:ring-blumilk-500 focus:ring-offset-2 shadow-sm"
|
||||
>
|
||||
Dodaj CV
|
||||
</InertiaLink>
|
||||
</div>
|
||||
</div>
|
||||
<div class="border-t border-gray-200">
|
||||
<div class="overflow-auto xl:overflow-visible">
|
||||
<table class="min-w-full divide-y divide-gray-200">
|
||||
<thead class="bg-gray-50">
|
||||
<tr>
|
||||
<th
|
||||
scope="col"
|
||||
class="py-3 px-4 text-xs font-semibold tracking-wider text-left text-gray-500 uppercase whitespace-nowrap"
|
||||
>
|
||||
Użytkownik
|
||||
</th>
|
||||
<th
|
||||
scope="col"
|
||||
class="py-3 px-4 text-xs font-semibold tracking-wider text-left text-gray-500 uppercase whitespace-nowrap"
|
||||
>
|
||||
Data utworzenia
|
||||
</th>
|
||||
<th
|
||||
scope="col"
|
||||
class="py-3 px-4 text-xs font-semibold tracking-wider text-left text-gray-500 uppercase whitespace-nowrap"
|
||||
>
|
||||
Data aktualizacji
|
||||
</th>
|
||||
<th
|
||||
scope="col"
|
||||
class="py-3 px-4 text-xs font-semibold tracking-wider text-left text-gray-500 uppercase whitespace-nowrap"
|
||||
>
|
||||
Szkoły
|
||||
</th>
|
||||
<th
|
||||
scope="col"
|
||||
class="py-3 px-4 text-xs font-semibold tracking-wider text-left text-gray-500 uppercase whitespace-nowrap"
|
||||
>
|
||||
Języki
|
||||
</th>
|
||||
<th
|
||||
scope="col"
|
||||
class="py-3 px-4 text-xs font-semibold tracking-wider text-left text-gray-500 uppercase whitespace-nowrap"
|
||||
>
|
||||
Technologie
|
||||
</th>
|
||||
<th
|
||||
scope="col"
|
||||
class="py-3 px-4 text-xs font-semibold tracking-wider text-left text-gray-500 uppercase whitespace-nowrap"
|
||||
>
|
||||
Projekty
|
||||
</th>
|
||||
<th
|
||||
scope="col"
|
||||
class="py-3 px-4 text-xs font-semibold tracking-wider text-left text-gray-500 uppercase whitespace-nowrap"
|
||||
/>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="bg-white divide-y divide-gray-100">
|
||||
<tr
|
||||
v-for="resume in resumes.data"
|
||||
:key="resume.id"
|
||||
class="hover:bg-blumilk-25"
|
||||
>
|
||||
<td class="p-4 text-sm text-gray-500 whitespace-nowrap">
|
||||
<div
|
||||
v-if="resume.user"
|
||||
class="flex"
|
||||
>
|
||||
<span class="inline-flex justify-center items-center w-10 h-10 rounded-full">
|
||||
<img
|
||||
class="w-10 h-10 rounded-full"
|
||||
:src="resume.user.avatar"
|
||||
>
|
||||
</span>
|
||||
<div class="ml-3">
|
||||
<p class="text-sm font-medium text-gray-900 break-all">
|
||||
{{ resume.user.name }}
|
||||
</p>
|
||||
<p class="text-sm text-gray-500 break-all">
|
||||
{{ resume.user.email }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<template v-else>
|
||||
<span class="text-sm font-medium text-gray-900 break-all">{{ resume.name }}</span>
|
||||
</template>
|
||||
</td>
|
||||
<td class="p-4 text-sm text-gray-500 whitespace-nowrap">
|
||||
{{ resume.createdAt }}
|
||||
</td>
|
||||
<td class="p-4 text-sm text-gray-500 whitespace-nowrap">
|
||||
{{ resume.updatedAt }}
|
||||
</td>
|
||||
<td class="p-4 text-sm text-gray-500 whitespace-nowrap">
|
||||
{{ resume.educationCount }}
|
||||
</td>
|
||||
<td class="p-4 text-sm text-gray-500 whitespace-nowrap">
|
||||
{{ resume.languageCount }}
|
||||
</td>
|
||||
<td class="p-4 text-sm text-gray-500 whitespace-nowrap">
|
||||
{{ resume.technologyCount }}
|
||||
</td>
|
||||
<td class="p-4 text-sm text-gray-500 whitespace-nowrap">
|
||||
{{ resume.projectCount }}
|
||||
</td>
|
||||
<td class="p-4 text-sm text-right text-gray-500 whitespace-nowrap">
|
||||
<Menu
|
||||
as="div"
|
||||
class="inline-block relative text-left"
|
||||
>
|
||||
<MenuButton class="flex items-center text-gray-400 hover:text-gray-600 rounded-full focus:outline-none focus:ring-2 focus:ring-blumilk-500 focus:ring-offset-2 focus:ring-offset-gray-100">
|
||||
<DotsVerticalIcon class="w-5 h-5" />
|
||||
</MenuButton>
|
||||
|
||||
<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="absolute right-0 z-10 mt-2 w-56 bg-white rounded-md focus:outline-none ring-1 ring-black ring-opacity-5 shadow-lg origin-top-right">
|
||||
<div class="py-1">
|
||||
<MenuItem v-slot="{ active }">
|
||||
<InertiaLink
|
||||
:href="`/resumes/${resume.id}/edit`"
|
||||
:class="[active ? 'bg-gray-100 text-gray-900' : 'text-gray-700', 'font-medium block px-4 py-2 flex text-sm']"
|
||||
>
|
||||
<PencilIcon class="mr-2 w-5 h-5 text-blue-500" /> Edytuj
|
||||
</InertiaLink>
|
||||
</MenuItem>
|
||||
<MenuItem v-slot="{ active }">
|
||||
<a
|
||||
:href="`/resumes/${resume.id}`"
|
||||
:class="[active ? 'bg-gray-100 text-gray-900' : 'text-gray-700', 'block w-full text-left font-medium px-4 py-2 flex text-sm']"
|
||||
>
|
||||
<DownloadIcon class="mr-2 w-5 h-5 text-blumilk-500" /> Pobierz
|
||||
</a>
|
||||
</MenuItem>
|
||||
<MenuItem
|
||||
v-slot="{ active }"
|
||||
class="flex"
|
||||
>
|
||||
<InertiaLink
|
||||
as="button"
|
||||
method="delete"
|
||||
:preserve-scroll="true"
|
||||
:href="`/resumes/${resume.id}`"
|
||||
:class="[active ? 'bg-gray-100 text-gray-900' : 'text-gray-700', 'block w-full text-left font-medium px-4 py-2 text-sm']"
|
||||
>
|
||||
<TrashIcon class="mr-2 w-5 h-5 text-red-500" /> Usuń
|
||||
</InertiaLink>
|
||||
</MenuItem>
|
||||
</div>
|
||||
</MenuItems>
|
||||
</transition>
|
||||
</Menu>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="!resumes.data.length">
|
||||
<td
|
||||
colspan="100%"
|
||||
class="py-4 text-xl leading-5 text-center text-gray-700"
|
||||
>
|
||||
Brak danych
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<Pagination :pagination="resumes.meta" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { DotsVerticalIcon } from '@heroicons/vue/outline'
|
||||
import { DownloadIcon, PencilIcon, TrashIcon } from '@heroicons/vue/solid'
|
||||
import { Menu, MenuButton, MenuItem, MenuItems } from '@headlessui/vue'
|
||||
import Pagination from '@/Shared/Pagination'
|
||||
|
||||
defineProps({
|
||||
resumes: Object,
|
||||
can: Object,
|
||||
})
|
||||
</script>
|
222
resources/js/Pages/Technologies.vue
Normal file
222
resources/js/Pages/Technologies.vue
Normal file
@@ -0,0 +1,222 @@
|
||||
<template>
|
||||
<InertiaHead title="Klucze" />
|
||||
<div class="bg-white shadow-md">
|
||||
<div class="flex justify-between items-center p-4 sm:px-6">
|
||||
<div>
|
||||
<h2 class="text-lg font-medium leading-6 text-gray-900">
|
||||
Technologie
|
||||
</h2>
|
||||
</div>
|
||||
<div>
|
||||
<button
|
||||
type="button"
|
||||
class="inline-flex items-center py-3 px-4 text-sm font-medium leading-4 text-white bg-blumilk-600 hover:bg-blumilk-700 rounded-md border border-transparent focus:outline-none focus:ring-2 focus:ring-blumilk-500 focus:ring-offset-2 shadow-sm"
|
||||
@click="creating = true"
|
||||
>
|
||||
Dodaj technologię
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="border-t border-gray-200">
|
||||
<div class="overflow-auto xl:overflow-visible">
|
||||
<table class="min-w-full divide-y divide-gray-200">
|
||||
<thead class="bg-gray-50">
|
||||
<tr>
|
||||
<th
|
||||
scope="col"
|
||||
class="py-3 px-4 text-xs font-semibold tracking-wider text-left text-gray-500 uppercase whitespace-nowrap"
|
||||
>
|
||||
Technologia
|
||||
</th>
|
||||
<th
|
||||
scope="col"
|
||||
class="py-3 px-4 text-xs font-semibold tracking-wider text-left text-gray-500 uppercase whitespace-nowrap"
|
||||
/>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="bg-white divide-y divide-gray-100">
|
||||
<tr
|
||||
v-for="technology in technologies.data"
|
||||
:key="technology.id"
|
||||
class="hover:bg-blumilk-25"
|
||||
>
|
||||
<td class="px-4 py-2 text-sm text-gray-500 whitespace-nowrap">
|
||||
{{ technology.name }}
|
||||
</td>
|
||||
<td class="px-4 py-2 text-sm text-right text-gray-500 whitespace-nowrap">
|
||||
<Menu
|
||||
as="div"
|
||||
class="inline-block relative text-left"
|
||||
>
|
||||
<MenuButton
|
||||
class="flex items-center text-gray-400 hover:text-gray-600 rounded-full focus:outline-none focus:ring-2 focus:ring-blumilk-500 focus:ring-offset-2 focus:ring-offset-gray-100"
|
||||
>
|
||||
<DotsVerticalIcon class="w-5 h-5" />
|
||||
</MenuButton>
|
||||
|
||||
<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="absolute right-0 z-10 mt-2 w-56 bg-white rounded-md focus:outline-none ring-1 ring-black ring-opacity-5 shadow-lg origin-top-right"
|
||||
>
|
||||
<div class="py-1">
|
||||
<MenuItem
|
||||
v-slot="{ active }"
|
||||
class="flex"
|
||||
>
|
||||
<InertiaLink
|
||||
as="button"
|
||||
method="delete"
|
||||
preserve-scroll
|
||||
:href="`/technologies/${technology.id}`"
|
||||
:class="[active ? 'bg-gray-100 text-gray-900' : 'text-gray-700', 'block w-full text-left font-medium px-4 py-2 text-sm']"
|
||||
>
|
||||
<TrashIcon class="mr-2 w-5 h-5 text-red-500" />
|
||||
Usuń
|
||||
</InertiaLink>
|
||||
</MenuItem>
|
||||
</div>
|
||||
</MenuItems>
|
||||
</transition>
|
||||
</Menu>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="!technologies.data.length">
|
||||
<td
|
||||
colspan="100%"
|
||||
class="py-4 text-xl leading-5 text-center text-gray-700"
|
||||
>
|
||||
Brak danych
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<TransitionRoot
|
||||
as="template"
|
||||
:show="creating"
|
||||
>
|
||||
<Dialog
|
||||
is="div"
|
||||
class="overflow-y-auto fixed inset-0 z-10"
|
||||
@close="creating = false"
|
||||
>
|
||||
<div class="flex justify-center items-end px-4 pt-4 pb-20 min-h-screen text-center sm:block sm:p-0">
|
||||
<TransitionChild
|
||||
as="template"
|
||||
enter="ease-out duration-300"
|
||||
enter-from="opacity-0"
|
||||
enter-to="opacity-100"
|
||||
leave="ease-in duration-200"
|
||||
leave-from="opacity-100"
|
||||
leave-to="opacity-0"
|
||||
>
|
||||
<DialogOverlay class="fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity" />
|
||||
</TransitionChild>
|
||||
|
||||
<span class="hidden sm:inline-block sm:h-screen sm:align-middle">​</span>
|
||||
<TransitionChild
|
||||
as="template"
|
||||
enter="ease-out duration-300"
|
||||
enter-from="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
|
||||
enter-to="opacity-100 translate-y-0 sm:scale-100"
|
||||
leave="ease-in duration-200"
|
||||
leave-from="opacity-100 translate-y-0 sm:scale-100"
|
||||
leave-to="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
|
||||
>
|
||||
<form
|
||||
class="inline-block relative px-4 pt-5 pb-4 text-left align-bottom bg-white rounded-lg shadow-xl transition-all transform sm:p-6 sm:my-8 sm:w-full sm:max-w-sm sm:align-middle"
|
||||
@submit.prevent="submitCreateTechnology"
|
||||
>
|
||||
<div>
|
||||
<div>
|
||||
<DialogTitle
|
||||
as="h3"
|
||||
class="text-lg font-medium leading-6 text-center text-gray-900 font-sembiold"
|
||||
>
|
||||
Dodaj technologię
|
||||
</DialogTitle>
|
||||
<div class="mt-5">
|
||||
<label
|
||||
for="name"
|
||||
class="block text-sm font-medium text-gray-700 sm:mt-px"
|
||||
>
|
||||
Nazwa
|
||||
</label>
|
||||
<div class="mt-2">
|
||||
<input
|
||||
id="name"
|
||||
v-model="form.name"
|
||||
type="text"
|
||||
class="block w-full max-w-lg rounded-md shadow-sm sm:text-sm"
|
||||
:class="{ 'border-red-300 text-red-900 focus:outline-none focus:ring-red-500 focus:border-red-500': form.errors.name, 'focus:ring-blumilk-500 focus:border-blumilk-500 sm:text-sm border-gray-300': !form.errors.name }"
|
||||
>
|
||||
<p
|
||||
v-if="form.errors.name"
|
||||
class="mt-2 text-sm text-red-600"
|
||||
>
|
||||
{{ form.errors.name }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-5 sm:mt-6">
|
||||
<div class="flex justify-end space-x-3">
|
||||
<button
|
||||
type="button"
|
||||
class="py-2 px-4 text-sm font-medium text-gray-700 bg-white hover:bg-gray-50 rounded-md border border-gray-300 focus:outline-none focus:ring-2 focus:ring-blumilk-500 focus:ring-offset-2 shadow-sm"
|
||||
@click="creating = false"
|
||||
>
|
||||
Anuluj
|
||||
</button>
|
||||
<button
|
||||
type="submit"
|
||||
:disabled="form.processing"
|
||||
class="inline-flex justify-center py-2 px-4 text-base font-medium text-white bg-blumilk-600 hover:bg-blumilk-700 rounded-md border border-transparent focus:outline-none focus:ring-2 focus:ring-blumilk-500 focus:ring-offset-2 shadow-sm sm:text-sm"
|
||||
>
|
||||
Dodaj
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</TransitionChild>
|
||||
</div>
|
||||
</Dialog>
|
||||
</TransitionRoot>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { DotsVerticalIcon, TrashIcon } from '@heroicons/vue/solid'
|
||||
import { Menu, MenuButton, MenuItem, MenuItems } from '@headlessui/vue'
|
||||
import { ref } from 'vue'
|
||||
import { Dialog, DialogOverlay, DialogTitle, TransitionChild, TransitionRoot } from '@headlessui/vue'
|
||||
import { useForm } from '@inertiajs/inertia-vue3'
|
||||
|
||||
defineProps({
|
||||
technologies: Object,
|
||||
})
|
||||
|
||||
const creating = ref(false)
|
||||
|
||||
const form = useForm({
|
||||
name: null,
|
||||
})
|
||||
|
||||
function submitCreateTechnology() {
|
||||
form.post('technologies', {
|
||||
preserveState: (page) => Object.keys(page.props.errors).length,
|
||||
preserveScroll: true,
|
||||
onSuccess: () => form.reset(),
|
||||
})
|
||||
}
|
||||
|
||||
</script>
|
68
resources/js/Shared/Forms/Combobox.vue
Normal file
68
resources/js/Shared/Forms/Combobox.vue
Normal file
@@ -0,0 +1,68 @@
|
||||
<template>
|
||||
<Combobox
|
||||
as="div"
|
||||
nullable
|
||||
>
|
||||
<div class="relative">
|
||||
<ComboboxInput
|
||||
:id="id"
|
||||
class="w-full h-12 rounded-md border border-gray-300 bg-white py-2 pl-3 pr-10 shadow-sm focus:border-blumilk-500 focus:outline-none focus:ring-1 focus:ring-blumilk-500 sm:text-sm"
|
||||
@change="query = $event.target.value"
|
||||
/>
|
||||
<ComboboxButton class="absolute inset-y-0 right-0 flex items-center rounded-r-md px-2 focus:outline-none">
|
||||
<SelectorIcon class="h-5 w-5 text-gray-400" />
|
||||
</ComboboxButton>
|
||||
|
||||
<ComboboxOptions
|
||||
v-if="filteredItems.length"
|
||||
class="absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-md bg-white py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm"
|
||||
>
|
||||
<ComboboxOption
|
||||
v-for="item in filteredItems"
|
||||
:key="item.id"
|
||||
v-slot="{ active, selected }"
|
||||
:value="item"
|
||||
as="template"
|
||||
>
|
||||
<li :class="['relative cursor-default select-none py-2 pl-3 pr-9', active ? 'bg-blumilk-600 text-white' : 'text-gray-900']">
|
||||
<span :class="['block truncate', selected && 'font-semibold']">
|
||||
{{ item }}
|
||||
</span>
|
||||
|
||||
<span
|
||||
v-if="selected"
|
||||
:class="['absolute inset-y-0 right-0 flex items-center pr-4', active ? 'text-white' : 'text-blumilk-600']"
|
||||
>
|
||||
<CheckIcon class="h-5 w-5" />
|
||||
</span>
|
||||
</li>
|
||||
</ComboboxOption>
|
||||
</ComboboxOptions>
|
||||
</div>
|
||||
</Combobox>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed, ref } from 'vue'
|
||||
import { CheckIcon, SelectorIcon } from '@heroicons/vue/solid'
|
||||
import {
|
||||
Combobox,
|
||||
ComboboxButton,
|
||||
ComboboxInput,
|
||||
ComboboxOption,
|
||||
ComboboxOptions,
|
||||
} from '@headlessui/vue'
|
||||
|
||||
const props = defineProps({
|
||||
items: Array,
|
||||
id: String,
|
||||
})
|
||||
|
||||
const query = ref('')
|
||||
|
||||
const filteredItems = computed(() =>
|
||||
query.value === ''
|
||||
? props.items
|
||||
: props.items.filter((item) => item.toLowerCase().includes(query.value.toLowerCase())),
|
||||
)
|
||||
</script>
|
113
resources/js/Shared/Forms/DynamicSection.vue
Normal file
113
resources/js/Shared/Forms/DynamicSection.vue
Normal file
@@ -0,0 +1,113 @@
|
||||
<template>
|
||||
<div>
|
||||
<h3 class="text-lg font-medium leading-6 text-gray-900">
|
||||
{{ header }}
|
||||
</h3>
|
||||
<Draggable
|
||||
v-model="items"
|
||||
class="pt-4 space-y-4"
|
||||
tag="transition-group"
|
||||
ghost-class="opacity-50"
|
||||
handle=".handle"
|
||||
:animation="200"
|
||||
:component-data="{tag: 'div', type: 'transition-group'}"
|
||||
:item-key="((item) => items.indexOf(item))"
|
||||
>
|
||||
<template #item="{ element, index }">
|
||||
<div class="group flex items-start space-x-3">
|
||||
<button
|
||||
class="py-4 text-red-500 hover:text-gray-600 opacity-100 group-hover:opacity-100 transition-opacity hover:scale-110 lg:opacity-0 handle"
|
||||
type="button"
|
||||
>
|
||||
<ViewGridIcon class="w-5 h-5 text-gray-500" />
|
||||
</button>
|
||||
<Disclosure
|
||||
v-slot="{ open }"
|
||||
as="div"
|
||||
class="flex-1 border border-gray-200"
|
||||
>
|
||||
<div class="flex">
|
||||
<DisclosureButton class="transition transition-colors rounded-md group w-full max-w-full overflow-hidden flex items-center justify-between p-4 font-semibold text-gray-500 hover:text-blumilk-500 transition transition-colors rounded-md focus:outline-none">
|
||||
<div class="break-all line-clamp-1 text-md">
|
||||
<slot
|
||||
name="itemHeader"
|
||||
:element="element"
|
||||
:index="index"
|
||||
/>
|
||||
</div>
|
||||
<div class="ml-2">
|
||||
<svg
|
||||
:class="[open ? '-rotate-90' : 'rotate-90', 'h-6 w-6 transform transition-transform ease-in-out duration-150']"
|
||||
viewBox="0 0 20 20"
|
||||
>
|
||||
<path
|
||||
d="M6 6L14 10L6 14V6Z"
|
||||
fill="currentColor"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
</DisclosureButton>
|
||||
</div>
|
||||
<DisclosurePanel
|
||||
as="div"
|
||||
class="py-2 px-4 border-t border-gray-200"
|
||||
>
|
||||
<slot
|
||||
name="form"
|
||||
:element="element"
|
||||
:index="index"
|
||||
/>
|
||||
</DisclosurePanel>
|
||||
</Disclosure>
|
||||
<button
|
||||
class="py-4 text-red-500 hover:text-red-600 opacity-100 group-hover:opacity-100 transition-opacity hover:scale-110 lg:opacity-0"
|
||||
type="button"
|
||||
@click="removeItem(index)"
|
||||
>
|
||||
<TrashIcon class="w-5 h-5 text-red-500" />
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
</Draggable>
|
||||
<div class="px-8">
|
||||
<button
|
||||
type="button"
|
||||
class="p-4 mx-auto mt-4 w-full font-semibold text-center text-blumilk-600 hover:bg-blumilk-25 focus:outline-none transition-colors"
|
||||
@click="addItem()"
|
||||
>
|
||||
{{ addLabel }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { Disclosure, DisclosureButton, DisclosurePanel } from '@headlessui/vue'
|
||||
import { TrashIcon, ViewGridIcon } from '@heroicons/vue/outline'
|
||||
import Draggable from 'vuedraggable'
|
||||
import { computed } from 'vue'
|
||||
|
||||
const props = defineProps({
|
||||
header: String,
|
||||
addLabel: String,
|
||||
modelValue: Object,
|
||||
itemHeader: [Function, String],
|
||||
})
|
||||
|
||||
const emit = defineEmits(['update:modelValue', 'addItem', 'removeItem'])
|
||||
|
||||
const items = computed({
|
||||
get: () => props.modelValue,
|
||||
set: (value) => {
|
||||
emit('update:modelValue', value)
|
||||
},
|
||||
})
|
||||
|
||||
function addItem() {
|
||||
emit('addItem')
|
||||
}
|
||||
|
||||
function removeItem(index) {
|
||||
emit('removeItem', index)
|
||||
}
|
||||
</script>
|
46
resources/js/Shared/Forms/LevelPicker.vue
Normal file
46
resources/js/Shared/Forms/LevelPicker.vue
Normal file
@@ -0,0 +1,46 @@
|
||||
<template>
|
||||
<RadioGroup v-model="selectedValue">
|
||||
<div
|
||||
:class="`relative overflow-hidden flex h-12 rounded-l-md rounded-r-md space-x-px ${selectedValue.activeColor} transition-colors duration-200 easy-in-out`"
|
||||
>
|
||||
<RadioGroupOption
|
||||
v-for="(level, index) in levels"
|
||||
:key="index"
|
||||
as="template"
|
||||
:value="level"
|
||||
>
|
||||
<div
|
||||
:class="`${selectedValue.backgroundColor} hover:opacity-80 cursor-pointer transition-colors duration-200 easy-in-out focus:outline-none flex-1`"
|
||||
/>
|
||||
</RadioGroupOption>
|
||||
<div
|
||||
:class="`absolute transform transition-transform duration-200 easy-in-out`"
|
||||
:style="`width: ${100/levels.length}%; transform: translateX(calc(${100 * currentIndex}% - 1px))`"
|
||||
>
|
||||
<div :class="`h-12 ${selectedValue.activeColor} transition-colors duration-300 easy-in-out`" />
|
||||
</div>
|
||||
</div>
|
||||
</RadioGroup>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { RadioGroup, RadioGroupOption } from '@headlessui/vue'
|
||||
import { computed } from 'vue'
|
||||
|
||||
const emit = defineEmits(['update:modelValue'])
|
||||
|
||||
const props = defineProps({
|
||||
levels: Array,
|
||||
modelValue: Object,
|
||||
})
|
||||
|
||||
const selectedValue = computed({
|
||||
get: () => props.modelValue,
|
||||
set: (value) => {
|
||||
emit('update:modelValue', value)
|
||||
},
|
||||
})
|
||||
|
||||
const currentIndex = computed(() => props.levels.findIndex((level) => level.level === selectedValue.value.level))
|
||||
|
||||
</script>
|
18
resources/js/Shared/Forms/MonthPicker.vue
Normal file
18
resources/js/Shared/Forms/MonthPicker.vue
Normal file
@@ -0,0 +1,18 @@
|
||||
<template>
|
||||
<FlatPickr :config="config" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import FlatPickr from 'vue-flatpickr-component'
|
||||
import monthSelectPlugin from 'flatpickr/dist/plugins/monthSelect'
|
||||
|
||||
const config = {
|
||||
plugins: [
|
||||
new monthSelectPlugin({
|
||||
shorthand: true,
|
||||
dateFormat: 'm/Y',
|
||||
}),
|
||||
],
|
||||
}
|
||||
</script>
|
||||
|
108
resources/js/Shared/Forms/MultipleCombobox.vue
Normal file
108
resources/js/Shared/Forms/MultipleCombobox.vue
Normal file
@@ -0,0 +1,108 @@
|
||||
<template>
|
||||
<Combobox
|
||||
v-model="selectedItems"
|
||||
as="div"
|
||||
nullable
|
||||
multiple
|
||||
>
|
||||
<div class="flex flex-wrap gap-3">
|
||||
<span
|
||||
v-for="(item, index) in selectedItems"
|
||||
:key="index"
|
||||
class="inline-flex items-center py-1.5 pl-3 pr-1.5 rounded-lg text-sm font-medium bg-blumilk-500 text-white"
|
||||
>
|
||||
{{ item }}
|
||||
<button
|
||||
type="button"
|
||||
class="flex-shrink-0 ml-0.5 h-5 w-5 rounded-full inline-flex items-center justify-center text-white hover:bg-blumilk-600 focus:outline-none"
|
||||
@click="selectedItems.splice(index, 1)"
|
||||
>
|
||||
<svg
|
||||
class="h-2 w-2"
|
||||
stroke="currentColor"
|
||||
fill="none"
|
||||
viewBox="0 0 8 8"
|
||||
>
|
||||
<path
|
||||
stroke-linecap="round"
|
||||
stroke-width="1.5"
|
||||
d="M1 1l6 6m0-6L1 7"
|
||||
/>
|
||||
</svg>
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
<div class="relative mt-2">
|
||||
<ComboboxInput
|
||||
:id="id"
|
||||
class="w-full rounded-md border border-gray-300 bg-white py-2 pl-3 pr-10 shadow-sm focus:border-blumilk-500 focus:outline-none focus:ring-1 focus:ring-blumilk-500 sm:text-sm"
|
||||
@change="query = $event.target.value"
|
||||
/>
|
||||
<ComboboxButton class="absolute inset-y-0 right-0 flex items-center rounded-r-md px-2 focus:outline-none">
|
||||
<SelectorIcon class="h-5 w-5 text-gray-400" />
|
||||
</ComboboxButton>
|
||||
|
||||
<ComboboxOptions
|
||||
v-if="filteredItems.length"
|
||||
class="absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-md bg-white py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm"
|
||||
>
|
||||
<ComboboxOption
|
||||
v-for="item in filteredItems"
|
||||
:key="item.id"
|
||||
v-slot="{ active, selected }"
|
||||
:value="item"
|
||||
as="template"
|
||||
>
|
||||
<li :class="['relative cursor-default select-none py-2 pl-3 pr-9', active ? 'bg-blumilk-600 text-white' : 'text-gray-900']">
|
||||
<span :class="['block truncate', selected && 'font-semibold']">
|
||||
{{ item }}
|
||||
</span>
|
||||
|
||||
<span
|
||||
v-if="selected"
|
||||
:class="['absolute inset-y-0 right-0 flex items-center pr-4', active ? 'text-white' : 'text-blumilk-600']"
|
||||
>
|
||||
<CheckIcon class="h-5 w-5" />
|
||||
</span>
|
||||
</li>
|
||||
</ComboboxOption>
|
||||
</ComboboxOptions>
|
||||
</div>
|
||||
</Combobox>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed, ref } from 'vue'
|
||||
import { CheckIcon, SelectorIcon } from '@heroicons/vue/solid'
|
||||
import {
|
||||
Combobox,
|
||||
ComboboxButton,
|
||||
ComboboxInput,
|
||||
ComboboxOption,
|
||||
ComboboxOptions,
|
||||
} from '@headlessui/vue'
|
||||
|
||||
const props = defineProps({
|
||||
items: Array,
|
||||
modelValue: Array,
|
||||
id: String,
|
||||
})
|
||||
|
||||
const emit = defineEmits(['update:modelValue'])
|
||||
|
||||
const query = ref('')
|
||||
|
||||
const selectedItems = computed({
|
||||
get: () => props.modelValue,
|
||||
set: (value) => {
|
||||
query.value = ''
|
||||
emit('update:modelValue', value)
|
||||
},
|
||||
})
|
||||
|
||||
const filteredItems = computed(() =>
|
||||
query.value === ''
|
||||
? props.items
|
||||
: props.items.filter((item) => item.toLowerCase().includes(query.value.toLowerCase())),
|
||||
)
|
||||
</script>
|
@@ -59,7 +59,7 @@
|
||||
>
|
||||
</InertiaLink>
|
||||
</div>
|
||||
<nav class="overflow-y-auto shrink-0 mt-5 h-full divide-y divide-blumilk-800">
|
||||
<nav class="overflow-y-auto shrink-0 mt-5 h-full space-y-5">
|
||||
<div class="px-2 space-y-1">
|
||||
<InertiaLink
|
||||
href="/"
|
||||
@@ -70,28 +70,53 @@
|
||||
Strona główna
|
||||
</InertiaLink>
|
||||
</div>
|
||||
<div class="pt-3 mt-3">
|
||||
<div class="py-1 px-2 space-y-1">
|
||||
<InertiaLink
|
||||
v-for="item in navigation"
|
||||
:key="item.name"
|
||||
:href="item.href"
|
||||
:class="[$page.component.startsWith(item.section) ? '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']"
|
||||
@click="sidebarOpen = false;"
|
||||
<div
|
||||
v-if="vacationNavigation.length"
|
||||
class="py-1 px-2 space-y-1"
|
||||
>
|
||||
<InertiaLink
|
||||
v-for="item in vacationNavigation"
|
||||
:key="item.name"
|
||||
:href="item.href"
|
||||
:class="[$page.component.startsWith(item.section) ? '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']"
|
||||
@click="sidebarOpen = false;"
|
||||
>
|
||||
<component
|
||||
:is="item.icon"
|
||||
class="shrink-0 mr-4 w-6 h-6 text-blumilk-200"
|
||||
/>
|
||||
{{ item.name }}
|
||||
<span
|
||||
v-if="item.badge"
|
||||
class="py-0.5 px-2.5 ml-3 text-xs font-semibold text-gray-600 bg-gray-100 rounded-full 2xl:inline-block"
|
||||
>
|
||||
<component
|
||||
:is="item.icon"
|
||||
class="shrink-0 mr-4 w-6 h-6 text-blumilk-200"
|
||||
/>
|
||||
{{ item.name }}
|
||||
<span
|
||||
v-if="item.badge"
|
||||
class="py-0.5 px-2.5 ml-3 text-xs font-semibold text-gray-600 bg-gray-100 rounded-full 2xl:inline-block"
|
||||
>
|
||||
{{ item.badge }}
|
||||
</span>
|
||||
</InertiaLink>
|
||||
</div>
|
||||
{{ item.badge }}
|
||||
</span>
|
||||
</InertiaLink>
|
||||
</div>
|
||||
<div
|
||||
v-if="miscNavigaction.length"
|
||||
class="py-1 px-2 space-y-1"
|
||||
>
|
||||
<InertiaLink
|
||||
v-for="item in miscNavigaction"
|
||||
:key="item.name"
|
||||
:href="item.href"
|
||||
:class="[$page.component.startsWith(item.section) ? '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']"
|
||||
@click="sidebarOpen = false;"
|
||||
>
|
||||
<component
|
||||
:is="item.icon"
|
||||
class="shrink-0 mr-4 w-6 h-6 text-blumilk-200"
|
||||
/>
|
||||
{{ item.name }}
|
||||
<span
|
||||
v-if="item.badge"
|
||||
class="py-0.5 px-2.5 ml-3 text-xs font-semibold text-gray-600 bg-gray-100 rounded-full 2xl:inline-block"
|
||||
>
|
||||
{{ item.badge }}
|
||||
</span>
|
||||
</InertiaLink>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
@@ -110,7 +135,7 @@
|
||||
>
|
||||
</InertiaLink>
|
||||
</div>
|
||||
<nav class="flex overflow-y-auto flex-col flex-1 px-2 mt-5 divide-y divide-blumilk-800">
|
||||
<nav class="flex overflow-y-auto flex-col flex-1 px-2 mt-5 space-y-4">
|
||||
<InertiaLink
|
||||
href="/"
|
||||
:class="[$page.component === 'Dashboard' ? 'bg-blumilk-800 text-white' : 'text-blumilk-100 hover:text-white hover:bg-blumilk-600', 'group flex items-center px-2 py-2 mt-1 text-sm leading-6 font-medium rounded-md']"
|
||||
@@ -118,9 +143,35 @@
|
||||
<HomeIcon class="shrink-0 mr-4 w-6 h-6 text-blumilk-200" />
|
||||
Strona główna
|
||||
</InertiaLink>
|
||||
<div class="pt-1 mt-1 space-y-1">
|
||||
<div
|
||||
v-if="vacationNavigation.length"
|
||||
class="pt-1 mt-1 space-y-1"
|
||||
>
|
||||
<InertiaLink
|
||||
v-for="item in navigation"
|
||||
v-for="item in vacationNavigation"
|
||||
:key="item.name"
|
||||
:href="item.href"
|
||||
:class="[$page.component.startsWith(item.section) ? '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']"
|
||||
>
|
||||
<component
|
||||
:is="item.icon"
|
||||
class="shrink-0 mr-4 w-6 h-6 text-blumilk-200"
|
||||
/>
|
||||
{{ item.name }}
|
||||
<span
|
||||
v-if="item.badge"
|
||||
class="py-0.5 px-2.5 ml-3 text-xs font-semibold text-gray-600 bg-gray-100 rounded-full 2xl:inline-block"
|
||||
>
|
||||
{{ item.badge }}
|
||||
</span>
|
||||
</InertiaLink>
|
||||
</div>
|
||||
<div
|
||||
v-if="miscNavigaction.length"
|
||||
class="pt-1 mt-1 space-y-1"
|
||||
>
|
||||
<InertiaLink
|
||||
v-for="item in miscNavigaction"
|
||||
:key="item.name"
|
||||
:href="item.href"
|
||||
:class="[$page.component.startsWith(item.section) ? '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']"
|
||||
@@ -295,6 +346,7 @@ import {
|
||||
DocumentTextIcon,
|
||||
AdjustmentsIcon,
|
||||
KeyIcon,
|
||||
TemplateIcon, BeakerIcon,
|
||||
} from '@heroicons/vue/outline'
|
||||
import { CheckIcon, ChevronDownIcon } from '@heroicons/vue/solid'
|
||||
|
||||
@@ -306,7 +358,7 @@ const props = defineProps({
|
||||
|
||||
const sidebarOpen = ref(false)
|
||||
|
||||
const navigation = computed(() =>
|
||||
const vacationNavigation = computed(() =>
|
||||
[
|
||||
{
|
||||
name: 'Moje wnioski',
|
||||
@@ -358,20 +410,36 @@ const navigation = computed(() =>
|
||||
icon: ClipboardListIcon,
|
||||
can: true,
|
||||
},
|
||||
{
|
||||
name: 'Użytkownicy',
|
||||
href: '/users',
|
||||
section: 'Users/',
|
||||
icon: UserGroupIcon,
|
||||
can: props.auth.can.manageUsers,
|
||||
},
|
||||
{
|
||||
name: 'Klucze',
|
||||
href: '/keys',
|
||||
section: 'Keys',
|
||||
icon: KeyIcon,
|
||||
can: true,
|
||||
},
|
||||
|
||||
].filter(item => item.can))
|
||||
|
||||
const miscNavigaction = computed(() => [
|
||||
{
|
||||
name: 'Użytkownicy',
|
||||
href: '/users',
|
||||
section: 'Users/',
|
||||
icon: UserGroupIcon,
|
||||
can: props.auth.can.manageUsers,
|
||||
},
|
||||
{
|
||||
name: 'Klucze',
|
||||
href: '/keys',
|
||||
section: 'Keys',
|
||||
icon: KeyIcon,
|
||||
can: true,
|
||||
},
|
||||
{
|
||||
name: 'Technologie',
|
||||
href: '/technologies',
|
||||
section: 'Technologies',
|
||||
icon: BeakerIcon,
|
||||
can: props.auth.can.manageResumes,
|
||||
},
|
||||
{
|
||||
name: 'CV',
|
||||
href: '/resumes',
|
||||
section: 'Resumes',
|
||||
icon: TemplateIcon,
|
||||
can: props.auth.can.manageResumes,
|
||||
},
|
||||
].filter(item => item.can))
|
||||
</script>
|
||||
|
@@ -74,6 +74,11 @@
|
||||
"Key no :number has been given to :user.": "Klucz nr :number został przekazany użytkownikowi :user.",
|
||||
":sender gives key no :key to :recipient": ":sender przekazuje klucz nr :key :recipient",
|
||||
":recipient takes key no :key from :sender": ":recipient zabiera klucz nr :key :sender",
|
||||
"Resume has been updated.": "CV zostało zaktualizowane.",
|
||||
"Resume has been deleted.": "CV zostało usunięte.",
|
||||
"Resume has been created.": "CV zostało utworzone.",
|
||||
"Technology :name has been created.": "Technologia :name została utworzona.",
|
||||
"Technology :name has been deleted.": "Technologia :name została usunięta.",
|
||||
"The vacation request :title has been created successfully.": "Wniosek urlopowy :title został utworzony pomyślnie.",
|
||||
":x: I don't recognize the command. List of all commands:": ":x: Nie rozpoznaję polecenia. Lista wszystkich poleceń:",
|
||||
"Summary for the day :day": "Podsumowanie dla dnia :day",
|
||||
|
21
resources/lang/pl/resume.php
Normal file
21
resources/lang/pl/resume.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
return [
|
||||
"language_levels" => [
|
||||
1 => "A1",
|
||||
2 => "A2",
|
||||
3 => "B1",
|
||||
4 => "B2",
|
||||
5 => "C1",
|
||||
6 => "C2",
|
||||
],
|
||||
"technology_levels" => [
|
||||
1 => "Beginner",
|
||||
2 => "Junior",
|
||||
3 => "Regular",
|
||||
4 => "Advanced",
|
||||
5 => "Expert",
|
||||
],
|
||||
];
|
@@ -114,6 +114,51 @@ return [
|
||||
"uploaded" => "Nie udało się wgrać pliku :attribute.",
|
||||
"url" => "Format pola :attribute jest nieprawidłowy.",
|
||||
"uuid" => "Pole :attribute musi być poprawnym identyfikatorem UUID.",
|
||||
"custom" => [
|
||||
"education.*.school" => [
|
||||
"required" => "Nazwa szkoły jest wymagana.",
|
||||
],
|
||||
"education.*.degree" => [
|
||||
"required" => "Stopień jest wymagany.",
|
||||
],
|
||||
"education.*.fieldOfStudy" => [
|
||||
"required" => "Kierunek jest wymagany.",
|
||||
],
|
||||
"education.*.startDate" => [
|
||||
"required" => "Data rozpoczęcia jest wymagana.",
|
||||
],
|
||||
"education.*.endDate" => [
|
||||
"required" => "Data zakończenia jest wymagana.",
|
||||
"after" => "Data zakończenia musi być datą późniejszą od daty rozpoczęcia.",
|
||||
"required_if" => "Data zakończenia jest wymagana.",
|
||||
],
|
||||
"languages.*.name" => [
|
||||
"distinct" => "Języki nie mogą się powtarzać.",
|
||||
"required" => "Język jest wymagany.",
|
||||
],
|
||||
"technologies.*.name" => [
|
||||
"distinct" => "Technologie nie mogą się powtarzać.",
|
||||
"required" => "Technologia jest wymagana.",
|
||||
],
|
||||
"projects.*.description" => [
|
||||
"required" => "Opis projektu jest wymagany.",
|
||||
],
|
||||
"projects.*.technologies" => [
|
||||
"required" => "Opis projektu jest wymagany.",
|
||||
"min" => "Musi być wybrana co najmniej jedna technologia."
|
||||
],
|
||||
"projects.*.startDate" => [
|
||||
"required" => "Data rozpoczęcia jest wymagana.",
|
||||
],
|
||||
"projects.*.endDate" => [
|
||||
"required" => "Data zakończenia jest wymagana.",
|
||||
"after" => "Data zakończenia musi być datą późniejszą od daty rozpoczęcia.",
|
||||
"required_if" => "Data zakończenia jest wymagana.",
|
||||
],
|
||||
"projects.*.tasks" => [
|
||||
"required" => "Zadania w projekcie są wymagane.",
|
||||
],
|
||||
],
|
||||
"attributes" => [
|
||||
"to" => "do",
|
||||
"from" => "od",
|
||||
|
BIN
resources/views/docx/resume_eng.docx
Normal file
BIN
resources/views/docx/resume_eng.docx
Normal file
Binary file not shown.
Reference in New Issue
Block a user