@extends('layouts.default')
@section('title', 'Email Templates')
@section('content')
    <div class="row">
    @if ($message = Session::get('success'))
        <div class="alert alert-success">
            <p>{{ $message }}</p>
        </div>
    @endif
    @if ($message = Session::get('errors'))
        <div class="alert alert-danger">
            <p>{{ $message }}</p>
        </div>
    @endif

            <h2>Email Templates Management
                <a href="{{ route('ticket-email-templates.create') }}" class="btn pull-right"><i class="icon-plus"></i> Create new Email Templates</a>
            </h2>
    </div>
                <div class="table-bx">
                    <table id="table_tickets" class="table table-striped table-bordered dt-responsive nowrap" style="width:100%">
                        <thead>
                            <tr>
                            <th>ID</th>
                            <th>Subject</th>
                            <th>Last Updated</th>
                            <th>Actions</th>
                            </tr>
                        </thead>
                        <tbody>
                        </tbody>
                        <tfoot>
                            <tr>
                            <th>ID</th>
                            <th>Subject</th>
                            <th>Last Updated</th>
                            <th>Actions</th>
                            </tr>
                        </tfoot>
                    </table>
                </div>
@endsection
@section('scripts')
<script>
    $(function() {
        var dtListUsers = $('#table_tickets').DataTable({
            processing: true,
            serverSide: true,
            ajax: '{{ route('loaddata.index',['action' => 'emailtemplates']) }}',
            columns: [
                { data: 'id', name: 'id' },
                { data: 'title', name: 'title' },
                { data: 'updated_at', name: 'updated_at' },
                { data: 'action', name: 'action', orderable: false, searchable: false, className: 'text-right' }
            ],
            "aaSorting": [],
            "pageLength": 25
        });
    });
</script>
@stop