@extends('layouts.admin')

@section('title')

  Gironi categoria {{$category->name}}

@stop

@section('content')

<div class="row">

  <div class="col-xs-8">
    <a href="{{ route('categories.groups.create', $category) }}" class="btn btn-success">Aggiungi</a><br><br>
  </div>

    <div class="col-xs-12">
      <div class="box">

        <div class="box-body table-responsive no-padding">
          <table class="table table-striped table-hover">
            <tr>
              <th>Nome</th>
              <th width="50"></th>
              <th width="50"></th>
            </tr>
            <tbody>
            @foreach($groups as $group)
              <tr>
                <td>{{$group->name}}</td>
                <td>
                    <a href="{{ route('categories.groups.edit', array($category, $group->id)) }}" type="button" class="btn btn-w-m btn-primary">Modifica</a>
                </td>
                <td>
                  {!! Form::open(array('class' => 'form-inline', 'method' => 'DELETE', 'route' => array('categories.groups.destroy', $category, $group->id))) !!}
                      <button type="submit" class="btn btn-w-m btn-danger" onclick="return confirm('Sei sicuro?')">Elimina</button>
                  {!! Form::close() !!}
                </td>
              </tr>
            @endforeach
            </tbody>
          </table>
        </div>

      </div>

    </div>
    
    <div class="col-xs-8">
      <a href="{{ route('categories.index') }}" class="btn btn-info">Torna a categorie</a>
      
    </div>
    
  </div>

@stop
