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

@section('content')
	@component('components.card')
		@include('components.datatable', [
			'route' => route('Admin.Core.Mail.MailLog.index'),
			'model' => 'mail_logs',
            'with_add' => false,
            'with_print' => false,
			'with_filters' => true,
            'show_callback' => 'MailLogShow(id);',
		])
	@endcomponent

	@component('components.layout.modal-filters', ['title' => 'Filters', 'id' => 'modal-mail_logs-filters'])
		@include('admin.Core.Mail.MailLog.partials.filters', ['model' => 'mail_logs'])
	@endcomponent

@endsection

@include('load.form.select2')

@push('js')
	<script>

		function MailLogShow(id) {
			var url_open = "{{ route('Admin.Core.Mail.MailLog.show') }}/" + id;
			openModal("{{ __('admin.Core.MailLog.modal') }}", '#mail_log-form', url_open, false, false, "xl");
		}

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