From c26e6420b4d2b3761a2be4422abb5900446335b4 Mon Sep 17 00:00:00 2001 From: xRy0 Date: Tue, 20 May 2025 12:33:26 +0300 Subject: [PATCH 1/4] feat(FeedIgnore): added draft of ignore feature to the feed posts --- Web/Presenters/WallPresenter.php | 3 ++- Web/Presenters/templates/components/post/microblogpost.xml | 3 ++- Web/Presenters/templates/components/post/oldpost.xml | 4 ++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Web/Presenters/WallPresenter.php b/Web/Presenters/WallPresenter.php index f4a8e898..aa238d65 100644 --- a/Web/Presenters/WallPresenter.php +++ b/Web/Presenters/WallPresenter.php @@ -102,7 +102,7 @@ final class WallPresenter extends OpenVKPresenter break; } - $this->template->owner = $user; + $this->template->owner = $user; $this->template->canPost = $canPost; $this->template->count = $count; $this->template->type = $type; @@ -113,6 +113,7 @@ final class WallPresenter extends OpenVKPresenter "amount" => sizeof($this->template->posts), "perPage" => OPENVK_DEFAULT_PER_PAGE, ]; + $this->template->ignore_status = $owner->isIgnoredBy($this->user->identity); $this->logPostsViewed($this->template->posts, $user); diff --git a/Web/Presenters/templates/components/post/microblogpost.xml b/Web/Presenters/templates/components/post/microblogpost.xml index b39b8239..0f6032d1 100644 --- a/Web/Presenters/templates/components/post/microblogpost.xml +++ b/Web/Presenters/templates/components/post/microblogpost.xml @@ -57,7 +57,8 @@ {_pinned} - + + {if $canBePinned && !($forceNoPinLink ?? false) && $compact == false} {if $post->isPinned()} diff --git a/Web/Presenters/templates/components/post/oldpost.xml b/Web/Presenters/templates/components/post/oldpost.xml index 3612aa1d..a1d6a34e 100644 --- a/Web/Presenters/templates/components/post/oldpost.xml +++ b/Web/Presenters/templates/components/post/oldpost.xml @@ -133,6 +133,10 @@ {if !($forceNoDeleteLink ?? false) && $canBeDeleted} {_delete}  |  + {/if} + + {if !$canBeDeleted} + {if !$ignore_status}{_ignore_user}{else}{_unignore_user}{/if}  |  {/if} {if !($forceNoPinLink ?? false) && $canBePinned} From 276474641b84df6262b38652d22d3b0c443d49cc Mon Sep 17 00:00:00 2001 From: xRy0 Date: Tue, 20 May 2025 12:54:44 +0300 Subject: [PATCH 2/4] fix(FeedIgnore): Linter is crazy xd --- Web/Presenters/WallPresenter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Web/Presenters/WallPresenter.php b/Web/Presenters/WallPresenter.php index aa238d65..709a0091 100644 --- a/Web/Presenters/WallPresenter.php +++ b/Web/Presenters/WallPresenter.php @@ -102,7 +102,7 @@ final class WallPresenter extends OpenVKPresenter break; } - $this->template->owner = $user; + $this->template->owner = $user; $this->template->canPost = $canPost; $this->template->count = $count; $this->template->type = $type; From 033a04eec0b83e39c2d61f5806c574eb77ac801a Mon Sep 17 00:00:00 2001 From: xRy0 Date: Tue, 20 May 2025 13:26:27 +0300 Subject: [PATCH 3/4] style: created css class for button --- .../templates/components/post/microblogpost.xml | 2 +- Web/static/css/microblog.css | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Web/Presenters/templates/components/post/microblogpost.xml b/Web/Presenters/templates/components/post/microblogpost.xml index 0f6032d1..5933f4bb 100644 --- a/Web/Presenters/templates/components/post/microblogpost.xml +++ b/Web/Presenters/templates/components/post/microblogpost.xml @@ -58,7 +58,7 @@ {_pinned} - + {if $canBePinned && !($forceNoPinLink ?? false) && $compact == false} {if $post->isPinned()} diff --git a/Web/static/css/microblog.css b/Web/static/css/microblog.css index 503af42a..571b4c30 100644 --- a/Web/static/css/microblog.css +++ b/Web/static/css/microblog.css @@ -86,6 +86,17 @@ background-color: rgb(240, 240, 240); } +.ignore { + float: right; + height: 16px; + width: 16px; + overflow: auto; + background: url("/assets/packages/static/openvk/img/audios_controls.png") no-repeat 0 0; + background-position: -51px -67px; + opacity: 0.2; + transition-duration: 0.3s; +} + .post-author .delete { float: right; height: 16px; From ddefa148818b73b504bcb0025d4dffeeb495be99 Mon Sep 17 00:00:00 2001 From: xRy0 Date: Tue, 20 May 2025 13:34:51 +0300 Subject: [PATCH 4/4] style: fix hover --- Web/static/css/microblog.css | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Web/static/css/microblog.css b/Web/static/css/microblog.css index 571b4c30..89cf5dda 100644 --- a/Web/static/css/microblog.css +++ b/Web/static/css/microblog.css @@ -93,10 +93,14 @@ overflow: auto; background: url("/assets/packages/static/openvk/img/audios_controls.png") no-repeat 0 0; background-position: -51px -67px; - opacity: 0.2; + opacity: 0.1; transition-duration: 0.3s; } +.ignore:hover { + opacity: 0.4; +} + .post-author .delete { float: right; height: 16px;