From afa1d7e71c3c098f03caf58a121c17e4af421c4e Mon Sep 17 00:00:00 2001 From: Dmitry <72506029+HSDChannel@users.noreply.github.com> Date: Sat, 18 Dec 2021 01:34:24 +0700 Subject: [PATCH 1/3] Fix online in messages (#354) --- Web/Presenters/templates/Messenger/App.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Web/Presenters/templates/Messenger/App.xml b/Web/Presenters/templates/Messenger/App.xml index afd464cc..79f95a16 100644 --- a/Web/Presenters/templates/Messenger/App.xml +++ b/Web/Presenters/templates/Messenger/App.xml @@ -8,7 +8,7 @@
{var diff = date_diff(date_create(), date_create('@' . $online))} {if 5 >= $diff->i} - Online + {_online} {else} {$correspondent->isFemale() ? "заходила" : "заходил"} {$correspondent->getOnline()} {/if} From 497e55b1a759e98ee55c863274325339b0b56174 Mon Sep 17 00:00:00 2001 From: Maxim Leshchenko Date: Fri, 17 Dec 2021 21:30:39 +0200 Subject: [PATCH 2/3] Microblog: Fix reply button in inline comments below post --- Web/Presenters/templates/components/comment.xml | 3 ++- Web/static/js/al_comments.js | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Web/Presenters/templates/components/comment.xml b/Web/Presenters/templates/components/comment.xml index 701db922..94122ac7 100644 --- a/Web/Presenters/templates/components/comment.xml +++ b/Web/Presenters/templates/components/comment.xml @@ -1,8 +1,9 @@ {var author = $comment->getOwner()} {var $Club = openvk\Web\Models\Entities\Club::class} +{var postId = $comment->getTarget() instanceof \openvk\Web\Models\Entities\Post ? $comment->getTarget()->getId() : NULL} - +
diff --git a/Web/static/js/al_comments.js b/Web/static/js/al_comments.js index 111b558c..21acd797 100644 --- a/Web/static/js/al_comments.js +++ b/Web/static/js/al_comments.js @@ -1,11 +1,10 @@ u(".comment-reply").on("click", function(e) { - let inputbox = u("#write textarea"); let comment = u(e.target).closest(".post"); let authorId = comment.data("owner-id"); let authorNm = u(".post-author > a > b", comment.first()).text().trim(); let fromGroup = Boolean(comment.data("from-group")); let postId = comment.data("post-id"); - console.log(postId) + let inputbox = postId == null ? u("#write textarea") : u("#wall-post-input" + (postId || "")); inputbox.text("[" + (fromGroup ? "club" : "id") + authorId + "|" + authorNm + "], "); inputbox.trigger("focusin"); From e4452aca7e5115b5a7d2e678d0c6f411c36249cc Mon Sep 17 00:00:00 2001 From: Maxim Leshchenko Date: Fri, 17 Dec 2021 21:35:41 +0200 Subject: [PATCH 3/3] Fixup "Microblog: Fix reply button in inline comments below post" All the same, I forgot to add these files to the commit :3 --- Web/Presenters/templates/Wall/Feed.xml | 4 ++++ Web/Presenters/templates/Wall/HashtagFeed.xml | 4 ++++ Web/Presenters/templates/Wall/Wall.xml | 4 ++++ Web/Presenters/templates/components/wall.xml | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/Web/Presenters/templates/Wall/Feed.xml b/Web/Presenters/templates/Wall/Feed.xml index 81b4bf21..ec82bbe3 100644 --- a/Web/Presenters/templates/Wall/Feed.xml +++ b/Web/Presenters/templates/Wall/Feed.xml @@ -47,3 +47,7 @@ {/block} + +{if isset($thisUser) && $thisUser->hasMicroblogEnabled()} + {script "js/al_comments.js"} +{/if} diff --git a/Web/Presenters/templates/Wall/HashtagFeed.xml b/Web/Presenters/templates/Wall/HashtagFeed.xml index 12320c43..a58ca4e4 100644 --- a/Web/Presenters/templates/Wall/HashtagFeed.xml +++ b/Web/Presenters/templates/Wall/HashtagFeed.xml @@ -17,3 +17,7 @@ {include "../components/paginator.xml", conf => $paginatorConf} {/block} + +{if isset($thisUser) && $thisUser->hasMicroblogEnabled()} + {script "js/al_comments.js"} +{/if} diff --git a/Web/Presenters/templates/Wall/Wall.xml b/Web/Presenters/templates/Wall/Wall.xml index 7e1969e8..9b6fe6b4 100644 --- a/Web/Presenters/templates/Wall/Wall.xml +++ b/Web/Presenters/templates/Wall/Wall.xml @@ -34,3 +34,7 @@ {/block} + +{if isset($thisUser) && $thisUser->hasMicroblogEnabled()} + {script "js/al_comments.js"} +{/if} diff --git a/Web/Presenters/templates/components/wall.xml b/Web/Presenters/templates/components/wall.xml index f353f573..f8be0067 100644 --- a/Web/Presenters/templates/components/wall.xml +++ b/Web/Presenters/templates/components/wall.xml @@ -25,3 +25,7 @@ + +{if isset($thisUser) && $thisUser->hasMicroblogEnabled()} + {script "js/al_comments.js"} +{/if}