
	<!-- Page header -->
	{capture name="buttons"}
{*		<a class="btn btn-sm btn-primary mx-1" data-bs-popup="popover-solid" data-bs-trigger="hover" title=" Добавить группу" data-bs-placement="top" href="{$adminUrl}/managergroups?action=edit{if !empty($page)}&page={$page}{/if}"><i class="icon-plus3"></i></a>*}
		<a class="btn btn-sm btn-primary mx-1" data-bs-popup="tooltip" title="{general:add} администратора" data-bs-placement="auto" href="{$adminUrl}/developer?action=add{if !empty($page)}&page={$page}{/if}"><i class="icon-plus3"></i></a>
	{/capture}
	{capture name="breadcrumb"}
		<a href="{$adminUrl}/developers" class="breadcrumb-item">{if isset($title)}{$title}{/if}</a>
	{/capture}

	{capture name="showBy"}
	    {include file="module/show-by.tpl" url="{$adminUrl}/developers"}
	{/capture}

	{include file="components/page-header.tpl" buttons=$smarty.capture.buttons breadcrumb=$smarty.capture.breadcrumb showBy=$smarty.capture.showBy}
	<!-- /page header -->

	<div class="content">

	    <div class="card border shadow-sm">
		    <div class="">
		        <table class="table table-togglable table-xs table-striped table-hover managers-archive" id="managers">
	            <thead>
	                <tr>
						<th class="text-start gridjs-th-sort main-th-col-sortable" onclick="tableSort(this, '{$module}'); return false;" data-sort-by="fullName" data-sort-order="{if isset($sortOrder.column) && $sortOrder.column eq 'fullName'}{if $sortOrder.sort eq 'asc'}desc{else}asc{/if}{else}asc{/if}">{managers:title} <button class="gridjs-sort gridjs-sort-{if isset($sortOrder.column) && $sortOrder.column eq 'fullName'}{$sortOrder.sort}{else}neutral{/if}"></button></th>
						<th class="text-start gridjs-th-sort main-th-col-sortable" onclick="tableSort(this, '{$module}'); return false;" data-sort-by="email" data-sort-order="{if isset($sortOrder.column) && $sortOrder.column eq 'email'}{if $sortOrder.sort eq 'asc'}desc{else}asc{/if}{else}asc{/if}">{managers:email} <button class="gridjs-sort gridjs-sort-{if isset($sortOrder.column) && $sortOrder.column eq 'email'}{$sortOrder.sort}{else}neutral{/if}"></button></th>
	                    <th data-toggle="true">{general:table:type}</th>
	                    <th data-toggle="true">{general:table:status}</th>
	                    <th class="text-center text-muted" width="30">
							<div class="btn-group">
								<a href="javascript:void(0);" class="align-items-center text-body dropdown-toggle" data-bs-toggle="dropdown"><i class="ph-gear"></i></a>
								<div class="dropdown-menu" style="">
									<button class="dropdown-item" onclick="clearTableSort(this, '{$module}'); return false;" type="button"><i class="ph-check me-2"></i>Сбросить сортировку</button>
								</div>
							</div>
						</th>
	                </tr>
	            </thead>
	            {if isset($managers)}
	            <tbody>
	                {foreach item=manager from=$managers name=managers}
	                <tr id="manager-{$manager.userId}" class="">
	                    <td class="text-nowrap">
	                        <div class="d-flex align-items-center">
								<div class="status-indicator-container me-3">
									<img src="{if isset($manager.image)}{$manager.image.medium}{else}/admin/assets/img/no_images.jpg{/if}" class="rounded-circle" width="40" height="40">
									<span class="status-indicator {if $manager.status eq 1}bg-success{elseif $manager.status eq 1}bg-slate{elseif $manager.status eq 2 || $manager.status eq 3}bg-danger{elseif $manager.status eq 4 || $manager.status eq 5}bg-primary {else}bg-grey{/if} mr-1"></span>
								</div>
								<div>
									<a href="{$adminUrl}/developer?action=edit&id={$manager.userId}" class="text-body fw-semibold letter-icon-title">{if !empty($manager.fullName)}{$manager.fullName nofilter}{/if}</a>
									<div class="d-flex align-items-center text-muted fs-sm">
										{$manager.last_login|date_format:"%d.%m.%Y %H:%M"}
									</div>
								</div>
							</div>
	                    </td>

	                    <td class="text-nowrap">{if !empty($manager.email)}{$manager.email}{else}Email не указан{/if}</td>
	                    <td class="text-nowrap">{$manager.accessLevelName|upper}</td>
	                    <td class="text-nowrap">{$manager.statusName}</td>
	                    <td class="text-start">
	                        <div class="d-inline-flex">
		                        <a class="text-primary" data-bs-popup="tooltip" title="{general:edit}" data-bs-placement="auto" href="{$adminUrl}/developer?action=edit&id={$manager.userId}{if !empty($page)}&page={$page}{/if}{$buildQueryString}"><i class="ph-note-pencil me-2"></i></a>
								<div class="dropdown">
	                                {if $smarty.foreach.managers.iteration > 2}
		                            <a class="text-body" data-bs-toggle="dropdown"><i class="ph-list"></i></a>
		                            <div class="dropdown-menu dropdown-menu-end">
										<a class="dropdown-item" href="{$adminUrl}/developer?action=edit&id={$manager.userId}{if !empty($page)}&page={$page}{/if}{$buildQueryString}"><i class="ph-note-pencil me-2"></i>{general:edit}</a>
										<div class="dropdown-divider"></div>
										<button class="dropdown-item text-danger" onclick="remove({$manager.userId}, '{if !empty($manager.fullName)}{$manager.fullName}{/if}', 'developers')"><i class="ph-trash me-2"></i>{general:delete}</button>
									</div>
	                                {/if}
								</div>
							</div>
	                    </td>
	                </tr>
	            {/foreach}
	            </tbody>

	            {else}
	            <tbody><tr class="odd"><td class="text-center" colspan="5">- {general:none} -</td></tr></tbody>
	            {/if}
	        </table>
		    </div>
	        {include file="module/pagination.tpl" url="{$adminUrl}/developers" params="{$buildQueryString}"}
	    </div>
	</div>

	<script>

	    function deleteSuccess(id) {
	        new Noty({ text: '{managers:messages:1}', layout: 'topRight', type: 'success', timeout: 1500 }).show();
	        removeElement(id, 'manager');
	    }

	    function deleteError() {
	        new Noty({ text: '{managers:errors:15}', layout: 'topRight', type: 'error' }).show();
	    }

	    function userNotFound() {
	        new Noty({ text: '{managers:errors:1}', layout: 'topRight', type: 'error' }).show();
	    }

	    function notDeleteAdministrator() {
	        new Noty({ text: '{managers:errors:6}', layout: 'topRight', type: 'error' }).show();
	    }

	    function notDeleteDeveloper() {
	        new Noty({ text: '{managers:errors:14}', layout: 'topRight', type: 'error' }).show();
	    }



	</script>



