{block content}
	<div class="span3">
		{include '@menu.latte'}
	</div>

	<div class="span9">
		<div class="box-content">
			<div n:foreach="$flashes as $flash" class="alert alert-{$flash->type}">{$flash->message}</div>

			{form userForm}
				<table>
					<tr>
						<td style="padding-right: 20px;">{label firstname /}</td>
						<td>{input firstname}</td>
					</tr>

					<tr>
						<td>{label lastname /}</td>
						<td>{input lastname}</td>
					</tr>

					<tr>
						<td>{label login /}</td>
						<td>{input login}</td>
					</tr>

					<tr>
						<td>{label pwd /}</td>
						<td>{input pwd}</td>
					</tr>

					<tr>
						<td>{label id_role /}</td>
						<td>{input id_role}</td>
					</tr>

					<tr>
						<td>{label ip_lock /}</td>
						<td>{input ip_lock}</td>
					</tr>

					<tr id="user-ip-toggle" style="display: none;">
						<td>{label ip /}</td>
						<td>{input ip, class => 'user-ip-input'}&nbsp;&nbsp;<a href="#" class="btn user-get-actual-ip" style="margin-top: -10px;"><i class="icon-globe"></i>&nbsp;Načíst aktuální</a></td>
					</tr>

					<tr>
						<td></td>
						<td>{input submit, style => 'margin-top: 15px;'}</td>
					</tr>
				</table>
			{/form}
		</div>
	</div>

	<script type="text/javascript">
		$(document).ready(function() {

			$('.user-get-actual-ip').on('click', function(event) {

				$.nette.ajax({
					url: {link getActualIp!},
					method: 'GET',
					success: function(data) {
						$('.user-ip-input').val(data.ip);
					}
				});

			});

		});
	</script>
