From 3d2036345b51225096e69e4fd3661358c3bcb24d Mon Sep 17 00:00:00 2001 From: mrilyew <99399973+mrilyew@users.noreply.github.com> Date: Tue, 22 Oct 2024 15:18:57 +0300 Subject: [PATCH] -comments search, arrow keys on tips --- Web/Models/Entities/Playlist.php | 15 ++++++++ Web/Presenters/SearchPresenter.php | 6 +--- Web/Presenters/templates/@layout.xml | 1 - Web/Presenters/templates/Search/Index.xml | 11 +----- Web/static/css/main.css | 2 +- Web/static/js/al_navigation.js | 42 ++++++++++++++++++++++- Web/static/js/al_wall.js | 2 +- locales/en.strings | 6 ++-- locales/ru.strings | 4 +-- 9 files changed, 65 insertions(+), 24 deletions(-) diff --git a/Web/Models/Entities/Playlist.php b/Web/Models/Entities/Playlist.php index 29a6aa75..ac36b4f3 100644 --- a/Web/Models/Entities/Playlist.php +++ b/Web/Models/Entities/Playlist.php @@ -41,6 +41,21 @@ class Playlist extends MediaCollection { return $this->getRecord()->length; } + + function fetchClassic(int $offset = 0, ?int $limit = NULL): \Traversable + { + $related = $this->getRecord()->related("$this->relTableName.collection") + ->limit($limit ?? OPENVK_DEFAULT_PER_PAGE, $offset) + ->order("index ASC"); + + foreach($related as $rel) { + $media = $rel->ref($this->entityTableName, "media"); + if(!$media) + continue; + + yield new $this->entityClassName($media); + } + } function getAudios(int $offset = 0, ?int $limit = NULL, ?int $shuffleSeed = NULL): \Traversable { diff --git a/Web/Presenters/SearchPresenter.php b/Web/Presenters/SearchPresenter.php index 47f3ee16..72c34e89 100644 --- a/Web/Presenters/SearchPresenter.php +++ b/Web/Presenters/SearchPresenter.php @@ -1,7 +1,7 @@ users = new Users; $this->clubs = new Clubs; $this->posts = new Posts; - $this->comments = new Comments; $this->videos = new Videos; $this->apps = new Applications; $this->audios = new Audios; @@ -45,7 +42,6 @@ final class SearchPresenter extends OpenVKPresenter "groups" => "clubs", "users" => "users", "posts" => "posts", - "comments" => "comments", "videos" => "videos", "audios" => "audios", "apps" => "apps", diff --git a/Web/Presenters/templates/@layout.xml b/Web/Presenters/templates/@layout.xml index c62a6e31..b54ef44c 100644 --- a/Web/Presenters/templates/@layout.xml +++ b/Web/Presenters/templates/@layout.xml @@ -123,7 +123,6 @@ - diff --git a/Web/Presenters/templates/Search/Index.xml b/Web/Presenters/templates/Search/Index.xml index 77c2bd43..76143507 100644 --- a/Web/Presenters/templates/Search/Index.xml +++ b/Web/Presenters/templates/Search/Index.xml @@ -224,14 +224,6 @@ - {elseif $section === 'comments'} -
- {include "../components/comment.xml", no_reply_button => true, comment => $dat, correctLink => true} -
- - {elseif $section === 'videos'}
{include "../components/video.xml", video => $dat} @@ -266,7 +258,6 @@ {_s_people} {_s_groups} {_s_posts} - {_s_comments} {_s_videos} {_s_apps} {_s_audios} @@ -400,7 +391,7 @@