Files
poll/templates/archive.tpl
2026-03-29 18:38:12 +05:00

75 lines
4.2 KiB
Smarty

<div class="container my-4">
<div class="d-flex justify-content-between align-items-center mb-4">
<h2 class="mb-0 fw-bold text-dark">{#POLL_ARCHIVE_TITLE#}</h2>
</div>
<div class="card shadow-sm border rounded-3 overflow-hidden">
<div class="table-responsive">
<table class="table table-hover align-middle mb-0">
<thead>
<tr class="fs-7 text-uppercase fw-bold">
<th class="ps-4 py-3" style="background-color: #6c757d !important; color: #ffffff !important;">
<a href="index.php?module=poll&action=archive&order=title{if $order=='title' && $by!='desc'}&by=desc{/if}"
class="text-white text-decoration-none d-flex align-items-center">
{#POLL_PUB_TITLE#}
{if $order=='title'}<i class="bi bi-sort-alpha-{if $by=='desc'}down{else}up{/if} ms-2"></i>{/if}
</a>
</th>
<th class="text-center py-3" style="background-color: #6c757d !important; color: #ffffff !important; width: 180px;">
<a href="index.php?module=poll&action=archive&order=start{if $order=='start' && $by!='desc'}&by=desc{/if}"
class="text-white text-decoration-none">
{#POLL_PUB_START#}
{if $order=='start'}<i class="bi bi-sort-numeric-{if $by=='desc'}down{else}up{/if} ms-1"></i>{/if}
</a>
</th>
<th class="text-center py-3" style="background-color: #6c757d !important; color: #ffffff !important; width: 180px;">
<a href="index.php?module=poll&action=archive&order=end{if $order=='end' && $by!='desc'}&by=desc{/if}"
class="text-white text-decoration-none">
{#POLL_PUB_END#}
{if $order=='end'}<i class="bi bi-sort-numeric-{if $by=='desc'}down{else}up{/if} ms-1"></i>{/if}
</a>
</th>
<th class="text-center pe-4 py-3" style="background-color: #6c757d !important; color: #ffffff !important; width: 120px;">
<a href="index.php?module=poll&action=archive&order=votes{if $order=='votes' && $by!='desc'}&by=desc{/if}"
class="text-white text-decoration-none">
{#POLL_ARCHIVE_HITS#}
{if $order=='votes'}<i class="bi bi-sort-down ms-1"></i>{/if}
</a>
</th>
</tr>
</thead>
<tbody class="fs-8 bg-white">
{foreach from=$items item=item}
<tr class="border-bottom">
<td class="ps-4 py-3">
<a href="{$item->plink}" class="text-decoration-none text-dark d-block fw-bold">
<i class="bi bi-bar-chart-fill me-2 text-secondary opacity-50"></i>{$item->poll_title|escape}
</a>
</td>
<td class="text-center text-muted small">
{$item->poll_start|date_format:$DATE_FORMAT|pretty_date}
</td>
<td class="text-center text-muted small">
{$item->poll_end|date_format:$DATE_FORMAT|pretty_date}
</td>
<td class="text-center pe-4">
<span class="badge rounded-pill bg-light text-secondary border px-3 py-2">{$item->votes}</span>
</td>
</tr>
{foreachelse}
<tr><td colspan="4" class="text-center py-5 text-muted">Архив пока пуст</td></tr>
{/foreach}
</tbody>
</table>
</div>
</div>
</div>
<style>
.fs-7 { font-size: 0.8rem; }
.fs-8 { font-size: 0.9rem; }
.table thead th { border: none !important; }
</style>