@extends('layout.index', [
	'title' => __('application_module.title'),
	'subtitle' => __('application_module.list'),
	'breadcrumb' => [
	]
])

@include('load.form.select2')
@include('load.form.toggle')


@section('content')

	<nav>
		<div class="nav nav-tabs">
			<a href="#dashboard" data-toggle="tab" class="nav-item nav-link" role="tab" aria-controls="dashboard" aria-selected="true">
				{{ __('dashboard') }}
			</a>
			<a href="#list" data-toggle="tab" class="nav-item nav-link active" role="tab" aria-controls="list" aria-selected="false">
				{{ __('list') }}
			</a>
		</div>
	</nav>

	<div class="tab-content mb-0">

		<div class="tab-pane fade" id="dashboard">
			@component('components.card')
				@include('admin.Core.App.ApplicationModule.partials.dashboard')
			@endcomponent
		</div>

		<div class="tab-pane fade  show active" id="list">
			@component('components.card')
				@include('components.datatable', ['route' => route('Admin.Core.App.ApplicationModule.index'), 'model' => 'application_modules', 'with_filters' => true, 'with_exports' => true, 'callback' => 'handleApplicationModule();'])
			@endcomponent

			@component('components.layout.modal-filters', ['title' => 'Filters', 'id' => 'modal-application_modules-filters'])
				@include('admin.Core.App.ApplicationModule.partials.filters', ['model' => 'applications'])
			@endcomponent
		</div>

	</div>

@endsection

@push('js')
	<script>
		function handleApplicationModule() {
			initToggle("{{ route('Admin.Core.App.ApplicationModule.toggleActive') }}");
		}

		$(document).ready(function () {
			initSelect2();
		});
	</script>
@endpush
