{{ 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($group) ? $group->name : '') }}"
                        required>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-md-6">
                <div class="form-group">
                    <label for="url">Url sponsor:</label>
                    <input type="url" name="url" id="url" class="form-control"
                           value="{{ old('url', isset($group) ? $group->url : '') }}">
                </div>
            </div>
            <div class="col-md-6">
                <div class="form-group">
                    <label for="image">Banner Pubblicitario:</label><br>
                    <div class="custom-file-upload">
                        <input type="file" name="image" id="image" class="form-control" accept="image/*">
                    </div>
                    @if (isset($group) && $group->image != '')
                        <br>
                        <div class="current-image">
                            <small class="text-muted">Banner corrente: {{ $group->image }}</small>
                        </div>
                    @endif
                </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('categories.groups.index', $category) }}" class="btn btn-info">Annulla</a>
    </div>
</div>

@section('extra_js')

    <script>

        $(function () {



        });

    </script>
@stop
