@extends('admin.base')

@section('content')
  <div class="panel panel-default">
  	<div class="panel-heading">Registros</div>
  	<div class="panel-body">
      @include('admin.registros.controles_avance')
      <table class="table table-striped">
       <thead>
         <tr>
           <th>Usuario</th>
           <th>Roles</th>
           <th>Fecha - Hora</th>
           <th>Modelo</th>
           <th>Cambios</th>
         </tr>
       </thead>
       <tbody>
         @foreach ($registros as $registro)
           <tr>
             <td>{{$registro->user()->name}}</td>
             <td>
               @foreach ($registro->user()->roles() as $rol)
                 <span class="label label-default" style="padding: 3px; background-color: {{$colores[$rol->level]->toRGB()}};
                   @if ($colores[$rol->level]->isDark())
                     color: #fff;
                   @endif
                   ">{{ucwords($rol->description)}}</span>
               @endforeach
             </td>
             <td><a href="{{url('admin/registro/' . $registro->id)}}">{{$registro->time()->format('d-m-Y - H:i:s')}} hrs.</a></td>
             <td>{{$registro->model()}}</td>
             <td>{{count($registro->actions())}}</td>
           </tr>
         @endforeach
       </tbody>
      </table>
      @include('admin.registros.controles_avance')
  	</div>
  </div>
@endsection
