Files
Testing/leptesting/latestpolls.tpl
sean 0e8a8b3028
Some checks are pending
deploy-testing / deploy (push) Waiting to run
Initial testing snapshot
2026-11-17 16:15:01 -05:00

38 lines
1.8 KiB
Smarty

{* Show Polls *}
{if $polls|@count > 0}
<div>
<div class="header">Recent Polls</div>
<div style="background:#000;padding:10px 10px 10px 10px;">
{assign var=polltotal value=$polls|@count}
{if $polltotal < 4}
{assign var=polltotal value=$polltotal-1}
{else}
{assign var=polltotal value=4}
{/if}
{section name=poll_loop loop=$polls max=4}
<div style='font-weight: bold; font-size: 13px;'>
<a href='{$url->url_create("poll", $polls[poll_loop]->poll_owner->user_info.user_username, $polls[poll_loop]->poll_info.poll_id)}'>{$polls[poll_loop]->poll_info.poll_title|truncate:50:"...":true}</a>
</div>
<div class='polls_browse_date'>
{assign var='poll_datecreated' value=$datetime->time_since($polls[poll_loop]->poll_info.poll_datecreated)}{capture assign="created"}{lang_sprintf id=$poll_datecreated[0] 1=$poll_datecreated[1]}{/capture}
{lang_sprintf id=2500108 1=$created 2=$url->url_create("profile", $polls[poll_loop]->poll_owner->user_info.user_username) 3=$polls[poll_loop]->poll_owner->user_displayname}
</div>
<div style="padding-top: 5px;">
{lang_sprintf id=2500028 1=$polls[poll_loop]->poll_info.poll_totalvotes},
{lang_sprintf id=507 1=$polls[poll_loop]->poll_info.total_comments},
{lang_sprintf id=949 1=$polls[poll_loop]->poll_info.poll_views}
</div>
<div style='padding-top: 10px;'>
{$polls[poll_loop]->poll_info.poll_desc|escape:html|truncate:75:"...":true}
</div>
{if $smarty.section.poll_loop.rownum < 4 || $smarty.section.poll_loop.rownum < $polltotal}
<hr style="width:100%;text-align:center;line-height:1px;" />
{else}
<div style="height:5px;font-size:0px;overflow:hidden;">&nbsp;</div>
{/if}
{/section}
</div>
<div class='portal_spacer'></div>
</div>
{/if}