Changes
This commit is contained in:
Generated
-10
@@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="PHPUnit">
|
||||
<option name="directories">
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/tests" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
@@ -2,10 +2,19 @@
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Enums\EducationalProgramStatus;
|
||||
use App\Enums\PostStatus;
|
||||
use App\Models\AcademicJournal;
|
||||
use App\Models\AdditionalEducation;
|
||||
use App\Models\Department;
|
||||
use App\Models\Division;
|
||||
use App\Models\EducationalProgram;
|
||||
use App\Models\Event;
|
||||
use App\Models\Faculty;
|
||||
use App\Models\LibraryNews;
|
||||
use App\Models\Page;
|
||||
use App\Models\Post;
|
||||
use App\Models\VirtualExhibition;
|
||||
use Illuminate\Console\Command;
|
||||
use Spatie\Sitemap\Sitemap;
|
||||
use Spatie\Sitemap\Tags\Url;
|
||||
@@ -36,6 +45,14 @@ class GenerateSitemap extends Command
|
||||
$this->generatePages($sitemap);
|
||||
$this->generatePosts($sitemap);
|
||||
$this->generateEvents($sitemap);
|
||||
$this->generateFaculties($sitemap);
|
||||
$this->generateDepartments($sitemap);
|
||||
$this->generateDivisisons($sitemap);
|
||||
$this->generateEducationalPrograms($sitemap);
|
||||
$this->generateAdditionalPrograms($sitemap);
|
||||
$this->generateAcademicJournals($sitemap);
|
||||
$this->generateVirtualExhibitions($sitemap);
|
||||
$this->generateLibraryNews($sitemap);
|
||||
|
||||
$sitemap->writeToFile(public_path('sitemap.xml'));
|
||||
}
|
||||
@@ -63,7 +80,7 @@ class GenerateSitemap extends Command
|
||||
|
||||
$this->addUrlsToSitemap($sitemap, $events, function($event) {
|
||||
return [
|
||||
'path' => "/events/{$event->slug}",
|
||||
'path' => route('client.event.show', $event->slug, false),
|
||||
'lastModificationDate' => $event->updated_at,
|
||||
'priority' => 0.5,
|
||||
];
|
||||
@@ -78,13 +95,140 @@ class GenerateSitemap extends Command
|
||||
|
||||
$this->addUrlsToSitemap($sitemap, $posts, function($post) {
|
||||
return [
|
||||
'path' => "/news/{$post->slug}",
|
||||
'path' => route('client.post.show', $post->slug, false),
|
||||
'lastModificationDate' => $post->updated_at,
|
||||
'priority' => 0.5,
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
protected function generateEducationalPrograms(Sitemap $sitemap)
|
||||
{
|
||||
$posts = EducationalProgram::query()
|
||||
->where('status', EducationalProgramStatus::PUBLISHED)
|
||||
->whereHas('admission_plans')
|
||||
->get();
|
||||
|
||||
$this->addUrlsToSitemap($sitemap, $posts, function($program) {
|
||||
return [
|
||||
'path' => route('client.program.show', $program->slug, false),
|
||||
'lastModificationDate' => $program->updated_at,
|
||||
'priority' => 0.5,
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
protected function generateAdditionalPrograms(Sitemap $sitemap)
|
||||
{
|
||||
$posts = AdditionalEducation::query()
|
||||
->where('is_active', true)
|
||||
->get();
|
||||
|
||||
$this->addUrlsToSitemap($sitemap, $posts, function($program) {
|
||||
return [
|
||||
'path' => route('client.additionalProgram.show', $program->slug, false),
|
||||
'lastModificationDate' => $program->updated_at,
|
||||
'priority' => 0.5,
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
protected function generateFaculties(Sitemap $sitemap)
|
||||
{
|
||||
$posts = Faculty::query()
|
||||
->where('is_active', true)
|
||||
->get();
|
||||
|
||||
$this->addUrlsToSitemap($sitemap, $posts, function($faculty) {
|
||||
return [
|
||||
'path' => route('client.faculty.show', $faculty->slug, false),
|
||||
'lastModificationDate' => $faculty->updated_at,
|
||||
'priority' => 0.5,
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
protected function generateDepartments(Sitemap $sitemap)
|
||||
{
|
||||
$posts = Department::query()
|
||||
->with('faculty')
|
||||
->where('is_active', true)
|
||||
->get();
|
||||
|
||||
$this->addUrlsToSitemap($sitemap, $posts, function($department) {
|
||||
return [
|
||||
'path' => route('client.department.show', [
|
||||
'facultySlug' => $department->faculty->slug,
|
||||
'departmentSlug' => $department->slug,
|
||||
], false),
|
||||
'lastModificationDate' => $department->updated_at,
|
||||
'priority' => 0.5,
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
protected function generateDivisisons(Sitemap $sitemap)
|
||||
{
|
||||
$posts = Division::query()
|
||||
->where('is_active', true)
|
||||
->get();
|
||||
|
||||
$this->addUrlsToSitemap($sitemap, $posts, function($division) {
|
||||
return [
|
||||
'path' => route('client.division.show', $division->slug, false),
|
||||
'lastModificationDate' => $division->updated_at,
|
||||
'priority' => 0.5,
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
protected function generateAcademicJournals(Sitemap $sitemap)
|
||||
{
|
||||
$posts = AcademicJournal::query()
|
||||
->where('is_active', true)
|
||||
->get();
|
||||
|
||||
$this->addUrlsToSitemap($sitemap, $posts, function($journal) {
|
||||
return [
|
||||
'path' => route('client.academicJournal.show', $journal->slug, false),
|
||||
'lastModificationDate' => $journal->updated_at,
|
||||
'priority' => 0.5,
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
protected function generateLibraryNews(Sitemap $sitemap)
|
||||
{
|
||||
$posts = LibraryNews::query()
|
||||
->where('is_active', true)
|
||||
->get();
|
||||
|
||||
$this->addUrlsToSitemap($sitemap, $posts, function($journal) {
|
||||
return [
|
||||
'path' => route('client.library.news.show', $journal->slug, false),
|
||||
'lastModificationDate' => $journal->updated_at,
|
||||
'priority' => 0.5,
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
protected function generateVirtualExhibitions(Sitemap $sitemap)
|
||||
{
|
||||
$posts = VirtualExhibition::query()
|
||||
->where('is_active', true)
|
||||
->get();
|
||||
|
||||
$this->addUrlsToSitemap($sitemap, $posts, function($exhibition) {
|
||||
return [
|
||||
'path' => route('client.library.exhibition.show', $exhibition->slug, false),
|
||||
'lastModificationDate' => $exhibition->updated_at,
|
||||
'priority' => 0.5,
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected function addUrlsToSitemap(Sitemap $sitemap, $items, callable $callback)
|
||||
{
|
||||
foreach ($items as $item) {
|
||||
|
||||
@@ -17,7 +17,7 @@ class CreateAcademicJournal extends CreateRecord
|
||||
protected function mutateFormDataBeforeCreate(array $data): array
|
||||
{
|
||||
$this->seoData = $this->generateSeo($data);
|
||||
$data['search_data'] = $this->generateSearchData($data['about_program']);
|
||||
$data['search_data'] = $this->generateSearchData($data['main_info']);
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ class EditAcademicJournal extends EditRecord
|
||||
protected function mutateFormDataBeforeSave(array $data): array
|
||||
{
|
||||
$this->seoData = $this->generateSeo($data);
|
||||
$data['search_data'] = $this->generateSearchData($data['about_program']);
|
||||
$data['search_data'] = $this->generateSearchData($data['main_info']);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
@@ -241,7 +241,7 @@ class EducationalProgramResource extends Resource
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
Tables\Columns\TextColumn::make('name')->sortable(),
|
||||
Tables\Columns\TextColumn::make('name')->sortable()->searchable(),
|
||||
Tables\Columns\TextColumn::make('code_napr'),
|
||||
Tables\Columns\TextColumn::make('directionStudy.lvl_edu')->limit(30),
|
||||
])
|
||||
|
||||
@@ -3,10 +3,38 @@
|
||||
namespace App\Filament\Resources\UserResource\Pages;
|
||||
|
||||
use App\Filament\Resources\UserResource;
|
||||
use App\Models\User;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class CreateUser extends CreateRecord
|
||||
{
|
||||
protected static string $resource = UserResource::class;
|
||||
|
||||
protected function mutateFormDataBeforeCreate(array $data): array
|
||||
{
|
||||
$data['slug'] = $this->generateUniqueSlug($data['name']);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
private function generateUniqueSlug(string $name): string
|
||||
{
|
||||
// Преобразуем имя в slug (например, заменяем пробелы на дефисы и приводим к нижнему регистру)
|
||||
$slug = Str::slug($name);
|
||||
|
||||
// Проверяем, существует ли slug в базе данных
|
||||
$count = 1;
|
||||
$baseSlug = $slug;
|
||||
|
||||
while (User::where('slug', $slug)->exists()) {
|
||||
// Если slug существует, добавляем суффикс
|
||||
$slug = $baseSlug . '-' . $count;
|
||||
$count++;
|
||||
}
|
||||
|
||||
return $slug;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,13 +3,42 @@
|
||||
namespace App\Filament\Resources\UserResource\Pages;
|
||||
|
||||
use App\Filament\Resources\UserResource;
|
||||
use App\Models\User;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class EditUser extends EditRecord
|
||||
{
|
||||
protected static string $resource = UserResource::class;
|
||||
|
||||
protected function mutateFormDataBeforeSave(array $data): array
|
||||
{
|
||||
$data['slug'] = $this->generateUniqueSlug($data['name']);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
private function generateUniqueSlug(string $name): string
|
||||
{
|
||||
// Преобразуем имя в slug (например, заменяем пробелы на дефисы и приводим к нижнему регистру)
|
||||
$slug = Str::slug($name);
|
||||
|
||||
// Проверяем, существует ли slug в базе данных
|
||||
$count = 1;
|
||||
$baseSlug = $slug;
|
||||
|
||||
while (User::where('slug', $slug)->exists()) {
|
||||
// Если slug существует, добавляем суффикс
|
||||
$slug = $baseSlug . '-' . $count;
|
||||
$count++;
|
||||
}
|
||||
|
||||
return $slug;
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
|
||||
@@ -18,9 +18,9 @@ class ClientLibraryNewsController extends Controller
|
||||
return Inertia::render('Client/Library-news/Index', compact('posts'));
|
||||
}
|
||||
|
||||
public function show(string $id)
|
||||
public function show(string $slug)
|
||||
{
|
||||
$post = new ClientLibraryPostListResource(LibraryNews::query()->find($id));
|
||||
$post = new ClientLibraryPostListResource(LibraryNews::query()->where('slug', $slug)->firstOrFail());
|
||||
return Inertia::render('Client/Library-news/Show', compact('post'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,14 +113,15 @@ class ClientProgramController extends Controller
|
||||
|
||||
public function show(string $slug)
|
||||
{
|
||||
$program = new EducationalProgramFullResource(EducationalProgram::query()->where('slug', $slug)->with(['admission_plans', 'directionStudy'])->first());
|
||||
$program = new EducationalProgramFullResource(EducationalProgram::query()->where('slug', $slug)->with(['admission_plans', 'directionStudy'])->firstOrFail());
|
||||
$formsEducational = BudgetEducation::cases();
|
||||
$formsEducational = collect($formsEducational);
|
||||
$formsEdu = $formsEducational->mapWithKeys(function ($formEducational) {
|
||||
return [$formEducational->value => $formEducational->getLabel()];
|
||||
});
|
||||
|
||||
$seo = $this->seo;
|
||||
dd($program);
|
||||
$seo = $program->seo;
|
||||
return Inertia::render('Client/Programs/Show', compact('program', 'formsEdu', 'seo'));
|
||||
}
|
||||
|
||||
@@ -158,41 +159,5 @@ class ClientProgramController extends Controller
|
||||
});
|
||||
}]);
|
||||
}
|
||||
// public function bakalavriat()
|
||||
// {
|
||||
// $naprs = DirectionStudyResource::collection(
|
||||
// DirectionStudy::forBachelorLevel()
|
||||
// ->withActiveAdmissionCampaign()
|
||||
// ->withActivePrograms()
|
||||
// ->get()
|
||||
// );
|
||||
// $campaignName = $this->getAdmissionCampaignName();
|
||||
// return Inertia::render('Client/Programs/Index', compact('naprs', 'campaignName'));
|
||||
// }
|
||||
//
|
||||
// public function spo()
|
||||
// {
|
||||
// $naprs = DirectionStudyResource::collection(
|
||||
// DirectionStudy::forMiddleLevel()
|
||||
// ->withActiveAdmissionCampaign()
|
||||
// ->withActivePrograms()
|
||||
// ->get()
|
||||
// );
|
||||
// $campaignName = $this->getAdmissionCampaignName();
|
||||
// return Inertia::render('Client/Programs/Index', compact('naprs', 'campaignName'));
|
||||
//
|
||||
// }
|
||||
//
|
||||
// public function magistratura()
|
||||
// {
|
||||
// $naprs = DirectionStudyResource::collection(
|
||||
// DirectionStudy::forMasterLevel()
|
||||
// ->withActiveAdmissionCampaign()
|
||||
// ->withActivePrograms()
|
||||
// ->get()
|
||||
// );
|
||||
// $campaignName = $this->getAdmissionCampaignName();
|
||||
// return Inertia::render('Client/Programs/Index', compact('naprs', 'campaignName'));
|
||||
//
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@@ -18,9 +18,9 @@ class ClientVirtualExhibitionController extends Controller
|
||||
return Inertia::render('Client/Library-exhibitions/Index', compact('exhibitions'));
|
||||
}
|
||||
|
||||
public function show(string $id)
|
||||
public function show(string $slug)
|
||||
{
|
||||
$exhibition = new ClientVirtualExhibitionListResource(VirtualExhibition::query()->find($id));
|
||||
$exhibition = new ClientVirtualExhibitionListResource(VirtualExhibition::query()->where('slug', $slug)->firstOrFail());
|
||||
return Inertia::render('Client/Library-exhibitions/Show', compact('exhibition'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,12 +12,8 @@ class GenerateSitemapController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$sitemap = Sitemap::create();
|
||||
|
||||
$this->generatePages($sitemap);
|
||||
$this->generatePosts($sitemap);
|
||||
|
||||
$sitemap->writeToFile(public_path('sitemap.xml'));
|
||||
}
|
||||
|
||||
protected function generatePages(Sitemap $sitemap)
|
||||
|
||||
@@ -43,7 +43,7 @@ class MainController extends Controller
|
||||
|
||||
$path = route('index', null, false);
|
||||
$page = Page::where('path', $path)->first();
|
||||
$seo = $page->seo;
|
||||
$seo = $page->seo ?? null;
|
||||
|
||||
return Inertia::render('Main', compact('posts', 'events', 'sliders', 'educations', 'seo'));
|
||||
}
|
||||
|
||||
@@ -24,9 +24,9 @@ class PersonController extends Controller
|
||||
return Inertia::render('Client/Persons/Index', compact('persons', 'filters'));
|
||||
}
|
||||
|
||||
public function show(string $id)
|
||||
public function show(string $slug)
|
||||
{
|
||||
$person = new ClientFullInfoPersonResource(User::query()->with(['userDetail', 'departments_work.faculty', 'departments_teach.faculty', 'divisions', 'faculties'])->where('id', $id)->firstOrFail());
|
||||
$person = new ClientFullInfoPersonResource(User::query()->with(['userDetail', 'departments_work.faculty', 'departments_teach.faculty', 'divisions', 'faculties'])->where('slug', $slug)->firstOrFail());
|
||||
return Inertia::render('Client/Persons/Show', compact('person'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,4 +22,9 @@ class AcademicJournal extends Model
|
||||
{
|
||||
return $this->hasMany(JournalIssue::class);
|
||||
}
|
||||
|
||||
public function seo()
|
||||
{
|
||||
return $this->morphOne(Seo::class, 'seoable');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ class UserFactory extends Factory
|
||||
{
|
||||
return [
|
||||
'name' => fake()->name(),
|
||||
'slug' => fake()->slug(),
|
||||
'email' => fake()->unique()->safeEmail(),
|
||||
'email_verified_at' => now(),
|
||||
'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->string('slug')->unique()->nullable()->after('name');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->dropColumn('slug');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('library_news', function (Blueprint $table) {
|
||||
$table->string('slug')->unique()->after('title');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('library_news', function (Blueprint $table) {
|
||||
$table->dropColumn('slug');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('virtual_exhibitions', function (Blueprint $table) {
|
||||
$table->string('slug')->unique()->after('title');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('virtual_exhibitions', function (Blueprint $table) {
|
||||
$table->dropColumn('slug');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -28,6 +28,7 @@ class DatabaseSeeder extends Seeder
|
||||
User::create([
|
||||
'name' => 'Failj',
|
||||
'email' => 'Failj@bk.ru',
|
||||
'slug' => 'failj',
|
||||
'password' => "$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi",
|
||||
]);
|
||||
User::factory()->count(50)->has(UserDetail::factory())->create();
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
<template>
|
||||
<div class="">
|
||||
<img @click="toggler = !toggler" class="shrink-0 w-full md:w-[200px] md:h-[300px] rounded-xl object-cover" :src="'/storage/' + photo" alt="Avatar">
|
||||
</div>
|
||||
|
||||
<FsLightbox class="" :toggler="toggler" :sources="[domainPath + '/storage/' + photo]"/>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import slugify from "slugify";
|
||||
import FsLightbox from "fslightbox-vue/v3";
|
||||
|
||||
|
||||
export default {
|
||||
name: "PersonAvatarBlock",
|
||||
components: { FsLightbox },
|
||||
data() {
|
||||
return {
|
||||
toggler: false,
|
||||
domainPath: null,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
generateSlug: function (text) {
|
||||
return slugify(text, {
|
||||
lower: true,
|
||||
strict: true,
|
||||
locale: 'ru'
|
||||
});
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.domainPath = window.location.origin;
|
||||
},
|
||||
props: {
|
||||
photo: {
|
||||
type: String,
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
.fslightbox-container {
|
||||
margin: 0 !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,194 @@
|
||||
<template>
|
||||
<div class="flex justify-between pb-4 items-center">
|
||||
<div class="flex w-full sm:items-center gap-x-5 sm:gap-x-3">
|
||||
<div class="grow">
|
||||
<div class="grid sm:flex sm:justify-between sm:items-center gap-2">
|
||||
<ol v-if="breadcrumbs" class="flex items-center whitespace-normal min-w-0 flex-wrap gap-y-2"
|
||||
aria-label="Breadcrumb">
|
||||
<li class="text-sm">
|
||||
<Link :href="route('index')" class="flex items-center text-gray-500 hover:text-blue-600" href="/">
|
||||
<BaseIcon class="size-5" name="home" />
|
||||
</Link>
|
||||
</li>
|
||||
<li v-if="breadcrumbs.mainSection" class="text-sm">
|
||||
<span class="flex items-center text-gray-500 hover:text-primaryBlue cursor-pointer" @click.prevent="handleSectionClick(breadcrumbs.mainSection)">
|
||||
<svg class="flex-shrink-0 mx-2 overflow-visible h-2.5 w-2.5 text-gray-400"
|
||||
width="16" height="16"
|
||||
viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M5 1L10.6869 7.16086C10.8637 7.35239 10.8637 7.64761 10.6869 7.83914L5 14"
|
||||
stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
|
||||
</svg>
|
||||
{{ textLimit(breadcrumbs.mainSection.data.title, 25) }}
|
||||
</span>
|
||||
</li>
|
||||
<li v-if="breadcrumbs.subSection" class="text-sm">
|
||||
<span class="flex items-center text-gray-500 hover:text-primaryBlue cursor-pointer" @click.prevent="handleSubSectionClick(breadcrumbs.mainSection, breadcrumbs.subSection)">
|
||||
<svg class="flex-shrink-0 mx-2 overflow-visible h-2.5 w-2.5 text-gray-400"
|
||||
width="16" height="16"
|
||||
viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M5 1L10.6869 7.16086C10.8637 7.35239 10.8637 7.64761 10.6869 7.83914L5 14"
|
||||
stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
|
||||
</svg>
|
||||
{{ textLimit(breadcrumbs.subSection.data.title, 25) }}
|
||||
</span>
|
||||
</li>
|
||||
|
||||
<li class="text-sm">
|
||||
<Link :href="$page.props.ziggy.location" class="flex items-center text-gray-500 hover:text-blue-600">
|
||||
<svg class="flex-shrink-0 mx-2 overflow-visible h-2.5 w-2.5 text-gray-400"
|
||||
width="16" height="16"
|
||||
viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M5 1L10.6869 7.16086C10.8637 7.35239 10.8637 7.64761 10.6869 7.83914L5 14"
|
||||
stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
|
||||
</svg>
|
||||
{{ personName }}
|
||||
</Link>
|
||||
</li>
|
||||
</ol>
|
||||
<ol v-if="!breadcrumbs" class="flex items-center whitespace-nowrap min-w-0 flex-wrap"
|
||||
aria-label="Breadcrumb">
|
||||
<li class="text-sm">
|
||||
<Link :href="route('index')" class="flex items-center text-gray-500 hover:text-blue-600" href="/">
|
||||
<BaseIcon class="size-5" name="home" />
|
||||
<svg class="flex-shrink-0 mx-2 overflow-visible h-2.5 w-2.5 text-gray-400"
|
||||
width="16" height="16"
|
||||
viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M5 1L10.6869 7.16086C10.8637 7.35239 10.8637 7.64761 10.6869 7.83914L5 14"
|
||||
stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
|
||||
</svg>
|
||||
</Link>
|
||||
</li>
|
||||
<li class="text-sm">
|
||||
<Link :href="$page.props.ziggy.location" class="flex items-center text-gray-500 hover:text-blue-600">
|
||||
<svg class="flex-shrink-0 mx-2 overflow-visible h-2.5 w-2.5 text-gray-400"
|
||||
width="16" height="16"
|
||||
viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M5 1L10.6869 7.16086C10.8637 7.35239 10.8637 7.64761 10.6869 7.83914L5 14"
|
||||
stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
|
||||
</svg>
|
||||
{{ personName }}
|
||||
</Link>
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {Link} from "@inertiajs/vue3";
|
||||
import slugify from "slugify";
|
||||
import BaseIcon from "@/Components/BaseComponents/BaseIcon.vue";
|
||||
|
||||
export default {
|
||||
name: "PersonBreadcrumbs",
|
||||
components: {BaseIcon, Link},
|
||||
data() {
|
||||
return {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
textLimit(text, symbols) {
|
||||
if (text.length > symbols) {
|
||||
let LimitedText
|
||||
LimitedText = text.substring(0, symbols)
|
||||
return LimitedText + "..."
|
||||
}
|
||||
return text
|
||||
},
|
||||
isMobileDevice() {
|
||||
if (typeof window !== 'undefined') {
|
||||
return window.innerWidth < 1024; // Проверка на мобильные устройства
|
||||
}
|
||||
return false; // По умолчанию возвращаем false, когда не в браузере
|
||||
},
|
||||
handleSectionClick(breadcrumb) {
|
||||
if (this.isMobileDevice()) {
|
||||
this.toggleMobileNavSection(breadcrumb)
|
||||
} else {
|
||||
this.toggleDesktopNavSection(breadcrumb)
|
||||
}
|
||||
},
|
||||
handleSubSectionClick(mainSectionBreadcrumb, breadcrumb) {
|
||||
if (this.isMobileDevice()) {
|
||||
this.toggleMobileNavSubSection(mainSectionBreadcrumb, breadcrumb)
|
||||
} else {
|
||||
this.toggleDesktopNavSubSection(mainSectionBreadcrumb, breadcrumb)
|
||||
}
|
||||
},
|
||||
highlightNavItem(item) {
|
||||
item.classList.add('animate-pulse');
|
||||
|
||||
setTimeout(() => {
|
||||
item.classList.remove('animate-pulse');
|
||||
}, 4000);
|
||||
},
|
||||
openMobileNavMenu() {
|
||||
const openMobileNavBtn = document.getElementById('open-mobile-btn');
|
||||
openMobileNavBtn.click();
|
||||
},
|
||||
toggleMobileNavSubSection(mainSectionBreadcrumb, breadcrumb) {
|
||||
this.openMobileNavMenu()
|
||||
const mobileNavElement = document.getElementById('open-mobile-nav');
|
||||
const sectionNavBlock = mobileNavElement.querySelector('#nav-section-accordion-' + mainSectionBreadcrumb.data.slug);
|
||||
const sectionNavBlockBtn = mobileNavElement.querySelector('#nav-section-accordion-btn-' + mainSectionBreadcrumb.data.slug);
|
||||
if (!sectionNavBlock.classList.contains('active')) {
|
||||
sectionNavBlockBtn.click()
|
||||
}
|
||||
const subSectionNavBlock = mobileNavElement.querySelector('#nav-sub-section-accordion-' + breadcrumb.data.slug);
|
||||
const subSectionNavBlockBtn = mobileNavElement.querySelector('#nav-sub-section-accordion-btn-' + breadcrumb.data.slug);
|
||||
if (subSectionNavBlock.classList.contains('active')) {
|
||||
subSectionNavBlockBtn.click()
|
||||
}
|
||||
|
||||
this.highlightNavItem(subSectionNavBlock)
|
||||
},
|
||||
toggleMobileNavSection(breadcrumb) {
|
||||
const mobileNavElement = document.getElementById('open-mobile-nav');
|
||||
const sectionNavBlock = mobileNavElement.querySelector('#nav-section-accordion-' + breadcrumb.data.slug);
|
||||
const sectionNavBlockBtn = mobileNavElement.querySelector('#nav-section-accordion-btn-' + breadcrumb.data.slug);
|
||||
if (sectionNavBlock.classList.contains('active')) {
|
||||
sectionNavBlockBtn.click()
|
||||
}
|
||||
this.openMobileNavMenu()
|
||||
|
||||
this.highlightNavItem(sectionNavBlock)
|
||||
|
||||
},
|
||||
toggleDesktopNavSubSection(mainSectionBreadcrumb, breadcrumb) {
|
||||
const desktopNavElement = document.getElementById('desktop-nav');
|
||||
const sectionNavTitle = desktopNavElement.querySelector('#nav-sub-section-title-' + breadcrumb.data.slug);
|
||||
const sectionNavBlockBtn = desktopNavElement.querySelector('#nav-section-btn-' + mainSectionBreadcrumb.data.slug);
|
||||
sectionNavBlockBtn.click()
|
||||
this.highlightNavItem(sectionNavTitle)
|
||||
},
|
||||
toggleDesktopNavSection(breadcrumb) {
|
||||
const desktopNavElement = document.getElementById('desktop-nav');
|
||||
const sectionNavBlock = desktopNavElement.querySelector('#nav-section-menu-' + breadcrumb.data.slug);
|
||||
const sectionNavBlockBtn = desktopNavElement.querySelector('#nav-section-btn-' + breadcrumb.data.slug);
|
||||
sectionNavBlockBtn.click()
|
||||
// this.highlightNavItem(sectionNavBlock)
|
||||
},
|
||||
|
||||
|
||||
},
|
||||
|
||||
props: {
|
||||
breadcrumbs: {
|
||||
type: Object,
|
||||
default: () => ({}), // Default to an empty object
|
||||
},
|
||||
personName: {
|
||||
type: String,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -4,7 +4,7 @@
|
||||
<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/' + teacher.photo" alt="Image Description">
|
||||
<div class="grow">
|
||||
<Link :href="route('client.person.show', teacher.id)" class="font-medium text-gray-800 hover:text-gray-500 underline">
|
||||
<Link :href="route('client.person.show', teacher.slug)" class="font-medium text-gray-800 hover:text-gray-500 underline">
|
||||
{{ teacher.position }}: {{ teacher.name }}
|
||||
</Link>
|
||||
<p v-if="teacher.academicTitle !== null" class="text-xs text-gray-500 mt-2">
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<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.id)" class="font-medium text-gray-800 hover:text-gray-500 underline">
|
||||
<Link :href="route('client.person.show', worker.slug)" class="font-medium text-gray-800 hover:text-gray-500 underline">
|
||||
{{ worker.position }}: {{ worker.name }}
|
||||
</Link>
|
||||
<p v-if="worker.academicTitle !== null" class="text-xs text-gray-500 mt-2">
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<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.id)" class="font-medium text-gray-800 hover:text-gray-500 underline">
|
||||
<Link :href="route('client.person.show', worker.slug)" class="font-medium text-gray-800 hover:text-gray-500 underline">
|
||||
{{ worker.position }}: {{ worker.name }}
|
||||
</Link>
|
||||
<p v-if="worker.academicTitle !== null" class="text-xs text-gray-500 mt-2">
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
<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.id)" class="font-medium text-gray-800 hover:text-gray-500 underline">
|
||||
<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">
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<Head>
|
||||
<title>{{ person.data.name }}</title>
|
||||
<meta name="description" content="Your page description">
|
||||
</Head>
|
||||
<AppHead
|
||||
:title="seo?.title"
|
||||
:description="seo?.description"
|
||||
/>
|
||||
|
||||
<div class="flex flex-col h-screen">
|
||||
<MainPageNavBar class="border-b" :sections="$page.props.navigation"></MainPageNavBar>
|
||||
@@ -89,13 +89,13 @@
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<article class="w-full min-w-0 mt-1 max-w-6xl px-1 md:px-6" style="">
|
||||
<section class="w-full min-w-0 mt-1 max-w-6xl px-1 md:px-6" style="">
|
||||
<div class="w-full mx-auto sm:px-6 lg:px-8">
|
||||
|
||||
<PersonBreadcrumbs class="mb-4" :person-name="person.data.name" />
|
||||
<!-- Profile -->
|
||||
<div class="flex items-center gap-x-10 gap-y-4 flex-wrap">
|
||||
<div class="">
|
||||
<img class="shrink-0 w-full md:w-[200px] md:h-[300px] rounded-xl object-cover" :src="'/storage/' + person.data.details.photo" alt="Avatar"> {{ }}
|
||||
</div>
|
||||
<PersonAvatarBlock :photo="person.data.details.photo" />
|
||||
<div class="grow">
|
||||
<h1 class="text-2xl font-medium text-gray-800 dark:text-neutral-200">
|
||||
{{ person.data.name }}
|
||||
@@ -312,7 +312,7 @@
|
||||
<!-- Subscribe -->
|
||||
<!-- End Subscribe -->
|
||||
</div>
|
||||
</article>
|
||||
</section>
|
||||
</div>
|
||||
</main>
|
||||
<ClientFooterDown/>
|
||||
@@ -335,6 +335,9 @@ import { Head } from '@inertiajs/vue3'
|
||||
import slugify from "slugify";
|
||||
import axios from "axios";
|
||||
import MainPageNavBar from "@/Navbars/MainPageNavbar.vue";
|
||||
import AppHead from "@/Components/AppHead.vue";
|
||||
import PersonBreadcrumbs from "@/Components/BuilderUi/Persons/PersonBreadcrumbs.vue";
|
||||
import PersonAvatarBlock from "@/Components/BuilderUi/Persons/PersonAvatarBlock.vue";
|
||||
|
||||
|
||||
export default {
|
||||
@@ -353,6 +356,9 @@ export default {
|
||||
},
|
||||
|
||||
components: {
|
||||
PersonAvatarBlock,
|
||||
PersonBreadcrumbs,
|
||||
AppHead,
|
||||
MainPageNavBar,
|
||||
ClientFooterDown,
|
||||
MainNavbar,
|
||||
|
||||
@@ -79,8 +79,8 @@ export default {
|
||||
|
||||
<template>
|
||||
<AppHead
|
||||
:title="seo.title"
|
||||
:description="seo.description"
|
||||
:title="seo?.title"
|
||||
:description="seo?.description"
|
||||
/>
|
||||
<MainPageNavBar class="border-b" :sections="$page.props.navigation"></MainPageNavBar>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<AppHead
|
||||
:title="seo.title"
|
||||
:description="seo.description"
|
||||
:title="seo?.title"
|
||||
:description="seo?.description"
|
||||
/>
|
||||
<MainPageNavBar :sections="$page.props.navigation" :slider-ref="sliderRef" />
|
||||
<ClientMainSlider @slider-mounted="setSliderRef" :slidersCarousel="sliders" />
|
||||
|
||||
+3
-7
@@ -48,7 +48,7 @@ Route::middleware('access-check')->group(function () {
|
||||
Route::get('/schedule', [ClientScheduleController::class, 'index'])->name('client.schedule');
|
||||
Route::get('/schedule/{id}', [ClientScheduleController::class, 'show'])->name('client.schedule.show');
|
||||
|
||||
Route::get('/persons/{id}', [PersonController::class, 'show'])->name('client.person.show');
|
||||
Route::get('/persons/{slug}', [PersonController::class, 'show'])->name('client.person.show');
|
||||
// Route::get('/students/{student}', [StudentController::class, 'show'])->name('client.student.show')->middleware('auth');
|
||||
|
||||
// Новости
|
||||
@@ -56,14 +56,10 @@ Route::middleware('access-check')->group(function () {
|
||||
Route::get('/news/{slug}', [ClientPostController::class, 'show'])->name('client.post.show');
|
||||
|
||||
// Образовательные программы
|
||||
// Route::get('/programs/{slug}', [ClientProgramController::class, 'index'])->name('client.program.index');
|
||||
|
||||
Route::get('/programs/', [ClientProgramController::class, 'index'])->name('client.program.index');
|
||||
Route::get('/program/{slug}', [ClientProgramController::class, 'show'])->name('client.program.show');
|
||||
|
||||
// Route::get('/programs/bakalavriat/', [ClientProgramController::class, 'bakalavriat'])->name('client.program.bakalavriat');
|
||||
// Route::get('/programs/spo/', [ClientProgramController::class, 'spo'])->name('client.program.spo');
|
||||
// Route::get('/programs/magistratura/', [ClientProgramController::class, 'magistratura'])->name('client.program.magistratura');
|
||||
|
||||
// Образовательные программы
|
||||
Route::get('/additional-education/', [ClientAdditionalEducationController::class, 'index'])->name('client.additionalEducation.index');
|
||||
@@ -75,11 +71,11 @@ Route::middleware('access-check')->group(function () {
|
||||
|
||||
// Заметки библиотеки
|
||||
Route::get('/library/news', [ClientLibraryNewsController::class, 'index'])->name('client.library.news.index'); // Доделать builder
|
||||
Route::get('/library/news/{id}', [ClientLibraryNewsController::class, 'show'])->name('client.library.news.show');
|
||||
Route::get('/library/news/{slug}', [ClientLibraryNewsController::class, 'show'])->name('client.library.news.show');
|
||||
|
||||
// Виртуальные выставки библиотеки
|
||||
Route::get('/library/exhibition', [ClientVirtualExhibitionController::class, 'index'])->name('client.library.exhibition.index'); // Доделать builder
|
||||
Route::get('/library/exhibition/{id}', [ClientVirtualExhibitionController::class, 'show'])->name('client.library.exhibition.show');
|
||||
Route::get('/library/exhibition/{slug}', [ClientVirtualExhibitionController::class, 'show'])->name('client.library.exhibition.show');
|
||||
|
||||
// Вакансии вуза
|
||||
Route::get('/vacant/', [ClientVacantPositionController::class, 'index'])->name('client.vacant.index');
|
||||
|
||||
Reference in New Issue
Block a user