@extends('admin.base')

@section('content')
<div class="row page-heading">
  <div class="col-md-12 h3">Agregar Permisos - {{$role->description}}</div>
</div>
<br />
<form class="form-horizontal" method="post" action="{{nUrl('admin', 'do_add_role_permissions', ['role' => $role->id])}}">
  <div class="form-group">
    <div class="col-md-2">Permitidos</div>
    <div class="col-md-3"><select name="allowed[]" class="form-control" multiple="multiple">
      @foreach ($actions as $action)
        <option value="{{$action->id}}"
          @if ($role->checkAccess($action->description))
            selected="selected"
          @endif
          >{{$action->description}}</option>
      @endforeach
    </select></div>
  </div>
  <?php
  /*
  <div class="form-group">
    <div class="col-md-2">Denegados</div>
    <div class="col-md-3"><select name="denied[]" class="form-control" multiple="multiple">
      @foreach ($actions as $action)
        <option value="{{$action->id}}"
          @if (!$role->checkAccess($action->description))
            selected="selected"
          @endif
          >{{$action->description}}</option>
      @endforeach
    </select></div>
  </div>
  */ ?>
  <div class="form-group">
    <div class="col-md-offset-2 col-md-2"><button class="form-control" type="submit">Agregar</button></div>
  </div>
</form>
@endsection
