<?php 
global $myUser;
if(!$myUser->can('rank','configure')) throw new Exception("Permissions insuffisantes",403);
?>
<div class="row">
	<div class="col-md-12">
		<br>
		<h3>Rangs</h3>
		<hr/>

		<div id="rankForm" class="row" data-action="save_rank">
			<div class="col-md-4">
				<label for="label">Libellé :</label>
				<input id="label" class="form-control" placeholder="Libellé" type="text">
			</div>
			<div class="col-md-4">
				<label for="description">Description :</label>
				<input id="description" class="form-control" placeholder="Description" type="text">
			</div>
			<div class="col-md-4 text-right">
				<div onclick="save_rank();" class="btn btn-success noLabel"><i class="fas fa-check"></i> Enregistrer</div>
			</div>
		</div>
		<br/>
		<div class="panel panel-default">
			<div class="panel-heading">Rangs existants :</div><br>
			<table id="ranks" class="table table-striped ">
				<thead>
					<tr>
						<th>#</th>
						<th>Libellé</th>
						<th>Description</th>
						<th></th>
					</tr>
				</thead>
				<tbody>
					<tr data-id="{{id}}" class="noDisplay">
						<td>{{id}}</td>
						<td>{{label}}</td>
						<td>{{description}}</td>
						<td class="option option-3 text-right">
							<a href="setting.php?section=right&amp;rank={{id}}" class="btn btn-primary btn-squarred btn-mini"><i class="fas fa-lock"></i></a>
							<div onclick="edit_rank(this)" class="btn btn-info btn-squarred btn-mini"><i class="fas fa-pencil-alt"></i></div>
							<div onclick="delete_rank(this)" class="btn btn-danger btn-squarred btn-mini"><i class="fas fa-times"></i></div>
						</td>
					</tr>
				</tbody>
			</table>
		</div>
	</div>
</div>