{{ 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" class="form-control title" value="{{ old('name') }}">
                </div>                
            </div>
            <div class="col-md-6" style="display:none">
                <div class="form-group">
                    <label for="position">Posizione:</label>
                    {{-- TODO: Convert Form::select for position manually --}}
<select name="position" class="form-control">
    {{-- Add options manually --}}
</select>
                </div>                
            </div>
        </div>
        <div class="row">
            <div class="col-md-6">
                <div class="form-group">
                    <label for="google_code">Codice Google:</label>
                    <input type="text" name="google_code" class="form-control" value="{{ old('google_code') }}">
                </div>                
            </div>
        </div>
        <h4>Oppure</h4>
        <div class="row">
            <div class="col-md-6">
                <div class="form-group">
                    <label for="image">Immagine:</label>
                    <div class="custom-file-upload"><input type="file" name="image" class="form-control"></div>
                    @if (isset($adv) && $adv->image != '')
                        <br><img src="/files/adv/{{$adv->image}}" style="max-width:250px" />
                    @endif
                </div>                
            </div>
            <div class="col-md-6">
                <div class="form-group">
                    <label for="jingle">Jingle:</label>
                    <div class="custom-file-upload"><input type="file" name="jingle" class="form-control"></div>
                    @if (isset($adv) && $adv->jingle != '')
                        
                    @endif
                </div>                
            </div>
        </div>
        <div class="row">
            <div class="col-md-6">
                <div class="form-group">
                    <label for="url">Url:</label>
                    <input type="text" name="url" class="form-control" value="{{ old('url') }}">
                </div>                
            </div>
        </div>
        <div class="row">
            <div class="col-md-6">
                <div class="form-group">
                    <label for="online">Online:</label><br>
                    <input type="checkbox" name="online" value="on" {{ old('online') ? 'checked' : '' }}>
                </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
        {!! link_to_route('events.advs.index', 'Annulla', $event, array('class' => 'btn btn-info')) !!}
    </div>
</div>

@section('extra_js')

    <script>
        
        $(function () {

        
            
        });

    </script>
@stop