@extends('backend.layouts.app')

@section('title', app_name() . ' | ' .'Create clipart')

@section('content')
    {{ html()->form('POST', route('admin.clipart.store'))->attribute('enctype', 'multipart/form-data')->open() }}
    <div class="card">
        <div class="card-body">
            <div class="row">
                <div class="col-sm-5">
                    <h4 class="card-title mb-0">
                        New clipart
                    </h4>
                </div><!--col-->
            </div><!--row-->

            <hr>

            <div class="row mt-4 mb-4">
                <div class="col">
                    <div class=" form-group row " style="border-bottom: 1px solid darkgrey">
                        <h5>Metadata</h5>
                    </div>
                    <div class="form-group row">
                        {{ html()->label('Name')->class('col-md-2 form-control-label')->for('name') }}

                        <div class="col-md-10">
                            {{ html()->text('name')
                                ->class('form-control')
                                ->placeholder('name')
                                ->attribute('maxlength', 254)
                                ->required() }}
                        </div><!--col-->
                    </div><!--form-group-->

                    <div class="form-group row">
                        {{ html()->label('Description')->class('col-md-2 form-control-label')->for('description') }}

                        <div class="col-md-10">
                            {{ html()->textarea('description')
                                ->class('form-control')
                                ->placeholder('Description')
                                }}
                        </div><!--col-->
                    </div><!--form-group-->
                    <div class="form-group row">
                        {{ html()->label('Citations')->class('col-md-2 form-control-label')->for('citations') }}

                        <div class="col-md-10">
                            {{ html()->textarea('citations')
                                ->class('form-control')
                                ->placeholder('Citations')
                                }}
                        </div><!--col-->
                    </div><!--form-group-->



                    <div class="form-group row ">
                        {{ html()->label('Tags')->for('tags[]')->class('col-md-2 form-control-label') }}
                        <div class="col-md-10">
                            {{ html()->multiselect('tags[]', $tags->pluck('text', 'id'))
                              ->class('form-control')
                              }}
                        </div>
                    </div><!--form-group-->
                    <div class="form-group row">
                        {{ html()->label('Paid')->class('col-md-2 form-control-label') }}
                        <div class="col-md-10">
                            <div class="checkbox d-flex align-items-center">
                                {{ html()->label(
                                        html()->checkbox('public')
                                                ->class('switch-input')
                                                ->id('paid')
                                            . '<span class="switch-slider" data-checked="yes" data-unchecked="no"></span>')
                                        ->class('switch switch-label switch-pill switch-primary mr-2')
                                    ->for('public')
                                    }}
                                {{ html()->label('Paid')->for('paid') }}
                            </div>
                        </div>

                    </div><!--form-group-->
                    <div class=" form-group row " style="border-bottom: 1px solid darkgrey">
                        <h5>Files</h5>
                    </div>

                    <div class="row ">
                        <div class="col">
                            <div class="form-group">
                                {{ html()->label('Baseline')->for('baseline')->attribute('style', 'font-weight:bold') }}
                                {{ html()->file('baseline')->class('form-control') }}
                            </div>
                        </div>
                        <div class="col">
                            <div class="form-group">
                                {{ html()->label('Outline')->for('outline')->attribute('style', ' color: black;  font-weight:bolder
                      -webkit-text-fill-color: white;
                      -webkit-text-stroke-width: 0.5px;
                      -webkit-text-stroke-color: black;') }}
                                {{ html()->file('outline')->class('form-control') }}
                            </div>
                        </div>
                    </div>
                    <div class="row ">
                        <div class="col">
                            <div class="form-group">
                                {{ html()->label('Blue')->for('blue')->attribute('style', 'color:blue; font-weight:bold') }}
                                {{ html()->file('blue')->class('form-control') }}
                            </div>
                        </div>
                        <div class="col">
                            <div class="form-group">
                                {{ html()->label('Green')->for('green')->attribute('style', 'color:DarkGreen; font-weight:bold') }}
                                {{ html()->file('green')->class('form-control') }}
                            </div>
                        </div>

                    </div>
                    <div class="row ">
                        <div class="col">
                            <div class="form-group">

                                {{ html()->label('Grey')->for('grey')->attribute('style', 'color:DarkGray; font-weight:bold') }}
                                {{ html()->file('grey')->class('form-control') }}
                            </div>
                        </div>
                        <div class="col">
                            <div class="form-group">
                                {{ html()->label('Purple')->for('purple')->attribute('style', 'color:DarkViolet; font-weight:bold') }}
                                {{ html()->file('purple')->class('form-control') }}
                            </div>
                        </div>
                    </div>
                    <div class="row ">
                        <div class="col">
                            <div class="form-group">
                                {{ html()->label('Red')->for('red')->attribute('style', 'color:DarkRed; font-weight:bold') }}
                                {{ html()->file('red')->class('form-control') }}
                            </div>
                        </div>
                        <div class="col">
                            <div class="form-group">
                                {{ html()->label('Yellow')->for('yellow')->attribute('style', 'color:Gold; font-weight:bold') }}
                                {{ html()->file('yellow')->class('form-control') }}
                            </div>
                        </div>
                    </div>
                </div><!--col-->
            </div><!--row-->
        </div><!--card-body-->

        <div class="card-footer">
            <div class="row">
                <div class="col">
                    {{ form_cancel(route('admin.clipart.index'), __('buttons.general.cancel')) }}
                </div><!--col-->

                <div class="col text-right">
                    {{ form_submit(__('buttons.general.crud.create')) }}
                </div><!--row-->
            </div><!--row-->
        </div><!--card-footer-->
    </div><!--card-->
    {{ html()->closeModelForm() }}
@endsection
@push('after-scripts')
    <script>
        $(document).ready(function () {

            $('select').select2({
                placeholder: 'Select...',
                tags: true
            }).trigger('change');
        })
    </script>
@endpush

@push('after-styles')
    <style>
        .select2 {
            width: 100% !important;
        }
    </style>
@endpush
