Refactoring, change menu, add many features
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
|
||||
@if (isset($left_buttons))
|
||||
@foreach ($left_buttons as $button)
|
||||
@include('components.button', ['class' => $button['class'] ?? null, 'icon' => $button['icon'] ?? null, 'txt' => $button['txt'] ?? null, 'id' => $button['id'] ?? null ])
|
||||
@include('components.form.button', ['class' => $button['class'] ?? null, 'icon' => $button['icon'] ?? null, 'txt' => $button['txt'] ?? null, 'id' => $button['id'] ?? null ])
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
<button id="btn-{{ $model ?? null }}-filters" type="button" class="btn bg-gradient-secondary btn-filter" data-toggle="modal" data-target="#modal-{{ $model ?? null }}-filters">
|
||||
<i class="fa fa-fw fa-filter"></i>
|
||||
<div id="{{ $model ?? null }}-filters-badge" class="badge bg-orange text-light" style="top: -10px; position: absolute; display:none;"><i class="fa fa-exclamation-triangle"></i></div>
|
||||
</button>
|
||||
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
var $filter = $('#{{ $model ?? null }}-table-header .btn-filter');
|
||||
@@ -14,6 +16,7 @@
|
||||
$('#modal-{{ $model ?? null }}-filters').modal('hide');
|
||||
var table = window.LaravelDataTables["{{ $model ?? null }}-table"];
|
||||
table.draw();
|
||||
setAlertWhenFiltered('{{ $model ?? null }}');
|
||||
})
|
||||
|
||||
$('#modal-{{ $model ?? null }}-filters .reset').click(function() {
|
||||
@@ -22,6 +25,7 @@
|
||||
$('#{{ $model ?? null }}-filters .select2').val(null).trigger("change");
|
||||
})
|
||||
|
||||
setAlertWhenFiltered('{{ $model ?? null }}');
|
||||
|
||||
/*
|
||||
$filter.on( 'click', function () {
|
||||
|
||||
@@ -4,7 +4,19 @@
|
||||
</button>
|
||||
|
||||
<ul class="dropdown-menu" x-placement="bottom-start">
|
||||
<li class="dropdown-item"><a href="{{ $route }}/mailSelection">{{ __('admin.mail_the_selection') }}</a></li>
|
||||
<li class="dropdown-item"><a href="{{ $route }}/mailAll">{{ __('admin.mail_the_complete_list') }}</a></li>
|
||||
<li class="dropdown-item"><a href="{{ $route }}/mailSelection">{{ __('fg.mail_the_selection') }}</a></li>
|
||||
<li class="dropdown-item"><a href="#" class="{{ $model }}-mailall">{{ __('fg.mail_the_complete_list') }}</a></li>
|
||||
</ul>
|
||||
</span>
|
||||
|
||||
@push('js')
|
||||
|
||||
<script>
|
||||
$('.{{ $model }}-mailall').click(function() {
|
||||
var data = $('#{{ $model }}-filters').serialize();
|
||||
var url = "{{ $route }}/mailAll?" + data;
|
||||
window.location = url;
|
||||
});
|
||||
</script>
|
||||
|
||||
@endpush
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@include('components.select', ['name' => 'pager', 'id_name'=> $model . '_pager', 'list' => [5 => '5', 10 => '10', 25 => '25', 50 => '50', 100 => '100']])
|
||||
@include('components.form.select', ['name' => 'pager', 'id_name'=> $model . '_pager', 'value' => 10, 'list' => [5 => '5', 10 => '10', 25 => '25', 50 => '50', 100 => '100']])
|
||||
|
||||
|
||||
@push('js')
|
||||
|
||||
@@ -6,7 +6,12 @@
|
||||
<script>
|
||||
$('.{{ $model }}-print').click(function() {
|
||||
var data = $('#{{ $model }}-filters').serialize();
|
||||
var url = "{{ $route }}/print?" + data;
|
||||
var order = getDatatableOrderJson('{{ $model }}');
|
||||
console.log(order);
|
||||
var order_txt = $.param(order);
|
||||
console.log(order_txt);
|
||||
var url = "{{ $route }}/print?" + data + '&' + order_txt;
|
||||
console.log(url);
|
||||
// window.location = url;
|
||||
var print = window.open(url, 'print');
|
||||
});
|
||||
|
||||
@@ -11,9 +11,14 @@
|
||||
<div class="col-lg-2 col-md-1 col-6 text-right">
|
||||
@if (isset($right_buttons))
|
||||
@foreach ($right_buttons as $button)
|
||||
@include('components.button', ['class' => $button['class'] ?? null, 'icon' => $button['icon'] ?? null, 'txt' => $button['txt'] ?? null, 'id' => $button['id'] ?? null ])
|
||||
@include('components.form.button', ['class' => $button['class'] ?? null, 'icon' => $button['icon'] ?? null, 'txt' => $button['txt'] ?? null, 'id' => $button['id'] ?? null ])
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
@if (isset($right_content))
|
||||
{!! $right_content !!}
|
||||
@endif
|
||||
|
||||
@if (!(isset($with_add) && (!$with_add)))
|
||||
@include('components.datatables.buttons.add')
|
||||
@endif
|
||||
|
||||
@@ -20,8 +20,12 @@
|
||||
e.preventDefault();
|
||||
// var id = table.row(this).id();
|
||||
var id = $(this).data('id');
|
||||
url = '{{ $route }}' + '/show/' + id;
|
||||
openURL(url);
|
||||
@if (isset($show_callback))
|
||||
{{ $show_callback }}
|
||||
@else
|
||||
url = '{{ $route }}' + '/show/' + id;
|
||||
openURL(url);
|
||||
@endif
|
||||
});
|
||||
|
||||
$('#{{ $model }}-table .btn-del').off('click').click(function (e) {
|
||||
@@ -29,7 +33,7 @@
|
||||
// var id = table.row(this).id();
|
||||
var id = $(this).data('id');
|
||||
|
||||
bootbox.confirm("{{ __('admin.confirmdelete') }}", function (result) {
|
||||
bootbox.confirm("{{ __('fg.confirmdelete') }}", function (result) {
|
||||
if (result === false) return;
|
||||
|
||||
$.ajax({
|
||||
@@ -43,7 +47,7 @@
|
||||
@else
|
||||
table.draw();
|
||||
@endif
|
||||
growl("{{ __('admin.deletesuccess') }}", 'success');
|
||||
growl("{{ __('fg.deletesuccess') }}", 'success');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -7,12 +7,12 @@
|
||||
|
||||
<input type="text" class="form-control search-btn" placeholder="{{ __('search') }}" value="">
|
||||
|
||||
@if ((isset($with_filters) and $with_filters) || (isset($with_colvis) and $with_colvis))
|
||||
@if (($with_filters ?? false) || ($with_colvis ?? false))
|
||||
<div class="input-group-append">
|
||||
@if (isset($with_filters) && $with_filters)
|
||||
@if ($with_filters ?? false)
|
||||
@include('components.datatables.buttons.filters')
|
||||
@endif
|
||||
@if (isset($with_colvis) && $with_colvis)
|
||||
@if ($with_colvis ?? false)
|
||||
@include('components.datatables.buttons.colvis')
|
||||
@endif
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user