@extends('admin.base')

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