openvk/Web/Presenters/templates/components/comments.xml
mrilyew 73a067a0c5
feat: ajax infinite scrolling (#1141)
* rewrite

* allow comments scroll

* rework to up button

* add posts scrolling function and ability to disabl

* cloudflare bypass (do not uncomment)
2024-11-22 16:31:07 +03:00

22 lines
1,018 B
XML

<h4 n:if="$showTitle ?? true">{_comments} ({$count})</h4>
<div n:ifset="$thisUser" id="standaloneCommentBox">
{var $commentsURL = "/al_comments/create/$model/" . $parent->getId()}
{var $club = $parent instanceof \openvk\Web\Models\Entities\Post && $parent->getTargetWall() < 0 ? (new openvk\Web\Models\Repositories\Clubs)->get(abs($parent->getTargetWall())) : $club}
{if !$readOnly}
{include "textArea.xml", route => $commentsURL, postOpts => false, graffiti => (bool) ovkGetQuirk("comments.allow-graffiti"), club => $club, custom_id => $custom_id}
{/if}
</div>
{if sizeof($comments) > 0}
<div class='scroll_container'>
<div class='scroll_node' n:foreach="$comments as $comment">
{include "comment.xml", comment => $comment}
</div>
</div>
<div style="margin-top: 11px;">
{include "paginator.xml", conf => (object) ["page" => $page, "count" => $count, "amount" => sizeof($comments), "perPage" => 10]}
</div>
{else}
{_comments_tip}
{/if}