- add notes
This commit is contained in:
parent
908b1e4bec
commit
2349008131
@ -49,6 +49,7 @@ class CVController extends Controller
|
||||
'mission' => ($mission = $request->get('mission')) === [''] ? [] : $mission,
|
||||
'rodo' => ($rodo =$request->get('rodo')) === '' ? null : $rodo,
|
||||
'position' => $request->get('position'),
|
||||
'notes' => $request->get('notes'),
|
||||
]);
|
||||
return redirect()
|
||||
->route('admin.cv.store')
|
||||
@ -72,6 +73,7 @@ class CVController extends Controller
|
||||
'mission' => ($mission = $request->get('mission')) === [''] ? [] : $mission,
|
||||
'rodo' => ($rodo =$request->get('rodo')) === '' ? null : $rodo,
|
||||
'position' => $request->get('position'),
|
||||
'notes' => $request->get('notes'),
|
||||
]);
|
||||
return redirect()
|
||||
->back()
|
||||
|
@ -18,6 +18,7 @@ class CVRequest extends FormRequest
|
||||
'mission' => 'nullable|string',
|
||||
'rodo' => 'nullable|string',
|
||||
'position' => 'nullable|string',
|
||||
'notes' => 'nullable|string',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@ -21,9 +21,10 @@ class FullCVResource extends JsonResource
|
||||
'locations' => $this->locations,
|
||||
'views' => $this->resource->info()->select('id')->get()->count(),
|
||||
'registeredViews' => $this->views,
|
||||
'position' => $this->position,
|
||||
'mission' => explode(PHP_EOL, $this->mission ?? '', 5),
|
||||
'rodo' => $this->rodo,
|
||||
'position' => $this->position,
|
||||
'notes' => $this->notes,
|
||||
'created' => $this->created_at->format('d-m-Y H:i:s'),
|
||||
'updated' => $this->updated_at->format('d-m-Y H:i:s'),
|
||||
];
|
||||
|
@ -19,6 +19,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
* @property string|null $mission
|
||||
* @property string|null $rodo
|
||||
* @property string|null $position
|
||||
* @property string|null $notes
|
||||
* @property int $views
|
||||
*/
|
||||
class CV extends Model
|
||||
|
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('cvs', function (Blueprint $table) {
|
||||
$table->text('notes')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('cvs', function (Blueprint $table) {
|
||||
$table->dropColumn('notes');
|
||||
});
|
||||
}
|
||||
};
|
@ -32,6 +32,7 @@ const form = useForm({
|
||||
mission: missionToString,
|
||||
rodo: null,
|
||||
position: null,
|
||||
notes: null,
|
||||
});
|
||||
|
||||
function createCV() {
|
||||
@ -85,15 +86,23 @@ function createCV() {
|
||||
/>
|
||||
<Input
|
||||
id="position"
|
||||
label="Stanowisko"
|
||||
label="Stanowisko (opcjonalne)"
|
||||
placeholder="Stanowisko na jakie jest rekrutacja."
|
||||
v-model="form.position"
|
||||
:error="form.errors.position"
|
||||
/>
|
||||
<Input
|
||||
id="notes"
|
||||
type="textarea"
|
||||
label="Notatki (opcjonalne)"
|
||||
placeholder="Notatka dla administratora"
|
||||
v-model="form.notes"
|
||||
:error="form.errors.notes"
|
||||
/>
|
||||
<Input
|
||||
id="mission"
|
||||
type="textarea"
|
||||
label="Misja - wstęp"
|
||||
label="Misja - wstęp (opcjonalne)"
|
||||
placeholder="Krótki opis, list motywacyjny."
|
||||
v-model="form.mission"
|
||||
:error="form.errors.mission"
|
||||
@ -101,7 +110,7 @@ function createCV() {
|
||||
<Input
|
||||
id="rodo"
|
||||
type="textarea"
|
||||
label="RODO"
|
||||
label="RODO (opcjonalne)"
|
||||
placeholder="Klauzula informacyjna RODO"
|
||||
v-model="form.rodo"
|
||||
:error="form.errors.rodo"
|
||||
|
@ -39,6 +39,7 @@ const form = useForm({
|
||||
mission: missionToString,
|
||||
rodo: props.cv.rodo,
|
||||
position: props.cv.position,
|
||||
notes: props.cv.notes,
|
||||
});
|
||||
|
||||
function updateCV() {
|
||||
@ -103,6 +104,14 @@ function updateCV() {
|
||||
v-model="form.position"
|
||||
:error="form.errors.position"
|
||||
/>
|
||||
<Input
|
||||
id="notes"
|
||||
type="textarea"
|
||||
label="Notatki (opcjonalne)"
|
||||
placeholder="Notatka dla administratora"
|
||||
v-model="form.notes"
|
||||
:error="form.errors.notes"
|
||||
/>
|
||||
<Input
|
||||
id="mission"
|
||||
type="textarea"
|
||||
|
@ -1,5 +1,7 @@
|
||||
<script setup>
|
||||
defineProps({
|
||||
import { computed } from 'vue';
|
||||
|
||||
const props = defineProps({
|
||||
cv: {
|
||||
type: Object,
|
||||
required: true,
|
||||
@ -11,6 +13,10 @@ defineProps({
|
||||
});
|
||||
|
||||
const CV_URL = import.meta.env.VITE_CV_APP_URL;
|
||||
const cvNotes = computed(() => {
|
||||
const notes = props.cv.notes;
|
||||
return notes ? props.cv.notes.split("\n") : null;
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@ -75,6 +81,15 @@ const CV_URL = import.meta.env.VITE_CV_APP_URL;
|
||||
<div class="text-gray-500 pb-0.5">Lokalizacje</div>
|
||||
<p class="w-full min-w-full max-w-full px-2.5 py-2 border-b-2 rounded-md bg-white">{{ cv.locations.join(' / ') }}</p>
|
||||
</div>
|
||||
<div class="md:col-span-2">
|
||||
<div v-if="cvNotes" class="text-gray-500 pb-0.5">Notatki</div>
|
||||
<div class="w-full min-w-full max-w-full px-2.5 py-2 border-b-2 rounded-md bg-white">
|
||||
<p
|
||||
v-for="(noteLine, key) in cvNotes"
|
||||
:key="key"
|
||||
>{{ noteLine }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-4">
|
||||
|
Loading…
x
Reference in New Issue
Block a user