This commit is contained in:
f4ilji
2025-01-08 22:48:54 +05:00
parent ad5e26ff0c
commit abc6bcf1ba
16 changed files with 226 additions and 69 deletions
@@ -6,6 +6,7 @@ use App\Enums\CustomFormStatus;
use App\Enums\PostStatus; use App\Enums\PostStatus;
use App\Helpers\ByteConverter; use App\Helpers\ByteConverter;
use App\Models\Category; use App\Models\Category;
use App\Models\ContactWidget;
use App\Models\CustomForm; use App\Models\CustomForm;
use App\Models\Page; use App\Models\Page;
use App\Models\PageReferenceList; use App\Models\PageReferenceList;
@@ -407,6 +408,13 @@ class ContentBuilderItem
->searchable() ->searchable()
->required(), ->required(),
])->label('Ресурсы'), ])->label('Ресурсы'),
Builder\Block::make('contact')
->schema([
Select::make('contact')
->options(ContactWidget::query()->where('is_active', true)->pluck('title', 'slug'))
->searchable()
->required(),
])->label('Контакты'),
]) ])
->collapsed() ->collapsed()
->blockNumbers(false) ->blockNumbers(false)
@@ -0,0 +1,16 @@
<?php
namespace App\Http\Controllers;
use App\Http\Resources\ClientPageReferenceListResource;
use App\Models\ContactWidget;
use App\Models\PageReferenceList;
use Illuminate\Http\Request;
class ClientWidgetContactController extends Controller
{
public function show(string $slug)
{
return new ClientPageReferenceListResource(ContactWidget::query()->where('slug', $slug)->first());
}
}
@@ -0,0 +1,19 @@
<?php
namespace App\Http\Resources;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
class ClientContactWidgetResource extends JsonResource
{
/**
* Transform the resource into an array.
*
* @return array<string, mixed>
*/
public function toArray(Request $request): array
{
return parent::toArray($request);
}
}
@@ -41,6 +41,7 @@ export default {
pageItem: () => import('@/Components/BuilderUi/Pages/Blocks/PageItemBlock.vue'), pageItem: () => import('@/Components/BuilderUi/Pages/Blocks/PageItemBlock.vue'),
customForm: () => import('@/Components/BuilderUi/Pages/Blocks/FormBlock.vue'), customForm: () => import('@/Components/BuilderUi/Pages/Blocks/FormBlock.vue'),
pageResourceList: () => import('@/Components/BuilderUi/Pages/Blocks/PageResourceList.vue'), pageResourceList: () => import('@/Components/BuilderUi/Pages/Blocks/PageResourceList.vue'),
contact: () => import('@/Components/BaseComponents/BaseBuilderUi/Blocks/Contacts/ContactSectionBlock.vue'),
}; };
// Создайте массив промисов для загрузки всех компонентов // Создайте массив промисов для загрузки всех компонентов
@@ -66,6 +67,7 @@ export default {
pageItem: () => import('@/Components/BuilderUi/Pages/Blocks/PageItemBlock.vue'), pageItem: () => import('@/Components/BuilderUi/Pages/Blocks/PageItemBlock.vue'),
customForm: () => import('@/Components/BuilderUi/Pages/Blocks/FormBlock.vue'), customForm: () => import('@/Components/BuilderUi/Pages/Blocks/FormBlock.vue'),
pageResourceList: () => import('@/Components/BuilderUi/Pages/Blocks/PageResourceList.vue'), pageResourceList: () => import('@/Components/BuilderUi/Pages/Blocks/PageResourceList.vue'),
contact: () => import('@/Components/BaseComponents/BaseBuilderUi/Blocks/Contacts/ContactSectionBlock.vue'),
}; };
return defineAsyncComponent(componentMap[type] || null); return defineAsyncComponent(componentMap[type] || null);
}, },
@@ -0,0 +1,37 @@
<template>
<div class="mb-[50px] space-y-3">
<h2 class="font-semibold text-[#1A5AAF] text-lg">{{ title }}</h2>
<div v-for="(item, index) in items" :key="index">
<h3 class="font-semibold mb-4">{{ item.header }}</h3>
<div class="font-light">
<p v-for="(detail, idx) in item.details" :key="idx">
<span v-if="detail.url">
<a :href="detail.url" class="text-blue-500 hover:underline">{{ detail.content }}</a>
</span>
<span v-else>
{{ detail.content }}
</span>
</p>
</div>
</div>
</div>
</template>
<script>
export default {
props: {
title: {
type: String,
required: true,
},
items: {
type: Array,
required: true,
},
},
};
</script>
<style scoped>
/* ваши стили, если необходимо */
</style>
@@ -0,0 +1,104 @@
<template>
<!-- <div v-if="loading" class="flex flex-col space-y-4">-->
<!-- <div class="group block rounded-xl overflow-hidden animate-pulse">-->
<!-- <div class="flex flex-col sm:flex-row sm:items-center gap-3 sm:gap-5">-->
<!-- <div class="shrink-0 relative rounded-xl overflow-hidden w-full sm:w-56 h-44">-->
<!-- <div class="w-full h-full bg-gray-200"></div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<section class="bg-[#F5F5F5] w-full py-10">
<div class="max-w-screen-xl md:flex justify-around w-full mx-auto px-4 py-[50px] flex-wrap">
<ContactGroup v-for="contact in contacts.data.content"
:title="contact.title"
:items="contact.items"
/>
</div>
</section>
</template>
<script>
import ContactGroup from './ContactGroup.vue';
import axios from "axios";
export default {
components: {
ContactGroup,
},
data() {
return {
loading: false,
contacts: null,
contactItems: [
{
header: 'Главный корпус',
details: [
{text: '622031, Нижний Тагил, Красногвардейская 57', url: null},
],
},
{
header: 'Свяжитесь с нами',
details: [
{text: '(3435) 25-48-00', url: null},
{text: 'office@ntspi.ru', url: 'mailto:office@ntspi.ru'},
],
},
],
admissionItems: [
{
header: 'Расписание',
details: [
{text: 'Понедельник - Пятница с 08.30 до 17.00', url: null},
],
},
{
header: 'Ответственный секретарь приемной комиссии',
details: [
{text: '+7(906)-802-55-59', url: null},
{text: 'ntgspi@yandex.ru', url: 'mailto:ntgspi@yandex.ru'},
]
}
],
usefulItems: [
{
header: 'Полезное',
details: [
{text: 'Виртуальный тур', url: 'https://ntspi.ru/panorama/tour.html'},
],
},
],
};
},
methods: {
getContact(id) {
axios.get(route('client.widget.contact.show', id))
.then(response => {
this.contacts = response.data;
this.loading = false; // Установить состояние загрузки в false
})
.catch(error => {
console.error('Ошибка:', error);
});
},
},
mounted() {
const id = this.block?.data.contact || this.contactId
this.getContact(id);
},
props: {
block: {
type: Object,
},
contactId: {
type: String,
default: null,
}
},
};
</script>
<style scoped>
/* ваши стили, если необходимо */
</style>
@@ -8,6 +8,7 @@
</div> </div>
</div> </div>
</div> </div>
<div v-else> <div v-else>
<!-- Card Blog --> <!-- Card Blog -->
@@ -66,7 +67,7 @@ export default {
}, },
methods: { methods: {
getResource(id) { getResource(id) {
axios.get(route('client.widget.page.resource.index', id)) axios.get(route('client.widget.page.resource.show', id))
.then(response => { .then(response => {
this.resource = response.data; this.resource = response.data;
this.loading = false; // Установить состояние загрузки в false this.loading = false; // Установить состояние загрузки в false
@@ -1,21 +1,38 @@
<template> <template>
<div v-if="loading" class="flex flex-col space-y-4"> <div v-if="loading" class="flex flex-col space-y-4">
<div class="group block rounded-xl overflow-hidden animate-pulse"> <div class="group flex justify-center space-x-8 mb-8 flex-wrap rounded-xl overflow-hidden animate-pulse items-center">
<div class="flex flex-col sm:flex-row sm:items-center gap-3 sm:gap-5"> <div class="flex flex-col sm:flex-row sm:items-center gap-3 sm:gap-5">
<div class="shrink-0 relative rounded-xl overflow-hidden w-full sm:w-56 h-44"> <div class="shrink-0 relative rounded-xl overflow-hidden w-full sm:w-56 h-44">
<div class="w-full h-full bg-gray-200"></div> <div class="w-full h-full bg-gray-200"></div>
</div> </div>
</div> </div>
<div class="flex flex-col sm:flex-row sm:items-center gap-3 sm:gap-5">
<div class="shrink-0 relative rounded-xl overflow-hidden w-full sm:w-56 h-44">
<div class="w-full h-full bg-gray-200"></div>
</div>
</div>
<div class="flex flex-col sm:flex-row sm:items-center gap-3 sm:gap-5">
<div class="shrink-0 relative rounded-xl overflow-hidden w-full sm:w-56 h-44">
<div class="w-full h-full bg-gray-200"></div>
</div>
</div>
<div class="flex flex-col sm:flex-row sm:items-center gap-3 sm:gap-5">
<div class="shrink-0 relative rounded-xl overflow-hidden w-full sm:w-56 h-44">
<div class="w-full h-full bg-gray-200"></div>
</div>
</div>
</div> </div>
</div> </div>
<div v-else> <div v-else>
<!-- Card Blog --> <!-- Card Blog -->
<div class="px-0 py-10 sm:px-2 lg:py-14 mx-auto"> <div v-if="resource.data.length !== 0" class="px-0 py-10 sm:px-2 lg:py-14 mx-auto">
<!-- Title --> <!-- Title -->
<div class="max-w-2xl text-center mx-auto mb-10 lg:mb-14"> <div class="max-w-2xl text-center mx-auto mb-10 lg:mb-14">
<h2 class="text-2xl font-bold md:text-4xl md:leading-tight">Полезные ресурсы</h2> <h2 class="text-2xl font-bold md:text-4xl md:leading-tight">Полезные ресурсы</h2>
<p class="mt-1 text-gray-600">We've helped some great companies brand, design and get to market.</p> <p class="mt-1 text-gray-600"></p>
</div> </div>
<!-- End Title --> <!-- End Title -->
@@ -66,7 +83,7 @@ export default {
}, },
methods: { methods: {
getResource(id) { getResource(id) {
axios.get(route('client.widget.page.resource.index', id)) axios.get(route('client.widget.page.resource.show', id))
.then(response => { .then(response => {
this.resource = response.data; this.resource = response.data;
this.loading = false; // Установить состояние загрузки в false this.loading = false; // Установить состояние загрузки в false
@@ -41,6 +41,7 @@ export default {
pageItem: () => import('@/Components/BuilderUi/Pages/Blocks/PageItemBlock.vue'), pageItem: () => import('@/Components/BuilderUi/Pages/Blocks/PageItemBlock.vue'),
customForm: () => import('@/Components/BuilderUi/Pages/Blocks/FormBlock.vue'), customForm: () => import('@/Components/BuilderUi/Pages/Blocks/FormBlock.vue'),
pageResourceList: () => import('@/Components/BuilderUi/Pages/Blocks/PageResourceList.vue'), pageResourceList: () => import('@/Components/BuilderUi/Pages/Blocks/PageResourceList.vue'),
contact: () => import('@/Components/BaseComponents/BaseBuilderUi/Blocks/Contacts/ContactSectionBlock.vue'),
}; };
// Создайте массив промисов для загрузки всех компонентов // Создайте массив промисов для загрузки всех компонентов
@@ -66,6 +67,7 @@ export default {
pageItem: () => import('@/Components/BuilderUi/Pages/Blocks/PageItemBlock.vue'), pageItem: () => import('@/Components/BuilderUi/Pages/Blocks/PageItemBlock.vue'),
customForm: () => import('@/Components/BuilderUi/Pages/Blocks/FormBlock.vue'), customForm: () => import('@/Components/BuilderUi/Pages/Blocks/FormBlock.vue'),
pageResourceList: () => import('@/Components/BuilderUi/Pages/Blocks/PageResourceList.vue'), pageResourceList: () => import('@/Components/BuilderUi/Pages/Blocks/PageResourceList.vue'),
contact: () => import('@/Components/BaseComponents/BaseBuilderUi/Blocks/Contacts/ContactSectionBlock.vue'),
}; };
return defineAsyncComponent(componentMap[type] || null); return defineAsyncComponent(componentMap[type] || null);
}, },
@@ -41,6 +41,7 @@ export default {
pageItem: () => import('@/Components/BuilderUi/Pages/Blocks/PageItemBlock.vue'), pageItem: () => import('@/Components/BuilderUi/Pages/Blocks/PageItemBlock.vue'),
customForm: () => import('@/Components/BuilderUi/Pages/Blocks/FormBlock.vue'), customForm: () => import('@/Components/BuilderUi/Pages/Blocks/FormBlock.vue'),
pageResourceList: () => import('@/Components/BuilderUi/Pages/Blocks/PageResourceList.vue'), pageResourceList: () => import('@/Components/BuilderUi/Pages/Blocks/PageResourceList.vue'),
contact: () => import('@/Components/BaseComponents/BaseBuilderUi/Blocks/Contacts/ContactSectionBlock.vue'),
}; };
// Создайте массив промисов для загрузки всех компонентов // Создайте массив промисов для загрузки всех компонентов
@@ -65,6 +66,7 @@ export default {
pageItem: () => import('@/Components/BuilderUi/Pages/Blocks/PageItemBlock.vue'), pageItem: () => import('@/Components/BuilderUi/Pages/Blocks/PageItemBlock.vue'),
customForm: () => import('@/Components/BuilderUi/Pages/Blocks/FormBlock.vue'), customForm: () => import('@/Components/BuilderUi/Pages/Blocks/FormBlock.vue'),
pageResourceList: () => import('@/Components/BuilderUi/Pages/Blocks/PageResourceList.vue'), pageResourceList: () => import('@/Components/BuilderUi/Pages/Blocks/PageResourceList.vue'),
contact: () => import('@/Components/BaseComponents/BaseBuilderUi/Blocks/Contacts/ContactSectionBlock.vue'),
}; };
return defineAsyncComponent(componentMap[type] || null); return defineAsyncComponent(componentMap[type] || null);
}, },
+1 -2
View File
@@ -56,7 +56,7 @@
import {Link} from "@inertiajs/vue3"; import {Link} from "@inertiajs/vue3";
import axios from "axios"; import axios from "axios";
import ClientGlobalSearch from "@/Components/ClientGlobalSearch.vue"; import ClientGlobalSearch from "@/Components/ClientGlobalSearch.vue";
// import * as isvek from "bvi" import * as isvek from "bvi"
import BaseIcon from "@/Components/BaseComponents/BaseIcon.vue"; import BaseIcon from "@/Components/BaseComponents/BaseIcon.vue";
import MobileNavbar from "@/Navbars/MobileNavbar.vue"; import MobileNavbar from "@/Navbars/MobileNavbar.vue";
import SearchModal from "@/Components/Modals/SearchModal.vue"; import SearchModal from "@/Components/Modals/SearchModal.vue";
@@ -155,7 +155,6 @@ export default {
// theme: 'black', // theme: 'black',
// speech: false, // speech: false,
// reload: true, // reload: true,
// //...etc
// }); // });
// } // }
}, },
@@ -71,7 +71,6 @@ export default {
<div class="max-w-2xl text-center mx-auto mb-10 lg:mb-14"> <div class="max-w-2xl text-center mx-auto mb-10 lg:mb-14">
<h2 class="text-2xl font-bold md:text-4xl md:leading-tight dark:text-white">Научные периодические издания НТГСПИ</h2> <h2 class="text-2xl font-bold md:text-4xl md:leading-tight dark:text-white">Научные периодические издания НТГСПИ</h2>
<p class="mt-1 text-gray-600 dark:text-neutral-400">We've helped some great companies brand, design and get to market.</p>
</div> </div>
<!-- Grid --> <!-- Grid -->
<div class="grid sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-3 gap-3 sm:gap-6"> <div class="grid sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-3 gap-3 sm:gap-6">
@@ -73,11 +73,12 @@ export default {
<div class="max-w-[85rem] px-4 py-10 sm:px-6 lg:px-8 lg:py-14 mx-auto"> <div class="max-w-[85rem] px-4 py-10 sm:px-6 lg:px-8 lg:py-14 mx-auto">
<div class="max-w-2xl text-center mx-auto mb-10 lg:mb-14"> <div class="max-w-2xl text-center mx-auto mb-10 lg:mb-14">
<DivisionListBreadcrumbs />
<h2 class="text-2xl font-bold md:text-4xl md:leading-tight dark:text-white">Подразделения института</h2> <h2 class="text-2xl font-bold md:text-4xl md:leading-tight dark:text-white">Подразделения института</h2>
<p class="mt-1 text-gray-600 dark:text-neutral-400">We've helped some great companies brand, design and get to market.</p> <p class="mt-1 text-gray-600 dark:text-neutral-400">Список структурных и административных отделов НТГСПИ</p>
</div> </div>
<DivisionListBreadcrumbs />
<!-- Grid --> <!-- Grid -->
<div class="grid sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-3 gap-3 sm:gap-6"> <div class="grid sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-3 gap-3 sm:gap-6">
<template v-for="division in divisions.data"> <template v-for="division in divisions.data">
@@ -74,7 +74,7 @@ export default {
<div class="max-w-[85rem] px-0 py-10 sm:px-6 lg:px-8 lg:py-14 mx-auto"> <div class="max-w-[85rem] px-0 py-10 sm:px-6 lg:px-8 lg:py-14 mx-auto">
<div class="max-w-2xl text-center mx-auto mb-10 lg:mb-14"> <div class="max-w-2xl text-center mx-auto mb-10 lg:mb-14">
<h2 class="text-2xl font-bold md:text-4xl md:leading-tight dark:text-white">Факультеты и кафедры</h2> <h2 class="text-2xl font-bold md:text-4xl md:leading-tight dark:text-white">Факультеты и кафедры</h2>
<p class="mt-1 text-gray-600 dark:text-neutral-400">We've helped some great companies brand, design and get to market.</p> <p class="mt-1 text-gray-600 dark:text-neutral-400">Информация о наших факультетах и кафедрах</p>
</div> </div>
<FacultyListBreadcrumbs /> <FacultyListBreadcrumbs />
+4 -53
View File
@@ -145,7 +145,7 @@
Построй свою индивидуальную траекторию Построй свою индивидуальную траекторию
</p> </p>
</div> </div>
<div class="mt-auto p-4 md:p-6 grid grid-cols-2 lg:grid-cols-3 sm:space-y-0 space-y-3"> <div class="mt-auto p-4 md:p-6 grid grid-cols-2 lg:grid-cols-3">
<div class="pb-4"> <div class="pb-4">
<p class="text-2xl font-semibold text-blue-600">{{ educations.additional_education.educations_count }}</p> <p class="text-2xl font-semibold text-blue-600">{{ educations.additional_education.educations_count }}</p>
<p class="mt-1 text-sm text-gray-500">Программ</p> <p class="mt-1 text-sm text-gray-500">Программ</p>
@@ -167,58 +167,7 @@
<!-- End Card Blog --> <!-- End Card Blog -->
</section> </section>
<PageResourceList resource-id="glavnaia-stranica-resurs" /> <PageResourceList resource-id="glavnaia-stranica-resurs" />
<section class="bg-[#F5F5F5] w-full py-10"> <ContactSectionBlock contact-id="glavnaia-stranica-kontakty" />
<div class="max-w-screen-xl md:flex justify-around w-full mx-auto px-4 py-[50px] flex-wrap">
<div class="mb-[50px] space-y-3">
<h2 class="font-semibold text-[#1A5AAF] text-lg">Контакты</h2>
<div>
<h3 class="font-semibold mb-4">Главный корпус</h3>
<div class="font-light">
<p>622031, Нижний Тагил, Красногвардейская 57</p>
</div>
</div>
<div>
<h3 class="font-semibold mb-4">Свяжитесь с нами</h3>
<div class="flex gap-x-3 font-light">
<p>+7(906)-802-55-59</p>
<p>ntgspi@yandex.ru</p>
</div>
</div>
</div>
<div class="mb-[50px] space-y-3">
<h2 class="font-semibold text-[#1A5AAF] text-lg">Приемная комиссия</h2>
<div>
<h3 class="font-semibold mb-4">Расписание</h3>
<div class="font-light">
<p>Понедельник - Пятница с 08.30 до 17.00</p>
</div>
</div>
<div>
<h3 class="font-semibold mb-4">Ответственный секретарь приемной комиссии</h3>
<div class="font-light">
<p>+7(906)-802-55-59</p>
<p>ntgspi@yandex.ru</p>
</div>
</div>
</div>
<div class="space-y-3">
<h2 class="font-semibold text-[#1A5AAF] text-lg">Полезное</h2>
<div>
<h3 class="font-semibold mb-4">Главный корпус</h3>
<div class="font-light">
<p>Понедельник - Пятница <br> с 08.30 до 17.00</p>
</div>
</div>
<div>
<h3 class="font-semibold mb-4">Ответственный секретарь <br> приемной комиссии</h3>
<div class="font-light">
<p>+7(906)-802-55-59</p>
<p>ntgspi@yandex.ru</p>
</div>
</div>
</div>
</div>
</section>
<ClientFooterDown /> <ClientFooterDown />
</template> </template>
@@ -234,6 +183,7 @@ import LevelEducational from "../Enum/LevelEducational.js";
import BaseMetaHead from "@/Components/BaseComponents/BaseMetaHead.vue"; import BaseMetaHead from "@/Components/BaseComponents/BaseMetaHead.vue";
import PageResourceList from "@/Components/BuilderUi/Pages/Blocks/PageResourceList.vue"; import PageResourceList from "@/Components/BuilderUi/Pages/Blocks/PageResourceList.vue";
import AppHead from "@/Components/AppHead.vue"; import AppHead from "@/Components/AppHead.vue";
import ContactSectionBlock from "@/Components/BaseComponents/BaseBuilderUi/Blocks/Contacts/ContactSectionBlock.vue";
@@ -272,6 +222,7 @@ export default {
}, },
components: { components: {
ContactSectionBlock,
AppHead, AppHead,
PageResourceList, PageResourceList,
BaseMetaHead, BaseMetaHead,
+4 -5
View File
@@ -2,6 +2,7 @@
use App\Http\Controllers\api\NavigateController; use App\Http\Controllers\api\NavigateController;
use App\Http\Controllers\ClientWidgetAdditionalEducationalProgramController; use App\Http\Controllers\ClientWidgetAdditionalEducationalProgramController;
use App\Http\Controllers\ClientWidgetContactController;
use App\Http\Controllers\ClientWidgetEducationalProgramController; use App\Http\Controllers\ClientWidgetEducationalProgramController;
use App\Http\Controllers\ClientWidgetFormController; use App\Http\Controllers\ClientWidgetFormController;
use App\Http\Controllers\ClientWidgetPageController; use App\Http\Controllers\ClientWidgetPageController;
@@ -24,10 +25,6 @@ Route::get('/getAcademicYear', function () {
return $activeCampaign->academic_year; return $activeCampaign->academic_year;
})->name('academic.year'); })->name('academic.year');
Route::get('/test', function () {
$service = new DirectionStudyService();
dd($service->getAllNaprsUuid());
});
Route::get('/search', [SearchController::class, 'index'])->name('client.search.index'); Route::get('/search', [SearchController::class, 'index'])->name('client.search.index');
@@ -40,7 +37,9 @@ Route::get('/widget/get-additional-programs', [ClientWidgetAdditionalEducational
Route::get('/widget/get-educational-programs', [ClientWidgetEducationalProgramController::class, 'index'])->name('client.widget.educational.program.index'); Route::get('/widget/get-educational-programs', [ClientWidgetEducationalProgramController::class, 'index'])->name('client.widget.educational.program.index');
Route::get('/widget/get-page-resource/{id}', [ClientWidgetPageReferenceListController::class, 'show'])->name('client.widget.page.resource.index'); Route::get('/widget/get-page-resource/{id}', [ClientWidgetPageReferenceListController::class, 'show'])->name('client.widget.page.resource.show');
Route::get('/widget/get-contact-widget/{id}', [ClientWidgetContactController::class, 'show'])->name('client.widget.contact.show');
Route::get('/widget/get-page/{id}', [ClientWidgetPageController::class, 'single'])->name('client.widget.page.single'); Route::get('/widget/get-page/{id}', [ClientWidgetPageController::class, 'single'])->name('client.widget.page.single');