From 5cfa777a6b9759634cbd5b84ca8e24b60fd326a8 Mon Sep 17 00:00:00 2001 From: F4ilji Date: Sun, 20 Apr 2025 13:15:33 +0500 Subject: [PATCH] fixing VK api, changes in post gallery, added sections in main page --- .../Filament/Domain/Posts/VkPostPublisher.php | 1 + app/Services/VK/Album/VkAlbumService.php | 4 +- resources/js/Pages/Main.vue | 172 ++---------------- .../events/components/EventListItem.vue | 56 ++++++ .../features/mainPage/EducationSection.vue | 100 ++++++++++ .../features/mainPage/EventSection.vue | 39 ++++ .../features/mainPage/PostSection.vue | 36 ++++ .../features/posts/components/PostGallery.vue | 31 ++-- 8 files changed, 265 insertions(+), 174 deletions(-) create mode 100644 resources/js/componentss/features/events/components/EventListItem.vue create mode 100644 resources/js/componentss/features/mainPage/EducationSection.vue create mode 100644 resources/js/componentss/features/mainPage/EventSection.vue create mode 100644 resources/js/componentss/features/mainPage/PostSection.vue diff --git a/app/Services/Filament/Domain/Posts/VkPostPublisher.php b/app/Services/Filament/Domain/Posts/VkPostPublisher.php index 88958e6..5ef5ffb 100644 --- a/app/Services/Filament/Domain/Posts/VkPostPublisher.php +++ b/app/Services/Filament/Domain/Posts/VkPostPublisher.php @@ -24,6 +24,7 @@ class VkPostPublisher $images = $this->generateImageLinksForVk($post->images); $publishDate = $post->publish_at > now() ? $post->publish_at->timestamp : null; + dispatch(new CreateVkPost($post->title, $text, $images, $post->id, $publishDate)); } } diff --git a/app/Services/VK/Album/VkAlbumService.php b/app/Services/VK/Album/VkAlbumService.php index f2b117b..58677db 100644 --- a/app/Services/VK/Album/VkAlbumService.php +++ b/app/Services/VK/Album/VkAlbumService.php @@ -45,11 +45,13 @@ class VkAlbumService // Загрузка изображений из URL foreach ($images as $imageUrl) { + $fullPath = public_path($imageUrl); $localFile = tempnam(sys_get_temp_dir(), 'img_') . '.webp'; - file_put_contents($localFile, file_get_contents($imageUrl)); + file_put_contents($localFile, file_get_contents($fullPath)); $localFiles[] = $localFile; } + // Подготовка данных для отправки $postFields = []; foreach ($localFiles as $index => $localFile) { diff --git a/resources/js/Pages/Main.vue b/resources/js/Pages/Main.vue index 7581787..3bae32b 100644 --- a/resources/js/Pages/Main.vue +++ b/resources/js/Pages/Main.vue @@ -5,167 +5,9 @@
-

Последние новости

-
- -
- - - - -

Мероприятия

- - -
- - - - -
- - - - -
- -
- - -
- - Все мероприятия - - -
- - - -

Образование

- - -
- -
- - -
-
- - Доп. образование - -

- Дополнительное образование -

-

- Построй свою индивидуальную траекторию -

-
-
-
-

{{ educations.additional_education.educations_count }}

-

Программ

-
-
-

{{ educations.additional_education.categories_count }}

-

Направлений

-
- - -
-
- - -
- -
- - -
+ + + @@ -183,6 +25,10 @@ import MetaTags from "@/componentss/shared/SEO/MetaTags.vue"; import Cookies from "js-cookie"; import PageResourceList from "@/componentss/shared/pageResource/PageResourceList.vue"; import ContactSectionBlock from "@/componentss/shared/contactSection/ContactSectionBlock.vue"; +import EventListItem from "@/componentss/features/events/components/EventListItem.vue"; +import PostSection from "@/componentss/features/mainPage/PostSection.vue"; +import EventSection from "@/componentss/features/mainPage/EventSection.vue"; +import EducationSection from "@/componentss/features/mainPage/EducationSection.vue"; @@ -216,6 +62,10 @@ export default { }, components: { + EducationSection, + EventSection, + PostSection, + EventListItem, MetaTags, BasicFooter, PostListItem, diff --git a/resources/js/componentss/features/events/components/EventListItem.vue b/resources/js/componentss/features/events/components/EventListItem.vue new file mode 100644 index 0000000..30d00b4 --- /dev/null +++ b/resources/js/componentss/features/events/components/EventListItem.vue @@ -0,0 +1,56 @@ + + + + + \ No newline at end of file diff --git a/resources/js/componentss/features/mainPage/EducationSection.vue b/resources/js/componentss/features/mainPage/EducationSection.vue new file mode 100644 index 0000000..74fdea1 --- /dev/null +++ b/resources/js/componentss/features/mainPage/EducationSection.vue @@ -0,0 +1,100 @@ + + + + + \ No newline at end of file diff --git a/resources/js/componentss/features/mainPage/EventSection.vue b/resources/js/componentss/features/mainPage/EventSection.vue new file mode 100644 index 0000000..fa60af8 --- /dev/null +++ b/resources/js/componentss/features/mainPage/EventSection.vue @@ -0,0 +1,39 @@ + + + + + \ No newline at end of file diff --git a/resources/js/componentss/features/mainPage/PostSection.vue b/resources/js/componentss/features/mainPage/PostSection.vue new file mode 100644 index 0000000..7f0e279 --- /dev/null +++ b/resources/js/componentss/features/mainPage/PostSection.vue @@ -0,0 +1,36 @@ + + + + + \ No newline at end of file diff --git a/resources/js/componentss/features/posts/components/PostGallery.vue b/resources/js/componentss/features/posts/components/PostGallery.vue index 897c568..d77c1a1 100644 --- a/resources/js/componentss/features/posts/components/PostGallery.vue +++ b/resources/js/componentss/features/posts/components/PostGallery.vue @@ -28,18 +28,25 @@
-
-
- -
-
- - Открыть -
-
-
-
- +
+
+ +
+
+ + + + + Открыть +
+
+
+