@extends('backend.layouts.backend')

@section('content')

<script>
    routeCommonSaveImage = '{!! route("admin.wysiwyg.common.saveimage") !!}';   
</script>
            
{{ style('modules/wysiwyg/css/backend/common.css') }}
{{ script('modules/wysiwyg/js/backend/common.js') }}

<!-- Laravel Javascript Validation -->
<!-- Vendor JS/CSS already loaded on master layout -->
<!-- <script type="text/javascript" src="{{ asset('vendor/jsvalidation/js/jsvalidation.js')}}"></script>  -->
{!! JsValidator::formRequest('Rvsitebuilder\Wysiwyg\Http\Requests\CommonRequest', '#create_item_form'); !!}
{!! JsValidator::formRequest('Rvsitebuilder\Wysiwyg\Http\Requests\CommonRequest', '#update_item_form'); !!}

<!-- *************************************************************** -->

<button class="testimage" >Test image ajax</button>


<h2>Item LIST (AJAX)</h2>
<button class="uk-button create-post-modal" data-uk-modal="{target:'#createItemModal'}">CREATE ITEM</button> <br/><br/>

<table class="table table-bordered" id="items-table">
	<thead>

		<tr>
			<th>data</th>
<th>data2</th>
<th>actions</th>

        </tr>

        </thead>

        <tfoot>

        <tr>
<th>data</th>
<th>data2</th>
<th>actions</th>

        </tr>

        </tfoot>

        <tbody>

        @if (isset($commons)) @foreach ($commons as $common)
        <tr id="tr_{{ $common->id }}">
                <td class="item_data">{{ $common->data }}</td>
        <td class="item_data2">{{ $common->data2 }}</td>
        <td>
        <button class="uk-button edit-post-modal" data-uk-modal="{target:'#editItemModal'}" data-id="{{ $common->id }}">edit</button>
        <button type="button" class="uk-button" data-id="{{ $common->id }}" onclick="UIkit.modal.confirm('Are you sure to delete <b>{{ $common->id }}</b> ?' , function(){ crud_post_delete('{{ $common->id }}'); });">x</button>
        </td>

        </tr>

		@endforeach @endif
	</tbody>
</table>


@stop