<h3 class="text-white">{{ __('documentation_types') }}</h3>

@include('components.datatable', ['route' => route('Admin.DocumentationType.index'), 'model' => 'documentation_types', 'with_filters' => true, 'with_exports' => true, 'create_callback' => 'DocumentationTypeCreate();', 'edit_callback' => 'DocumentationTypeEdit(id);'])

@component('components.layout.modal-filters', ['title' => 'Filters', 'id' => 'modal-documentation_types-filters'])
	@include('apps.admin.DocumentationType.partials.filters', ['model' => 'documentation_types'])
@endcomponent

@push('js')
	<script>

		function DocumentationTypeCreate(id) {
			var distributor_id = $('#distributor_id').val();
			var url_open = "{{ route('Admin.DocumentationType.modalCreate') }}" + '/' + distributor_id;
			var url_save = "{{ route('Admin.DocumentationType.storeAjax') }}";
			openModal("{{ __('country') }}", '#country-form', url_open, url_save, "DocumentationTypeRefresh();");
		}

		function DocumentationTypeEdit(id) {
			var url_open = "{{ route('Admin.DocumentationType.modalEdit') }}" + '/' + id;
			var url_save = "{{ route('Admin.DocumentationType.storeAjax') }}";
			openModal("{{ __('country') }}", '#country-form', url_open, url_save, "DocumentationTypeRefresh();");
		}

		function DocumentationTypeRefresh()
		{
			reloadDatatable("documentation_types");
		}

	</script>
@endpush
