This commit is contained in:
f4ilji
2024-11-11 15:30:26 +05:00
parent 49bb821361
commit df22d5d19e
12 changed files with 112 additions and 46 deletions
@@ -65,6 +65,7 @@ class FacultyResource extends Resource
$set('seo.title', $state);
}),
TextInput::make('slug')->label('Slug')->unique(ignoreRecord: true)->readOnly()->required(),
TextInput::make('abbreviation')->label('Аббревиатура')->required(),
Toggle::make('is_active')->default(true)->label('Активный факультет')->inline(false),
]),
Tabs\Tab::make('Описание факультета')
+1
View File
@@ -27,6 +27,7 @@ use App\Services\Vicon\EducationalProgram\EducationalProgramService;
use Carbon\Carbon;
use DateTime;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Route;
use Inertia\Inertia;
@@ -17,6 +17,7 @@ class ClientPersonDepartmentPreviewResource extends JsonResource
return [
'id' => $this->id,
'name' => $this->name,
'slug' => $this->slug,
'academicTitle' => $this->userDetail->academicTitle,
'contactPhone' => $this->userDetail->contactPhone,
'contactEmail' => $this->userDetail->contactEmail,
@@ -17,6 +17,7 @@ class ClientPersonDepartmentTeachPreviewResource extends JsonResource
return [
'id' => $this->id,
'name' => $this->name,
'slug' => $this->slug,
'academicTitle' => $this->userDetail->academicTitle,
'contactPhone' => $this->userDetail->contactPhone,
'contactEmail' => $this->userDetail->contactEmail,
@@ -17,6 +17,7 @@ class ClientPersonFacultyPreviewResource extends JsonResource
return [
'id' => $this->id,
'name' => $this->name,
'slug' => $this->slug,
'academicTitle' => $this->userDetail->academicTitle,
'contactPhone' => $this->userDetail->contactPhone,
'contactEmail' => $this->userDetail->contactEmail,
@@ -0,0 +1,19 @@
<?php
namespace App\Http\Resources;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
class FacultySearchResource extends JsonResource
{
/**
* Transform the resource into an array.
*
* @return array<string, mixed>
*/
public function toArray(Request $request): array
{
return parent::toArray($request);
}
}
+1
View File
@@ -17,6 +17,7 @@ class UserResource extends JsonResource
return [
'id' => $this->id,
'name' => $this->name,
'slug' => $this->slug,
'administrativePosition' => $this->pivot->administrativePosition,
'sort' => $this->pivot->sort,
'details' => $this->userDetail,
@@ -0,0 +1,69 @@
<template>
<div class="flex flex-col rounded-xl p-4 md:p-6 bg-white border border-gray-200 dark:bg-slate-900 dark:border-gray-700">
<div class="flex items-center gap-y-4 gap-x-4 flex-wrap">
<img @click="toggler = !toggler" loading="lazy" class="rounded-xl md:w-[150px]" :src="'/storage/' + worker.photo" alt="Image Description">
<div class="grow">
<Link :href="route('client.person.show', worker.slug)" class="font-medium text-gray-800 hover:text-gray-500 underline">
{{ worker.administrativePosition }}: {{ worker.name }}
</Link>
<p v-if="worker.academicTitle !== null" class="text-xs text-gray-500 mt-2">
Ученая степень: {{ worker.academicTitle }}
</p>
<p class="text-xs text-gray-500 mt-2">
Контактный телефон: {{ worker.contactPhone }}
</p>
<p class="text-xs text-gray-500 mt-2">
Электронная почта: {{ worker.contactEmail }}
</p>
<p class="text-xs text-gray-500 mt-2">
Кабинет: 207В
</p>
</div>
</div>
</div>
<FsLightbox class="" :toggler="toggler" :sources="['/storage/' + worker.photo]"/>
</template>
<script>
import {Head, Link} from "@inertiajs/vue3";
import ClientFooterDown from "@/Components/ClientFooterDown.vue";
import MainNavbar from "@/Navbars/MainNavbar.vue";
import FsLightbox from "fslightbox-vue/v3";
export default {
name: "ClientDivisionWorkerCard",
data() {
return {
toggler: false,
}
},
props: {
worker: {
type: Object,
},
},
components: {
ClientFooterDown,
MainNavbar,
Link,
FsLightbox,
Head
},
}
</script>
<style scoped>
</style>
@@ -1,5 +1,5 @@
<template>
<a v-if="item.tag === 'Faculty'" data-hs-overlay="#hs-basic-modal" :href="route('client.post.show', item.data.slug)" class="my-1 flex gap-3 px-2 py-2 items-center hover:bg-[#F2F2F2] rounded-lg">
<a v-if="item.tag === 'Faculty'" data-hs-overlay="#hs-basic-modal" :href="route('client.faculty.show', item.data.slug)" class="my-1 flex gap-3 px-2 py-2 items-center hover:bg-[#F2F2F2] rounded-lg">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
<path stroke-linecap="round" stroke-linejoin="round" d="M18 18.72a9.094 9.094 0 0 0 3.741-.479 3 3 0 0 0-4.682-2.72m.94 3.198.001.031c0 .225-.012.447-.037.666A11.944 11.944 0 0 1 12 21c-2.17 0-4.207-.576-5.963-1.584A6.062 6.062 0 0 1 6 18.719m12 0a5.971 5.971 0 0 0-.941-3.197m0 0A5.995 5.995 0 0 0 12 12.75a5.995 5.995 0 0 0-5.058 2.772m0 0a3 3 0 0 0-4.681 2.72 8.986 8.986 0 0 0 3.74.477m.94-3.197a5.971 5.971 0 0 0-.94 3.197M15 6.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm6 3a2.25 2.25 0 1 1-4.5 0 2.25 2.25 0 0 1 4.5 0Zm-13.5 0a2.25 2.25 0 1 1-4.5 0 2.25 2.25 0 0 1 4.5 0Z" />
</svg>
+2 -25
View File
@@ -74,31 +74,7 @@
<h2 v-if="division.data.workers.length > 0" id="persons" class="font-bold text-xl">Состав</h2>
<template v-for="worker in division.data.workers">
<div class="flex flex-col rounded-xl p-4 md:p-6 bg-white border border-gray-200 dark:bg-slate-900 dark:border-gray-700">
<div class="flex items-center gap-x-4">
<img loading="lazy" class="rounded-xl w-[150px]" :src="'/storage/' + worker.details.photo" alt="Image Description">
<div class="grow">
<Link :href="route('client.person.show', worker.slug)" class="font-medium text-gray-800 hover:text-gray-500 underline">
{{ worker.administrativePosition }}: {{ worker.name }}
</Link>
<p v-if="worker.details.academicTitle" class="text-xs text-gray-500 mt-2">
Ученая степень: {{ worker.details.academicTitle }}
</p>
<p class="text-xs text-gray-500 mt-2">
Контактный телефон: {{ worker.details.contactPhone }}
</p>
<p class="text-xs text-gray-500 mt-2">
Электронная почта: {{ worker.details.contactEmail }}
</p>
<p class="text-xs text-gray-500 mt-2">
Кабинет: 207В
</p>
</div>
</div>
<!-- Social Brands -->
<!-- End Social Brands -->
</div>
<ClientFacultyWorkerCard :worker="worker" />
</template>
@@ -162,6 +138,7 @@ export default {
},
components: {
ClientFacultyWorkerCard,
AppHead,
DivisionItemBreadcrumbs,
DivisionBuilder,
+14 -19
View File
@@ -121,8 +121,6 @@
</template>
</div>
{{ console.log(person) }}
<ul class="mt-5 flex flex-col gap-y-3">
<li class="flex items-center gap-x-2.5">
@@ -316,8 +314,6 @@
<ClientFooterDown/>
</div>
<FsLightbox class="z-1000" :slide="slide" :toggler="toggler" :sources="editorImages"/>
</template>
@@ -364,7 +360,6 @@ export default {
ClientFooterDown,
MainNavbar,
Link,
FsLightbox,
Head
},
methods: {
@@ -400,18 +395,7 @@ export default {
this.scrollTop = false
}
},
scrollToTop() {
window.scrollTo(0, 0)
},
},
mounted() {
window.addEventListener("scroll", this.onScroll)
// this.editorImages = this.blocksWithSlideNumber.filter(block => block.type === 'image').map(block => block.data.file.url);
window.addEventListener("scroll", () => {
handleScroll(e) {
const headings = document.querySelectorAll('h2');
const visor = document.querySelector('#visor');
let lastVisibleHeading = null;
@@ -439,12 +423,23 @@ export default {
break; // Выходим из цикла, если нашли видимый заголовок
}
}
});
},
scrollToTop() {
window.scrollTo(0, 0)
},
},
mounted() {
window.addEventListener("scroll", this.onScroll)
window.addEventListener("scroll", this.handleScroll);
},
beforeDestroy() {
window.removeEventListener('scroll', this.handleScroll);
window.removeEventListener("scroll", this.handleScroll);
window.removeEventListener("scroll", this.onScroll)
},
@@ -45,7 +45,7 @@ export default {
<div class="relative mx-auto mt-[67px] max-w-screen-xl px-4 py-10 md:flex md:flex-row md:py-10">
<article class="w-full min-w-0 mt-4 px-1 md:px-6">
<div class="relative overflow-hidden">
<div class="max-w-[85rem] mx-auto px-4 sm:px-6 lg:px-8 py-10 sm:pb-12 sm:py-5">
<div class="max-w-[85rem] mx-auto sm:px-6 lg:px-8 py-10 sm:pb-12 sm:py-5">
<div class="text-center">
<h1 class="text-2xl sm:text-4xl font-bold text-gray-800 dark:text-gray-200">
Расписание занятий