2021-10-07 11:48:55 +03:00
|
|
|
|
{extends "@layout.xml"}
|
|
|
|
|
|
|
|
|
|
{block title}
|
|
|
|
|
{$cat->getName()}
|
|
|
|
|
{/block}
|
|
|
|
|
|
|
|
|
|
{block headingWrap}
|
|
|
|
|
<a style="float: right;" class="aui-button aui-button-primary" href="/admin/gifts/id0?act=edit&cat={$cat->getId()}">
|
|
|
|
|
{_create}
|
|
|
|
|
</a>
|
|
|
|
|
|
2022-04-24 09:02:23 +03:00
|
|
|
|
<h1>{_admin_giftset} "{$cat->getName()}"</h1>
|
2021-10-07 11:48:55 +03:00
|
|
|
|
{/block}
|
|
|
|
|
|
|
|
|
|
{block content}
|
|
|
|
|
{if sizeof($gifts) > 0}
|
|
|
|
|
<table class="aui aui-table-list">
|
|
|
|
|
<thead>
|
|
|
|
|
<th>Подарок</th>
|
|
|
|
|
<th>Имя</th>
|
|
|
|
|
<th>Цена</th>
|
|
|
|
|
<th>Подарен</th>
|
|
|
|
|
<th>Ограничение</th>
|
|
|
|
|
<th>Сброс счётчика ограничений</th>
|
|
|
|
|
<th>Действия</th>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
|
|
|
|
<tr n:foreach="$gifts as $gift">
|
|
|
|
|
<td style="vertical-align: middle; width: 0px;">
|
|
|
|
|
<img style="max-width: 32px;" src="{$gift->getImage(2)}" alt="{$gift->getName()}" />
|
|
|
|
|
</td>
|
|
|
|
|
<td style="vertical-align: middle;">
|
|
|
|
|
{$gift->getName()}
|
|
|
|
|
<span n:if="$gift->isFree()" class="aui-lozenge aui-lozenge-subtle aui-lozenge-success">
|
2022-04-24 09:02:23 +03:00
|
|
|
|
{_admin_price_free}
|
2021-10-07 11:48:55 +03:00
|
|
|
|
</span>
|
|
|
|
|
</td>
|
|
|
|
|
<td style="vertical-align: middle;">
|
2022-04-24 09:02:23 +03:00
|
|
|
|
{tr("points_amount", $gift->getPrice())}
|
2021-10-07 11:48:55 +03:00
|
|
|
|
</td>
|
|
|
|
|
<td style="vertical-align: middle;">
|
|
|
|
|
{$gift->getUsages()} раз
|
|
|
|
|
</td>
|
|
|
|
|
<td style="vertical-align: middle;">
|
|
|
|
|
{if $gift->getLimit() === INF}
|
|
|
|
|
Отсутствует
|
|
|
|
|
{else}
|
|
|
|
|
Не более {$gift->getLimit()} дарений
|
|
|
|
|
{/if}
|
|
|
|
|
</td>
|
|
|
|
|
<td style="vertical-align: middle;">
|
|
|
|
|
{if !$gift->getLimitResetTime()}
|
|
|
|
|
Никогда
|
|
|
|
|
{else}
|
|
|
|
|
Последний раз в
|
|
|
|
|
{$gift->getLimitResetTime()->format("%a, %d %B %G")}
|
|
|
|
|
{/if}
|
|
|
|
|
</td>
|
|
|
|
|
<td style="vertical-align: middle; text-align: right;">
|
|
|
|
|
<a class="aui-button aui-button-primary" href="/admin/gifts/id{$gift->getId()}">
|
|
|
|
|
<span class="aui-icon aui-icon-small aui-iconfont-new-edit">Редактировать</span>
|
|
|
|
|
</a>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
{else}
|
|
|
|
|
<center>
|
|
|
|
|
<p>Подарков нету. Нажмите на красивую кнопку вверху, чтобы создать первый.</p>
|
|
|
|
|
</center>
|
|
|
|
|
{/if}
|
|
|
|
|
|
|
|
|
|
<div align="right">
|
2022-04-24 08:06:45 +03:00
|
|
|
|
{var $isLast = ((20 * (($_GET['p'] ?? 1) - 1)) + sizeof($gifts)) < $count}
|
2022-04-24 09:02:23 +03:00
|
|
|
|
|
|
|
|
|
<a n:if="($_GET['p'] ?? 1) > 1" class="aui-button" href="?p={($_GET['p'] ?? 1) - 1}">«</a>
|
|
|
|
|
<a n:if="$isLast" class="aui-button" href="?p={($_GET['p'] ?? 1) + 1}">»</a>
|
2021-10-07 11:48:55 +03:00
|
|
|
|
</div>
|
|
|
|
|
{/block}
|