@extends('layouts.app')

@section('title',"Configuracion del sistema ")

@section('content')
<div class="response-data" style="display: none;"></div>
<div class="card card-menu">
	<form action="{{ url('template') }}" method="POST" data-content="card-menu" id="form-globalmenu" onsubmit="CreateSubmit(this); return false">

		<div class="card-header header-elements-inline">
			<h5 class="card-title">Menu </h5>
			<div class="header-elements">
				<div class="list-icons">
	        		<a class="list-icons-item" data-action="collapse"></a>
	        		<a class="list-icons-item" data-action="reload"></a>
	        		<a class="list-icons-item" data-action="remove"></a>
	        	</div>
	    	</div>
		</div>
		<div class="card-body mt-2">
			<div class="row mb-2">
				<div class="col-6">
					<a href="#" class="addnewitems fadeOut btn btn-primary"><i class="icon-plus3"></i> Agregar nuevo menu</a>
				</div>
				<div class="col-6 text-right">
					<button type="button" class="btn btn-warning" data-toggle="modal" data-target="#iconsmodal">
					  <i class="icon-magazine"></i> 
					  Iconos
					</button>
				</div>
			</div>
				<div class="row ">
					<div class="col-7">
						<div class="dd">
							<ol class="config-menu list-menubo dd-list">
								<input type="hidden" name="action" value="fullsave" >
								@if(!empty($menus))
									@foreach ($menus as $key => $item)
					                  @if ($item['parent'] != 0)
					                      @break
					                  @endif
					                
					                  @include('System.views.menu-items.items', ['item' => $item,'subitem' => '0'])
						            @endforeach
					            @else

								 
					            @endif
							</ol>
						</div>
					</div>
				</div>
		</div>
		<div class="card-footer">
			<div class="row">
	        	<div class="col-12 text-center">
	        		<button class="btn btn-success form-button" ><i class="icon-floppy-disk"></i> Guardar</button>
	        	</div>
	        </div>
		</div>
	</form>
</div>
	@include('System.views.modals.icons')
	@section('scripts')
	
	<script src="{!! asset('assets/views_functions/template.js') !!}"></script>
	@endsection
@endsection