{% import 'main/macros.tpl.html' as macro %}
{{ macro.table_search(label_search) }}
<div class="table-responsive">
	<table class="table table-striped table-hover table-bordered">
		<thead>
			<tr>
				<th scope="col">{{ label_user }}</th>
				<th scope="col">{{ label_email }}</th>
				<th scope="col">{{ label_mobile }}</th>
				<th scope="col" class="d-none d-lg-table-cell full">{{ label_servers }}</th>
				<th scope="col">&#32</th>
			</tr>
		</thead>
		<tbody>
			{% for user in users %}
			<tr>
				<th scope="row">
					{% if user.level == '10' %}
					<i class="fas fa-user-astronaut " title="{{ user.level_text }}"></i>&nbsp;
					{% elseif user.level == '20' %}
					<i class="fas fa-user " title="{{ user.level_text }}"></i>&nbsp;
					{% endif %}
					{{ user.user_name }} <span class="">({{ user.name }})</span></th>
				<td>{{ user.email }}</td>
				<td>{{ user.mobile }}</td>
				<td class="d-lg-table-cell full">
					{% for server in user.emp_servers %} 
					<a href="{{ server.url|raw }}">{{ server.label }}</a><br />
					{% endfor %}
				</td>
				<td>
					<div class="item-action dropdown">
						<a data-toggle="dropdown" class="icon">
							<i class="fas fa-ellipsis-v"></i>
						</a>
						<noscript><div hidden></noscript>
						<div class="dropdown-menu">
							<a class="dropdown-item" href="{{ user.url_edit|raw }}" title="{{ label_edit }}">
								<i class="fas fa-edit"></i> {{ label_edit }}
							</a>
							<a class="dropdown-item show-modal" href="{{ user.url_delete|raw }}" title="{{ label_delete }}" data-modal-id="delete"
							 data-modal-param="{{ user.user_name }}">
								<i class="fas fa-trash"></i> {{ label_delete }}
							</a>
						</div>
					<noscript>
					</div>
						<a href="{{ user.url_edit|raw }}" title="{{ label_edit }}">
							&#9998
						</a>
						<br>
						<a href="{{ user.url_delete|raw }}" title="{{ label_delete }}" data-modal-id="delete"
							data-modal-param="{{ user.user_name }}">
							&#10005
						</a>
					</noscript>
					</div>
				</td>
			</tr>
			{% endfor %}
		</tbody>
	</table>
</div>