{{ csrf_field() }}
<div class="box box-primary">
    <div class="box-header with-border">
        <h3 class="box-title"></h3>
    </div>

    <div class="box-body">
        <div class="row">
            <div class="col-md-6">
                <div class="form-group">
                    <label for="name">Nome:</label>
                    <input type="text" name="name" id="name" class="form-control title"
                           value="{{ old('name', isset($team) ? $team->name : '') }}"
                           required>
                </div>
            </div>
            <div class="col-md-6">
                <div class="form-group">
                    <label for="penality">Punti di penalità:</label>
                        <input type="number" name="penality" id="penality" class="form-control"
                           value="{{ old('penality', isset($team) ? $team->penality : '0') }}"
                           min="0" max="50" step="1">
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-6">
                <div class="form-group">
                    <label for="excluded">Esclusa:</label><br>
                    <input type="checkbox" name="excluded" id="excluded" value="on"
                            {{ old('excluded', isset($team) ? $team->excluded : false) ? 'checked' : '' }}>
                </div>
            </div>
            <div class="col-md-3">
                <div class="form-group">
                    <label for="day">Giornata ritiro:</label>
                    <input type="number" name="day" id="day" class="form-control"
                           value="{{ old('day', isset($team) ? $team->day : '') }}"
                           min="1">
                </div>
            </div>
            <div class="col-md-3">
                <div class="form-group">
                    <label>&nbsp;</label>
                    <select class="form-control" name="type">
                        <option value="-"></option>
                        <option value="andata" {{ old('type', isset($team) ? $team->type : '') == 'andata' ? 'selected' : '' }}>Andata</option>
                        <option value="ritorno" {{ old('type', isset($team) ? $team->type : '') == 'ritorno' ? 'selected' : '' }}>Ritorno</option>
                    </select>
                </div>
            </div>
        </div>
    </div>

    <div class="box-footer">
        @if(Auth::user()->only_read == false)
            <button type="submit" class="btn btn-success">{{ $submit_text }}</button>
        @endif
        <a href="{{ route('teams.index', ['type' => Session::get('type') , "category_id" => Session::get('category_id') , "group_id" => Session::get('group_id')]) }}" class="btn btn-info">Annulla</a>
    </div>
</div>

@section('extra_js')

    <script>

    </script>

@stop
