This commit is contained in:
f4ilji
2024-12-25 01:21:39 +05:00
parent a85993895a
commit 4288f0e40d
5 changed files with 11 additions and 5 deletions
+6
View File
@@ -10,10 +10,14 @@ enum FormEducation: int implements HasLabel, HasColor
case FULL_TIME = 1; // Очная форма обучения
case PART_TIME = 2; // Заочная форма обучения
case FULL_PART_TIME = 3; // Заочная форма обучения
public static function fromName(string $name): ?self {
return match ($name) {
'FULL_TIME' => self::FULL_TIME,
'PART_TIME' => self::PART_TIME,
'FULL_PART_TIME' => self::FULL_PART_TIME,
default => null,
};
}
@@ -23,6 +27,7 @@ enum FormEducation: int implements HasLabel, HasColor
return match ($this) {
self::FULL_TIME => 'Очная форма обучения',
self::PART_TIME => 'Заочная форма обучения',
self::FULL_PART_TIME => 'Очно-заочная форма обучения'
};
}
@@ -31,6 +36,7 @@ enum FormEducation: int implements HasLabel, HasColor
return match ($this) {
self::FULL_TIME => 'success', // Цвет для очной формы
self::PART_TIME => 'warning', // Цвет для заочной формы
self::FULL_PART_TIME => 'info',
};
}
}
@@ -32,7 +32,7 @@ class CreateEducationalProgram extends CreateRecord
private function generateSeo(array $data) : array
{
$title = $data['title'];
$title = $data['name'];
$rowData = $this->getFirstBlockByName('paragraph', $data['about_program']);
if ($rowData !== null) {
$description = strip_tags($rowData['data']['content']);
@@ -18,7 +18,7 @@ class EditEducationalProgram extends EditRecord
protected function mutateFormDataBeforeSave(array $data): array
{
$this->seoData = $this->generateSeo($data);
$data['search_data'] = $this->generateSearchData($data['content']);
$data['search_data'] = $this->generateSearchData($data['about_program']);
return $data;
}
@@ -30,7 +30,7 @@ class EditEducationalProgram extends EditRecord
private function generateSeo(array $data) : array
{
$title = $data['title'];
$title = $data['name'];
$rowData = $this->getFirstBlockByName('paragraph', $data['about_program']);
if ($rowData !== null) {
$description = strip_tags($rowData['data']['content']);
@@ -80,7 +80,7 @@ class AdmissionPlansRelationManager extends RelationManager
])
->actions([
Tables\Actions\EditAction::make(),
Tables\Actions\DetachAction::make(),
Tables\Actions\DeleteAction::make(),
])
->bulkActions([
Tables\Actions\BulkActionGroup::make([
@@ -1,6 +1,6 @@
<template>
<h1 class="text-brand-primary text-2xl mb-3 mt-2 md:text-3xl font-semibold tracking-tight dark:text-white lg:text-[40px] lg:leading-tight">
<h1 class="text-brand-primary text-2xl md:text-center mb-3 mt-2 md:text-3xl font-semibold tracking-tight dark:text-white lg:text-[40px] lg:leading-tight">
{{ header }}
</h1>