openvk/Web/Presenters/templates/components/comment.xml

64 lines
3.8 KiB
XML
Raw Normal View History

2022-04-24 08:06:45 +03:00
{var $author = $comment->getOwner()}
{var $Club = openvk\Web\Models\Entities\Club::class}
2022-04-24 08:06:45 +03:00
{var $postId = $comment->getTarget() instanceof \openvk\Web\Models\Entities\Post ? $comment->getTarget()->getId() : NULL}
2020-06-07 19:04:43 +03:00
<a name="cid={$comment->getId()}"></a>
<table border="0" style="font-size: 11px;" class="post comment" id="_comment{$comment->getId()}" data-comment-id="{$comment->getId()}" data-owner-id="{$author->getId()}" data-from-group="{$comment->getOwner() instanceof $Club}" n:attr="data-post-id => $postId">
2020-06-07 19:04:43 +03:00
<tbody>
<tr>
2021-11-28 14:39:42 +03:00
<td width="30" valign="top">
<a href="{$author->getURL()}">
<img src="{$author->getAvatarURL('miniscule')}" width="30" class="cCompactAvatars" />
</a>
2020-06-07 19:04:43 +03:00
</td>
2021-11-30 18:34:07 +03:00
<td width="100%" valign="top">
2020-06-07 19:04:43 +03:00
<div class="post-author">
<a href="{$author->getURL()}"><b>
{$author->getCanonicalName()}
</b></a>
<img n:if="$author->isVerified()" class="name-checkmark" src="/assets/packages/static/openvk/img/checkmark.png"><br/>
2020-06-07 19:04:43 +03:00
</div>
<div class="post-content" id="{$comment->getId()}">
<div class="text" id="text{$comment->getId()}">
{$comment->getText()|noescape}
<div n:ifcontent class="attachments_b">
<div class="attachment" n:foreach="$comment->getChildren() as $attachment" data-localized-nsfw-text="{_nsfw_warning}">
{include "attachment.xml", attachment => $attachment}
</div>
</div>
2020-06-07 19:04:43 +03:00
</div>
<div n:if="isset($thisUser) &&! ($compact ?? false)" class="post-menu">
{var $target = "wall"}
{if get_class($comment->getTarget()) == "openvk\Web\Models\Entities\Note"}
{php $target = "note"}
{elseif get_class($comment->getTarget()) == "openvk\Web\Models\Entities\Post"}
{php $target = "wall"}
{elseif get_class($comment->getTarget()) == "openvk\Web\Models\Entities\Photo"}
{php $target = "photo"}
{elseif get_class($comment->getTarget()) == "openvk\Web\Models\Entities\Video"}
{php $target = "video"}
{elseif get_class($comment->getTarget()) == "openvk\Web\Models\Entities\Topic"}
{php $target = "topic"}
{/if}
<a {if is_null($linkW)}href="#_comment{$comment->getId()}"{else}href="{$target}{!is_null($comment->getTarget()) ? $comment->getTarget()->getPrettyId() : $comment->getOwner()->getId()}#_comment{$comment->getId()}"{/if} class="date">{$comment->getPublicationTime()}</a>&nbsp;|
{if $comment->canBeDeletedBy($thisUser)}
<a href="/comment{$comment->getId()}/delete">{_delete}</a>&nbsp;|
2020-06-07 19:04:43 +03:00
{/if}
{if is_null($linkW)}
<a class="comment-reply">{_reply}</a>{/if}
2020-06-07 19:04:43 +03:00
<div style="float: right; font-size: .7rem;">
2021-11-28 14:39:42 +03:00
<a class="post-like-button" href="/comment{$comment->getId()}/like?hash={rawurlencode($csrfToken)}">
2021-01-17 01:29:21 +03:00
<div class="heart" style="{if $comment->hasLikeFrom($thisUser)}opacity: 1;{else}opacity: 0.4;{/if}"></div>
2021-11-30 18:34:07 +03:00
<span class="likeCnt">{if $comment->getLikesCount() > 0}{$comment->getLikesCount()}{/if}</span>
2020-06-07 19:04:43 +03:00
</a>
</div>
</div>
</div>
</td>
</tr>
</tbody>
</table>