{{ 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="title">Titolo:</label>
                    <input type="text" name="title" id="title" class="form-control title" maxlength="150"
                    value="{{ old('title', isset($breaking_news) ? $breaking_news->title : '') }}" required>
                </div>
            </div>
            <div class="col-md-6">
                <div class="form-group">
                    <label for="date">Data:</label>
                    <input type="text" name="date" id="date" class="form-control"
                    value="{{ old('date', isset($breaking_news) ? $breaking_news->date : date('d/m/Y H:i')) }}" required>
                </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" id="online" value="on"
                                   {{ old('online', isset($breaking_news) ? $breaking_news->online : false) ? 'checked' : '' }}>
                </div>
            </div>
        </div>
    </div>

    <div class="box-footer">
        <button type="submit" class="btn btn-success" name="save">{{ $submit_text }}</button>
        <a href="{{ route('breaking_news.index') }}" class="btn btn-info">Annulla</a>
    </div>
</div>

@section('extra_js')

    <script src="/backend/plugins/input-mask/jquery.inputmask.js"></script>
    <script src="/backend/plugins/input-mask/jquery.inputmask.date.extensions.js"></script>
    <script src="/backend/plugins/input-mask/jquery.inputmask.extensions.js"></script>

    <script src="/backend/plugins/moment/moment.min.js"></script>
    <script src="/backend/plugins/daterangepicker/daterangepicker.js"></script>

    <script>
        $(function () {

            $("[name='date']").daterangepicker({ singleDatePicker: true, timePicker: true, timePicker24Hour: true, locale: { format: 'DD/MM/YYYY HH:mm' }})

        });
    </script>

@stop
