1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-06-26 03:30:48 +03:00
ifhub.club/application/frontend/components/user/user-list-small.tpl

50 lines
1.5 KiB
Smarty
Raw Normal View History

{**
* Список пользователей с элементами управления
*
* @param object $users
* @param string $title
* @param boolean $hideableEmptyAlert
* @param boolean $show
* @param boolean $selectable
* @param array $exclude
* @param string $itemTemplate
*}
2016-10-16 13:56:42 +03:00
{$component = 'user-list-small'}
2016-04-07 12:40:28 +03:00
{component_define_params params=[ 'exclude', 'hideableEmptyAlert', 'selectable', 'show', 'title', 'users', 'mods', 'classes', 'attributes' ]}
{* Заголовок *}
2016-04-07 12:40:28 +03:00
{if $title}
<h3 class="user-list-small-title">{$title}</h3>
{/if}
{* Уведомление о пустом списке *}
2016-04-07 12:40:28 +03:00
{if ! $users || $hideableEmptyAlert}
2015-10-27 11:02:57 +02:00
{component 'blankslate'
text = $aLang.common.empty
classes = 'js-user-list-small-empty'
visible = ! $users}
{/if}
2016-10-16 13:56:42 +03:00
{if $selectable}
{$mods = "$mods selectable"}
{/if}
{* Список пользователей *}
2016-04-07 12:40:28 +03:00
{if $users || ! $show|default:true}
2016-10-16 13:56:42 +03:00
<ul class="{$component} js-user-list-small {$classes} {cmods name=$component mods=$mods}" {cattr list=$attributes} {if ! $show|default:true}style="display: none"{/if}>
2015-10-27 11:02:57 +02:00
{foreach $users as $user}
{$userContainer = $user}
2015-10-27 11:02:57 +02:00
{if $user->getUser()}
{$user = $user->getUser()}
{/if}
2016-04-07 12:40:28 +03:00
{if ! $exclude || ! in_array( $user->getId(), $exclude )}
2015-10-27 11:02:57 +02:00
{block 'user_list_small_item'}
2016-04-07 12:40:28 +03:00
{component 'user' template='list-small-item' user=$user selectable=$selectable}
2015-10-27 11:02:57 +02:00
{/block}
{/if}
{/foreach}
</ul>
{/if}