From 8fc47ff6cdc1ec33a367a62b6ba968524c4e8400 Mon Sep 17 00:00:00 2001 From: mrilyew <99399973+mrilyew@users.noreply.github.com> Date: Sat, 2 Nov 2024 11:16:25 +0300 Subject: [PATCH] rewrite --- Web/Presenters/NotesPresenter.php | 9 +-- Web/Presenters/SearchPresenter.php | 1 + Web/Presenters/templates/@listView.xml | 4 +- Web/Presenters/templates/Audio/List.xml | 10 +-- Web/Presenters/templates/Audio/Playlist.xml | 4 +- Web/Presenters/templates/Gifts/Pick.xml | 4 +- Web/Presenters/templates/Group/Suggested.xml | 4 +- Web/Presenters/templates/Messenger/Index.xml | 4 +- Web/Presenters/templates/Notes/List.xml | 15 +++- .../templates/Notification/Feed.xml | 4 +- Web/Presenters/templates/Photos/Album.xml | 4 +- Web/Presenters/templates/Search/Index.xml | 58 +++++++++++---- Web/Presenters/templates/User/Groups.xml | 1 + .../templates/components/paginator.xml | 2 +- Web/static/js/al_music.js | 29 ++++++++ Web/static/js/al_suggestions.js | 4 +- Web/static/js/al_wall.js | 73 +++++++++++++++++++ Web/static/js/openvk.cls.js | 6 +- 18 files changed, 185 insertions(+), 51 deletions(-) diff --git a/Web/Presenters/NotesPresenter.php b/Web/Presenters/NotesPresenter.php index 67105fe3..37475013 100644 --- a/Web/Presenters/NotesPresenter.php +++ b/Web/Presenters/NotesPresenter.php @@ -22,15 +22,10 @@ final class NotesPresenter extends OpenVKPresenter if(!$user->getPrivacyPermission('notes.read', $this->user->identity ?? NULL)) $this->flashFail("err", tr("forbidden"), tr("forbidden_comment")); - $this->template->notes = $this->notes->getUserNotes($user, (int)($this->queryParam("p") ?? 1)); + $this->template->page = (int)($this->queryParam("p") ?? 1); + $this->template->notes = $this->notes->getUserNotes($user, $this->template->page); $this->template->count = $this->notes->getUserNotesCount($user); $this->template->owner = $user; - $this->template->paginatorConf = (object) [ - "count" => $this->template->count, - "page" => $this->queryParam("p") ?? 1, - "amount" => NULL, - "perPage" => OPENVK_DEFAULT_PER_PAGE, - ]; } function renderView(int $owner, int $note_id): void diff --git a/Web/Presenters/SearchPresenter.php b/Web/Presenters/SearchPresenter.php index a7f3f151..9e16450e 100644 --- a/Web/Presenters/SearchPresenter.php +++ b/Web/Presenters/SearchPresenter.php @@ -125,5 +125,6 @@ final class SearchPresenter extends OpenVKPresenter ]; $this->template->extendedPaginatorConf = clone $this->template->paginatorConf; $this->template->extendedPaginatorConf->space = 11; + $this->template->paginatorConf->atTop = true; } } diff --git a/Web/Presenters/templates/@listView.xml b/Web/Presenters/templates/@listView.xml index 4b2dd9ff..f97d0da5 100644 --- a/Web/Presenters/templates/@listView.xml +++ b/Web/Presenters/templates/@listView.xml @@ -19,7 +19,7 @@ {ifset specpage} {include specpage, x => $dat} {else} -