@extends('admin.base')

@section('content')
<div class="page-heading row">
	<div class="col-md-6 h3">Roles</div>
	<div class="col-md-6 text-right h3"><a href="{{url('', ['p' => 'admin', 'a' => 'add_role'])}}"><span class="glyphicon glyphicon-plus"></span></a></div>
</div>
<table class="table">
	<thead>
		<tr>
			<th>Descripci&oacute;n</th>
			<th>Nivel</th>
			<th>Usuarios</th>
			<th></th>
		</tr>
	</thead>
	<tbody>
@foreach ($roles as $role)
		<tr>
			<td><a href="{{nUrl('admin', 'role', ['role' => $role->id])}}">{{$role->description}}</a></td>
			<td>{{$role->level}}</td>
			<td>
	@foreach ($role->users() as $user)
				{{$user->name}}
	@endforeach
			</td>
			<td><a href="{{url('', ['p' => 'admin', 'a' => 'delete_role'])}}"><span class="glyphicon glyphicon-minus"></span></a></td>
		</tr>
@endforeach
	</tbody>
</table>
@endsection
