openvk/Web/Presenters/templates/Photos/Photo.xml

73 lines
3.6 KiB
XML
Raw Normal View History

2020-06-07 19:04:43 +03:00
{extends "../@layout.xml"}
2022-08-09 09:37:08 +03:00
{block title}{_photo}{/block}
2020-06-07 19:04:43 +03:00
{block header}
{ifset $album}
{var $album_owner = $album->getOwner()}
<a href="{$album_owner->getURL()}">
{$album_owner->getCanonicalName()}
2020-06-07 19:04:43 +03:00
</a>
{if ($album_owner instanceof openvk\Web\Models\Entities\Club)}
» <a href="/albums{$album_owner->getId() * -1}">{_albums}</a>
2020-06-07 19:04:43 +03:00
{else}
» <a href="/albums{$album_owner->getId()}">{_albums}</a>
2020-06-07 19:04:43 +03:00
{/if}
» <a href="/album{$album->getPrettyId()}">{$album->getName()}</a>
{else}
<a href="{$owner->getURL()}">{$owner->getCanonicalName()}</a>
2020-06-07 19:04:43 +03:00
{/ifset}
2022-08-09 09:37:08 +03:00
» {_photo}
2020-06-07 19:04:43 +03:00
{/block}
{block content}
<div class='media-page-wrapper photo-page-wrapper'>
<div class='photo-page-wrapper-photo'>
<img src="{$photo->getURLBySizeId('large')}" />
2020-06-07 19:04:43 +03:00
</div>
<div class='ovk-photo-details'>
<div class='media-page-wrapper-description'>
<p n:if='!empty($photo->getDescription())'>{$photo->getDescription()}</p>
<div class='upload_time'>
{_info_upload_date}: {$photo->getPublicationTime()}
{if isset($thisUser)}
|
{var $liked = $photo->hasLikeFrom($thisUser)}
{var $likesCount = $photo->getLikesCount()}
<div class='like_wrap tidy'>
<a href="/photo{$photo->getPrettyId()}/like?hash={rawurlencode($csrfToken)}" class="post-like-button" data-liked="{(int) $liked}" data-likes="{$likesCount}">
<div class="heart" id="{if $liked}liked{/if}"></div>
<span class="likeCnt">{if $likesCount > 0}{$likesCount}{/if}</span>
</a>
</div>
{/if}
</div>
2020-06-07 19:04:43 +03:00
</div>
<hr/>
<div class="media-page-wrapper-details">
<div class='media-page-wrapper-comments'>
{include "../components/comments.xml", comments => $comments, count => $cCount, page => $cPage, model => "photos", parent => $photo, custom_id => 999}
</div>
<div class='media-page-wrapper-actions'>
<a href="{$owner->getURL()}" class='media-page-author-block'>
<img class='cCompactAvatars' src="{$owner->getAvatarURL('miniscule')}">
<div class='media-page-author-block-name'>
<b>{$owner->getCanonicalName()}</b>
</div>
</a>
<div n:if="isset($thisUser) && $thisUser->getId() === $photo->getOwner()->getId()">
<a href="/photo{$photo->getPrettyId()}/edit" class="profile_link" style="display:block;width:96%;">{_edit}</a>
<a id="_photoDelete" href="/photo{$photo->getPrettyId()}/delete" class="profile_link" style="display:block;width:96%;">{_delete}</a>
</div>
<a href="{$photo->getURL()}" class="profile_link" target="_blank" style="display:block;width:96%;">{_"open_original"}</a>
<a n:if="isset($thisUser) && $thisUser->getId() != $photo->getOwner()->getId()" class="profile_link" style="display:block;width:96%;" href="javascript:reportPhoto({$photo->getId()})">{_report}</a>
</div>
</div>
2020-06-07 19:04:43 +03:00
</div>
</div>
{/block}