#134 - fill users data for resume #144
							
								
								
									
										29
									
								
								app/Infrastructure/Http/Controllers/ResumeController.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								app/Infrastructure/Http/Controllers/ResumeController.php
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,29 @@ | ||||
| <?php | ||||
|  | ||||
| declare(strict_types=1); | ||||
|  | ||||
| namespace Toby\Infrastructure\Http\Controllers; | ||||
|  | ||||
| use Illuminate\Auth\Access\AuthorizationException; | ||||
| use Illuminate\Http\RedirectResponse; | ||||
| use Illuminate\Http\Request; | ||||
| use Inertia\Response; | ||||
| use Toby\Eloquent\Helpers\YearPeriodRetriever; | ||||
| use Toby\Eloquent\Models\Holiday; | ||||
| use Toby\Infrastructure\Http\Requests\HolidayRequest; | ||||
| use Toby\Infrastructure\Http\Resources\HolidayFormDataResource; | ||||
| use Toby\Infrastructure\Http\Resources\HolidayResource; | ||||
|  | ||||
| class ResumeController extends Controller | ||||
| { | ||||
|     public function index(Request $request): Response | ||||
|     { | ||||
|         return inertia("Resumes/Index"); | ||||
|     } | ||||
|  | ||||
|     public function create(): Response | ||||
|     { | ||||
|         return inertia("Resumes/Create",[ | ||||
|             ]); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										219
									
								
								resources/js/Pages/Resumes/Create.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										219
									
								
								resources/js/Pages/Resumes/Create.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,219 @@ | ||||
| <template> | ||||
|   <InertiaHead title="Dodawanie CV" /> | ||||
|   <div class="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="px-6 border-t border-gray-200" | ||||
|       @submit.prevent="createResume" | ||||
|     > | ||||
|       <h1 class="text-gray-900 font-medium mt-2">Informacje podstawowe</h1> | ||||
|       <div class="items-center py-4 sm:grid sm:grid-cols-3"> | ||||
|         <label | ||||
|           for="firstName" | ||||
|           class="block text-sm font-medium text-gray-700 sm:mt-px" | ||||
|         > | ||||
|           Imię | ||||
|         </label> | ||||
|         <div class="mt-1 sm:col-span-2 sm:mt-0"> | ||||
|           <input | ||||
|             id="firstName" | ||||
|             v-model="form.firstName" | ||||
|             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.firstName, 'focus:ring-blumilk-500 focus:border-blumilk-500 sm:text-sm border-gray-300': !form.errors.firstName }" | ||||
|           > | ||||
|           <p | ||||
|             v-if="form.errors.firstName" | ||||
|             class="mt-2 text-sm text-red-600" | ||||
|           > | ||||
|             {{ form.errors.firstName }} | ||||
|           </p> | ||||
|         </div> | ||||
|       </div> | ||||
|       <div class="items-center py-4 sm:grid sm:grid-cols-3"> | ||||
|         <label | ||||
|           for="lastName" | ||||
|           class="block text-sm font-medium text-gray-700 sm:mt-px" | ||||
|         > | ||||
|           Nazwisko | ||||
|         </label> | ||||
|         <div class="mt-1 sm:col-span-2 sm:mt-0"> | ||||
|           <input | ||||
|             id="lastName" | ||||
|             v-model="form.lastName" | ||||
|             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.lastName, 'focus:ring-blumilk-500 focus:border-blumilk-500 sm:text-sm border-gray-300': !form.errors.lastName }" | ||||
|           > | ||||
|           <p | ||||
|             v-if="form.errors.lastName" | ||||
|             class="mt-2 text-sm text-red-600" | ||||
|           > | ||||
|             {{ form.errors.lastName }} | ||||
|           </p> | ||||
|         </div> | ||||
|       </div> | ||||
|       <div class="items-center py-4 sm:grid sm:grid-cols-3"> | ||||
|         <label | ||||
|           class="block text-sm font-medium text-gray-700 sm:mt-px" | ||||
|         > | ||||
|           Języki | ||||
|         </label> | ||||
|         <div class="mt-1 sm:col-span-2 sm:mt-0"> | ||||
|           <p>Języki - taki bajer jak na JustJoinIT</p> | ||||
|         </div> | ||||
|       </div> | ||||
|       <h1 class="text-gray-900 font-medium mt-4">Wykształcenie</h1> | ||||
|       <div class="mt-2"> | ||||
|         <InertiaLink | ||||
|           href="#" | ||||
|           class="py-2 px-4 text-sm font-medium text-blumilk-700 bg-white hover:bg-blumilk-25 rounded-md border border-blumilk-300 focus:outline-none focus:ring-2 focus:ring-blumilk-500 focus:ring-offset-2 shadow-sm" | ||||
|         > | ||||
|           Dodaj wykształcenie | ||||
|         </InertiaLink> | ||||
|       </div> | ||||
|        | ||||
|       <div class="items-center py-4 sm:grid sm:grid-cols-3"> | ||||
|        <label | ||||
|          for="university" | ||||
|          class="block text-sm font-medium text-gray-700 sm:mt-px"> | ||||
|          Uczelnia | ||||
|        </label> | ||||
|        <div class="mt-1 sm:col-span-2 sm:mt-0"> | ||||
|          <input | ||||
|            id="university" | ||||
|            v-model="form.firstName" | ||||
|            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.firstName, 'focus:ring-blumilk-500 focus:border-blumilk-500 sm:text-sm border-gray-300': !form.errors.firstName }" | ||||
|          > | ||||
|          <p | ||||
|            v-if="form.errors.firstName" | ||||
|            class="mt-2 text-sm text-red-600" | ||||
|          > | ||||
|            {{ form.errors.firstName }} | ||||
|          </p> | ||||
|        </div> | ||||
|      </div> | ||||
|        <div class="items-center py-4 sm:grid sm:grid-cols-3"> | ||||
|          <label | ||||
|            for="title" | ||||
|            class="block text-sm font-medium text-gray-700 sm:mt-px" | ||||
|          > | ||||
|            Tytuł | ||||
|          </label> | ||||
|          <div class="mt-1 sm:col-span-2 sm:mt-0"> | ||||
|            <input | ||||
|              id="title" | ||||
|              v-model="form.firstName" | ||||
|              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.firstName, 'focus:ring-blumilk-500 focus:border-blumilk-500 sm:text-sm border-gray-300': !form.errors.firstName }" | ||||
|            > | ||||
|            <p | ||||
|              v-if="form.errors.firstName" | ||||
|              class="mt-2 text-sm text-red-600" | ||||
|            > | ||||
|              {{ form.errors.firstName }} | ||||
|            </p> | ||||
|          </div> | ||||
|      </div> | ||||
|      <div class="items-center py-4 sm:grid sm:grid-cols-3"> | ||||
|        <label | ||||
|          for="subject" | ||||
|          class="block text-sm font-medium text-gray-700 sm:mt-px" | ||||
|        > | ||||
|          Kierunek studiów | ||||
|        </label> | ||||
|        <div class="mt-1 sm:col-span-2 sm:mt-0"> | ||||
|          <input | ||||
|            id="subject" | ||||
|            v-model="form.firstName" | ||||
|            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.firstName, 'focus:ring-blumilk-500 focus:border-blumilk-500 sm:text-sm border-gray-300': !form.errors.firstName }" | ||||
|          > | ||||
|          <p | ||||
|            v-if="form.errors.firstName" | ||||
|            class="mt-2 text-sm text-red-600" | ||||
|          > | ||||
|            {{ form.errors.firstName }} | ||||
|          </p> | ||||
|        </div> | ||||
|      </div> | ||||
|       <div class="items-center py-4 sm:grid sm:grid-cols-3"> | ||||
|         <label | ||||
|           for="subject" | ||||
|           class="block text-sm font-medium text-gray-700 sm:mt-px" | ||||
|         > | ||||
|           Rok ukończenia | ||||
|         </label> | ||||
|         <div class="mt-1 sm:col-span-2 sm:mt-0"> | ||||
|           <input | ||||
|             id="subject" | ||||
|             v-model="form.firstName" | ||||
|             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.firstName, 'focus:ring-blumilk-500 focus:border-blumilk-500 sm:text-sm border-gray-300': !form.errors.firstName }" | ||||
|           > | ||||
|           <p | ||||
|             v-if="form.errors.firstName" | ||||
|             class="mt-2 text-sm text-red-600" | ||||
|           > | ||||
|             {{ form.errors.firstName }} | ||||
|           </p> | ||||
|         </div> | ||||
|       </div> | ||||
|       <div class="flex justify-end py-3"> | ||||
|         <div class="space-x-3"> | ||||
|           <InertiaLink | ||||
|             href="/users" | ||||
|             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" | ||||
|             :disabled="form.processing" | ||||
|             class="inline-flex justify-center py-2 px-4 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> | ||||
|     </form> | ||||
|   </div> | ||||
| </template> | ||||
|  | ||||
| <script setup> | ||||
| import { useForm } from '@inertiajs/inertia-vue3' | ||||
| import FlatPickr from 'vue-flatpickr-component' | ||||
| import { Listbox, ListboxButton, ListboxLabel, ListboxOption, ListboxOptions } from '@headlessui/vue' | ||||
| import { CheckIcon, SelectorIcon } from '@heroicons/vue/solid' | ||||
|  | ||||
| const props = defineProps({ | ||||
|   employmentForms: Object, | ||||
|   languages: Object, | ||||
| }) | ||||
|  | ||||
| const form = useForm({ | ||||
|   firstName: null, | ||||
|   lastName: null, | ||||
|   email: null, | ||||
|   position: null, | ||||
|   employmentDate: null, | ||||
| }) | ||||
|  | ||||
| function createResume() { | ||||
|   form | ||||
|     .transform(data => ({ | ||||
|       ...data, | ||||
|       language: data.language.value, | ||||
|     })) | ||||
|     .post('/resumes') | ||||
| } | ||||
| </script> | ||||
							
								
								
									
										139
									
								
								resources/js/Pages/Resumes/Index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										139
									
								
								resources/js/Pages/Resumes/Index.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,139 @@ | ||||
| <template> | ||||
|   <InertiaHead title="CV" /> | ||||
|   <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"> | ||||
|           CV | ||||
|         </h2> | ||||
|       </div> | ||||
|       <div v-if="true"> | ||||
|         <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" | ||||
|             > | ||||
|               Pracownik | ||||
|             </th> | ||||
|             <th | ||||
|               scope="col" | ||||
|               class="py-3 px-4 text-xs font-semibold tracking-wider text-left text-gray-500 uppercase whitespace-nowrap" | ||||
|             > | ||||
|               Data | ||||
|             </th> | ||||
|             <th | ||||
|               scope="col" | ||||
|               class="py-3 px-4 text-xs font-semibold tracking-wider text-left text-gray-500 uppercase whitespace-nowrap" | ||||
|             > | ||||
|               Dzień tygodnia | ||||
|             </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="holiday in holidays.data"--> | ||||
|             <!--              :key="holiday.id"--> | ||||
|             <!--              :class="[holiday.isPast ? 'bg-gray-100' : 'hover:bg-blumilk-25']"--> | ||||
|             <td class="p-4 text-sm font-semibold text-gray-700 capitalize whitespace-nowrap"> | ||||
|               Jan Kowalski | ||||
|             </td> | ||||
|             <td class="p-4 text-sm text-gray-500 whitespace-nowrap"> | ||||
|               xd | ||||
|             </td> | ||||
|             <td class="p-4 text-sm text-gray-500 whitespace-nowrap"> | ||||
|               xd | ||||
|             </td> | ||||
|             <td class="p-4 text-sm text-right text-gray-500 whitespace-nowrap"> | ||||
|               <!--                <Menu--> | ||||
|               <!--                  v-if="true"--> | ||||
|               <!--                  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"--> | ||||
|               <!--                      aria-hidden="true"--> | ||||
|               <!--                    />--> | ||||
|               <!--                  </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--> | ||||
|               <!--                            :href="`/resumes/${holiday.id}/edit`"--> | ||||
|               <!--                            :class="[active ? 'bg-gray-100 text-gray-900' : 'text-gray-700', 'font-medium block px-4 py-2 text-sm']"--> | ||||
|               <!--                          >--> | ||||
|               <!--                            <PencilIcon class="mr-2 w-5 h-5 text-blue-500" /> Edytuj--> | ||||
|               <!--                          </InertiaLink>--> | ||||
|               <!--                        </MenuItem>--> | ||||
|               <!--                        <MenuItem--> | ||||
|               <!--                          v-slot="{ active }"--> | ||||
|               <!--                          class="flex"--> | ||||
|               <!--                        >--> | ||||
|               <!--                          <InertiaLink--> | ||||
|               <!--                            as="button"--> | ||||
|               <!--                            method="delete"--> | ||||
|               <!--                            :preserve-scroll="true"--> | ||||
|               <!--                            :href="`/holidays/${holiday.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="!true"> | ||||
|             <td | ||||
|               colspan="100%" | ||||
|               class="py-4 text-xl leading-5 text-center text-gray-700" | ||||
|             > | ||||
|               Brak danych | ||||
|             </td> | ||||
|           </tr> | ||||
|           </tbody> | ||||
|         </table> | ||||
|       </div> | ||||
|     </div> | ||||
|   </div> | ||||
| </template> | ||||
|  | ||||
| <script setup> | ||||
| import { DotsVerticalIcon, PencilIcon, TrashIcon } from '@heroicons/vue/solid' | ||||
| import { Menu, MenuButton, MenuItem, MenuItems } from '@headlessui/vue' | ||||
|  | ||||
| defineProps({ | ||||
|   holidays: Object, | ||||
|   can: Object, | ||||
| }) | ||||
| </script> | ||||
| @@ -295,6 +295,7 @@ import { | ||||
|   DocumentTextIcon, | ||||
|   AdjustmentsIcon, | ||||
|   KeyIcon, | ||||
|   TemplateIcon, | ||||
| } from '@heroicons/vue/outline' | ||||
| import { CheckIcon, ChevronDownIcon } from '@heroicons/vue/solid' | ||||
|  | ||||
| @@ -372,6 +373,13 @@ const navigation = computed(() => | ||||
|       icon: KeyIcon, | ||||
|       can: true, | ||||
|     }, | ||||
|     { | ||||
|       name: 'CV', | ||||
|       href: '/resumes', | ||||
|       section: 'Resumes', | ||||
|       icon: TemplateIcon, | ||||
|       can: true, | ||||
|     } | ||||
|  | ||||
|   ].filter(item => item.can)) | ||||
| </script> | ||||
|   | ||||
| @@ -10,6 +10,7 @@ use Toby\Infrastructure\Http\Controllers\HolidayController; | ||||
| use Toby\Infrastructure\Http\Controllers\KeysController; | ||||
| use Toby\Infrastructure\Http\Controllers\LogoutController; | ||||
| use Toby\Infrastructure\Http\Controllers\MonthlyUsageController; | ||||
| use Toby\Infrastructure\Http\Controllers\ResumeController; | ||||
| use Toby\Infrastructure\Http\Controllers\SelectYearPeriodController; | ||||
| use Toby\Infrastructure\Http\Controllers\TimesheetController; | ||||
| use Toby\Infrastructure\Http\Controllers\UserController; | ||||
| @@ -34,6 +35,9 @@ Route::middleware(["auth", TrackUserLastActivity::class])->group(function (): vo | ||||
|         ->except("show") | ||||
|         ->whereNumber("holiday"); | ||||
|  | ||||
|     Route::resource("resumes", ResumeController::class) | ||||
|         ->whereNumber("resume"); | ||||
|  | ||||
|     Route::get("/keys", [KeysController::class, "index"]); | ||||
|     Route::post("/keys", [KeysController::class, "store"]); | ||||
|     Route::delete("/keys/{key}", [KeysController::class, "destroy"]); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user