From aff19de2eac061a2bf13035b3f65cfa29ae1d3ff Mon Sep 17 00:00:00 2001 From: mrilyew <99399973+mrilyew@users.noreply.github.com> Date: Fri, 22 Nov 2024 21:27:21 +0300 Subject: [PATCH] feat(wall): add likes tooltip resolves #1094 resolves #998 resolves #31 --- VKAPI/Handlers/Likes.php | 2 +- Web/Presenters/templates/Photos/Photo.xml | 2 +- Web/Presenters/templates/Videos/View.xml | 2 +- .../templates/components/comment.xml | 2 +- .../components/post/microblogpost.xml | 2 +- .../templates/components/post/oldpost.xml | 2 +- Web/static/css/main.css | 70 +++++++++++++++++++ Web/static/js/al_wall.js | 48 +++++++++++++ locales/en.strings | 6 ++ locales/ru.strings | 6 ++ 10 files changed, 136 insertions(+), 6 deletions(-) diff --git a/VKAPI/Handlers/Likes.php b/VKAPI/Handlers/Likes.php index 8b478a3b..f9262fa1 100644 --- a/VKAPI/Handlers/Likes.php +++ b/VKAPI/Handlers/Likes.php @@ -198,7 +198,7 @@ final class Likes extends VKAPIRequestHandler if(!$extended) $res->items[] = $liker->getId(); else - $res->items[] = $liker->toVkApiStruct(); + $res->items[] = $liker->toVkApiStruct(NULL, 'photo_50'); } return $res; diff --git a/Web/Presenters/templates/Photos/Photo.xml b/Web/Presenters/templates/Photos/Photo.xml index 9bbd67c6..8bc76174 100644 --- a/Web/Presenters/templates/Photos/Photo.xml +++ b/Web/Presenters/templates/Photos/Photo.xml @@ -36,7 +36,7 @@ {var $liked = $photo->hasLikeFrom($thisUser)} {var $likesCount = $photo->getLikesCount()}
- +
{if $likesCount > 0}{$likesCount}{/if}
diff --git a/Web/Presenters/templates/Videos/View.xml b/Web/Presenters/templates/Videos/View.xml index 3b7f7b97..46d76559 100644 --- a/Web/Presenters/templates/Videos/View.xml +++ b/Web/Presenters/templates/Videos/View.xml @@ -38,7 +38,7 @@ {var $liked = $video->hasLikeFrom($thisUser)} {var $likesCount = $video->getLikesCount()}
- +
{if $likesCount > 0}{$likesCount}{/if}
diff --git a/Web/Presenters/templates/components/comment.xml b/Web/Presenters/templates/components/comment.xml index ea39fe34..ab465023 100644 --- a/Web/Presenters/templates/components/comment.xml +++ b/Web/Presenters/templates/components/comment.xml @@ -60,7 +60,7 @@ {_report} {/if}
- +
{if $likesCount > 0}{$likesCount}{/if}
diff --git a/Web/Presenters/templates/components/post/microblogpost.xml b/Web/Presenters/templates/components/post/microblogpost.xml index 9635f417..5d6389cd 100644 --- a/Web/Presenters/templates/components/post/microblogpost.xml +++ b/Web/Presenters/templates/components/post/microblogpost.xml @@ -131,7 +131,7 @@ {if !($forceNoLike ?? false)} {var $liked = $post->hasLikeFrom($thisUser)} - +
{if $likesCount > 0}{$likesCount}{/if}
diff --git a/Web/Presenters/templates/components/post/oldpost.xml b/Web/Presenters/templates/components/post/oldpost.xml index 5b1a087a..36e56f73 100644 --- a/Web/Presenters/templates/components/post/oldpost.xml +++ b/Web/Presenters/templates/components/post/oldpost.xml @@ -157,7 +157,7 @@