/
index.blade.php
127 lines (114 loc) · 5.06 KB
/
index.blade.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
@extends('back.layout')
@section('css')
<link rel="stylesheet" href="//cdn.jsdelivr.net/sweetalert2/6.3.8/sweetalert2.min.css">
<style>
input, th span {
cursor: pointer;
}
</style>
@endsection
@section('button')
<a href="{{ route('posts.create') }}" class="btn btn-primary">@lang('New Post')</a>
@endsection
@section('main')
<div class="row">
<div class="col-md-12">
<div class="box">
<div class="box-header with-border">
<strong>@lang('Status') :</strong>
<input type="checkbox" name="new" @if(request()->new) checked @endif> @lang('New')
<input type="checkbox" name="active" @if(request()->active) checked @endif> @lang('Active')
<div id="spinner" class="text-center"></div>
</div>
<div class="box-body table-responsive">
<table id="users" class="table table-striped table-bordered">
<thead>
<tr>
<th>@lang('Title')<span id="title" class="fa fa-sort pull-right"
aria-hidden="true"></span></th>
<th>@lang('Image')</th>
<th>@lang('Active')<span id="active" class="fa fa-sort pull-right"
aria-hidden="true"></span></th>
<th>@lang('Creation')<span id="created_at" class="fa fa-sort-desc pull-right"
aria-hidden="true"></span></th>
<th>@lang('New')</th>
<th>@lang('SEO Title')<span id="seo_title" class="fa fa-sort pull-right"
aria-hidden="true"></span></th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tfoot>
<tr>
<th>@lang('Title')</th>
<th>@lang('Image')</th>
<th>@lang('Active')</th>
<th>@lang('Creation')</th>
<th>@lang('New')</th>
<th>@lang('SEO Title')</th>
<th></th>
<th></th>
<th></th>
</tr>
</tfoot>
<tbody id="pannel">
@if (session('post-ok'))
@component('back.components.alert')
@slot('type')
success
@endslot
{!! session('post-ok') !!}
@endcomponent
@endif
@include('back.posts.table', compact('posts'))
</tbody>
</table>
</div>
<!-- /.box-body -->
<div id="pagination" class="box-footer">
{{ $links }}
</div>
</div>
<!-- /.box -->
</div>
<!-- /.col -->
</div>
<!-- /.row -->
@endsection
@section('js')
<script src="{{ asset('adminlte/js/back.js') }}"></script>
<script>
var post = (function () {
var url = '{{ route('posts.index') }}'
var swalTitle = '@lang('Really destroy post ?')'
var confirmButtonText = '@lang('Yes')'
var cancelButtonText = '@lang('No')'
var errorAjax = '@lang('Looks like there is a server issue...')'
var onReady = function () {
$('#pagination').on('click', 'ul.pagination a', function (event) {
back.pagination(event, $(this), errorAjax)
})
$('#pannel').on('change', ':checkbox[name="seen"]', function () {
back.seen(url, $(this), errorAjax)
})
.on('change', ':checkbox[name="status"]', function () {
back.status(url, $(this), errorAjax)
})
.on('click', 'td a.btn-danger', function (event) {
back.destroy(event, $(this), url, swalTitle, confirmButtonText, cancelButtonText, errorAjax)
})
$('th span').click(function () {
back.ordering(url, $(this), errorAjax)
})
$('.box-header :radio, .box-header :checkbox').click(function () {
back.filters(url, errorAjax)
})
}
return {
onReady: onReady
}
})()
$(document).ready(post.onReady)
</script>
@endsection