2021-10-07 11:48:55 +03:00
|
|
|
{extends "../@layout.xml"}
|
|
|
|
|
|
|
|
{block title}
|
2021-10-07 23:09:14 +03:00
|
|
|
{_gift_select}
|
2021-10-07 11:48:55 +03:00
|
|
|
{/block}
|
|
|
|
|
|
|
|
{block header}
|
|
|
|
<a href="{$user->getURL()}">{$user->getCanonicalName()}</a> »
|
2021-10-07 23:09:14 +03:00
|
|
|
<a href="/gifts?act=pick&user={$user->getId()}">{_gift_select}</a> »
|
|
|
|
<a href="/gifts?act=pick&user={$user->getId()}">{_collections}</a> »
|
2021-10-07 11:48:55 +03:00
|
|
|
{$cat->getName(tr("__lang"))}
|
|
|
|
{/block}
|
|
|
|
|
|
|
|
{block content}
|
|
|
|
<div class="gift_grid">
|
|
|
|
<div n:foreach="$gifts as $gift" n:class="gift_sel, !$gift->canUse($thisUser) ? disabled" data-gift="{$gift->getId()}">
|
2024-01-06 21:30:59 +03:00
|
|
|
<img class="gift_pic" src="{$gift->getImage(2)}" alt="{_gift}" loading=lazy />
|
|
|
|
|
2021-10-07 11:48:55 +03:00
|
|
|
<strong class="gift_price">
|
|
|
|
{if $gift->isFree()}
|
2021-10-07 23:09:14 +03:00
|
|
|
{_free_gift}
|
2021-10-07 11:48:55 +03:00
|
|
|
{else}
|
2021-10-07 23:09:14 +03:00
|
|
|
{tr('coins', $gift->getPrice())}
|
2021-10-07 11:48:55 +03:00
|
|
|
{/if}
|
|
|
|
</strong>
|
2024-01-06 21:30:59 +03:00
|
|
|
|
2021-10-07 11:48:55 +03:00
|
|
|
<strong class="gift_limit">
|
|
|
|
{if $gift->getUsagesLeft($thisUser) !== INF}
|
2021-10-07 23:09:14 +03:00
|
|
|
{tr("gifts_left", $gift->getUsagesLeft($thisUser))}
|
2021-10-07 11:48:55 +03:00
|
|
|
{/if}
|
|
|
|
</strong>
|
|
|
|
</div>
|
|
|
|
</div>
|
2024-01-06 21:30:59 +03:00
|
|
|
|
2021-10-07 11:48:55 +03:00
|
|
|
<div style="padding: 8px;">
|
|
|
|
{include "../components/paginator.xml", conf => (object) [
|
2021-12-04 16:47:42 +03:00
|
|
|
"page" => $page,
|
|
|
|
"count" => $count,
|
|
|
|
"amount" => sizeof($gifts),
|
|
|
|
"perPage" => OPENVK_DEFAULT_PER_PAGE,
|
2021-10-07 11:48:55 +03:00
|
|
|
]}
|
|
|
|
</div>
|
|
|
|
{/block}
|
|
|
|
|
|
|
|
{block bodyScripts}
|
|
|
|
<script>
|
|
|
|
$(".gift_sel").click(function() {
|
|
|
|
let el = $(this);
|
|
|
|
if(el.hasClass("disabled"))
|
|
|
|
return false;
|
2024-01-06 21:30:59 +03:00
|
|
|
|
2021-10-07 11:48:55 +03:00
|
|
|
let link = "/gifts?act=confirm&user={$user->getId()}&pack={$cat->getId()}&elid=";
|
|
|
|
let gift = el.data("gift");
|
2024-01-06 21:30:59 +03:00
|
|
|
|
2021-10-07 11:48:55 +03:00
|
|
|
window.location.assign(link + gift);
|
|
|
|
});
|
|
|
|
</script>
|
2024-01-06 21:30:59 +03:00
|
|
|
{/block}
|