Update with new price management
This commit is contained in:
@@ -1,11 +1,15 @@
|
||||
<button type="button" class="btn bg-primary btn-add"><i class="fa fa-plus-circle"></i></button>
|
||||
<button type="button" class="btn bg-primary btn-add"><i class="fa fa-fw fa-plus-circle"></i></button>
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
$('#{{ $model }}-table-header .btn-add').click(function() {
|
||||
url = '{{ $route }}' + '/create/';
|
||||
window.location = url;
|
||||
// openUrl(url);
|
||||
@if (isset($create_callback))
|
||||
{{ $create_callback }};
|
||||
@else
|
||||
url = '{{ $route }}' + '/create/';
|
||||
window.location = url;
|
||||
// openUrl(url);
|
||||
@endif
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<button type="button" class="btn bg-gradient-secondary btn-colvis" style="border-left: 1px solid rgba(0,0,0,0.1);">
|
||||
<i class="fa fa-columns"></i>
|
||||
<i class="fa fa-fw fa-columns"></i>
|
||||
</button>
|
||||
|
||||
@push('js')
|
||||
@@ -7,14 +7,14 @@
|
||||
var $colvis = $('#{{ $model }}-table-header .btn-colvis');
|
||||
|
||||
$colvis.on( 'click', function () {
|
||||
var table = window.LaravelDataTables["{{ $model }}-table"];
|
||||
console.log(table);
|
||||
var table = getDatatable("{{ $model }}");
|
||||
// console.log(table);
|
||||
|
||||
console.log(table.column(1).dataSrc());
|
||||
// console.log(table.column(1).dataSrc());
|
||||
var header = table.column(1).header();
|
||||
console.log($(header).html());
|
||||
// console.log($(header).html());
|
||||
var visible = table.column(1).visible();
|
||||
console.log(visible);
|
||||
// console.log(visible);
|
||||
|
||||
/*
|
||||
// var names = table.columns().names();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<span>
|
||||
<button type="button" class="btn bg-gradient-secondary dropdown-toggle btn-excel" data-toggle="dropdown" aria-expanded="false">
|
||||
<i class="fa fa-download"></i>
|
||||
<i class="fa fa-fw fa-download"></i>
|
||||
</button>
|
||||
|
||||
<ul class="dropdown-menu" x-placement="bottom-start">
|
||||
|
||||
@@ -1,8 +1,15 @@
|
||||
<button type="button" class="btn bg-gradient-secondary dropdown-toggle btn-excel" data-toggle="dropdown" aria-expanded="false">
|
||||
<i class="fa fa-file-excel"></i>
|
||||
<button type="button" class="btn bg-gradient-secondary {{ $model }}-excel">
|
||||
<i class="fa fa-fw fa-file-excel"></i>
|
||||
</button>
|
||||
|
||||
<ul class="dropdown-menu" x-placement="bottom-start">
|
||||
<li class="dropdown-item"><a href="#">Exporter la sélection</a></li>
|
||||
<li class="dropdown-item"><a href="{{ $route }}/export">Exporter la liste complète</a></li>
|
||||
</ul>
|
||||
@push('js')
|
||||
|
||||
<script>
|
||||
$('.{{ $model }}-excel').click(function() {
|
||||
var data = $('#{{ $model }}-filters').serialize();
|
||||
var url = "{{ $route }}/exportExcel?" + data;
|
||||
window.location = url;
|
||||
});
|
||||
</script>
|
||||
|
||||
@endpush
|
||||
|
||||
@@ -1,30 +1,31 @@
|
||||
<button type="button" class="btn bg-gradient-secondary btn-filter" data-toggle="modal" data-target="#modal-filters">
|
||||
<i class="fa fa-filter"></i>
|
||||
<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>
|
||||
</button>
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
var $filter = $('#{{ $model }}-table-header .btn-filter');
|
||||
var $filter = $('#{{ $model ?? null }}-table-header .btn-filter');
|
||||
|
||||
$('#modal-filters').on('shown.bs.modal', function () {
|
||||
$('#modal-{{ $model ?? null }}-filters').on('shown.bs.modal', function () {
|
||||
initSelect2();
|
||||
});
|
||||
|
||||
$('#modal-filters .apply').click(function() {
|
||||
$('#modal-filters').modal('hide');
|
||||
var table = window.LaravelDataTables["{{ $model }}-table"];
|
||||
$('#modal-{{ $model ?? null }}-filters .apply').click(function() {
|
||||
$('#modal-{{ $model ?? null }}-filters').modal('hide');
|
||||
var table = window.LaravelDataTables["{{ $model ?? null }}-table"];
|
||||
table.draw();
|
||||
})
|
||||
|
||||
$('#modal-filters .reset').click(function() {
|
||||
$('#filters').trigger("reset");
|
||||
$('#filters .select2').val(null).trigger("change");
|
||||
$('#modal-{{ $model ?? null }}-filters .reset').click(function() {
|
||||
// $('#{{ $model ?? null }}-filters').trigger("reset");
|
||||
$('#{{ $model ?? null }}-filters').closest('form').find("input[type=text], select").val("");
|
||||
$('#{{ $model ?? null }}-filters .select2').val(null).trigger("change");
|
||||
})
|
||||
|
||||
|
||||
/*
|
||||
$filter.on( 'click', function () {
|
||||
var table = window.LaravelDataTables["{{ $model }}-table"];
|
||||
var table = window.LaravelDataTables["{{ $model ?? null }}-table"];
|
||||
// table.search($search.val()).draw();
|
||||
openModal('{{ __('Filters') }}', '{{ $route }}/getFiltersHtml', {
|
||||
onApply: function() {
|
||||
|
||||
10
resources/views/components/datatables/buttons/mail.blade.php
Normal file
10
resources/views/components/datatables/buttons/mail.blade.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<span>
|
||||
<button type="button" class="btn bg-gradient-secondary dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
|
||||
<i class="fa fa-fw fa-envelope-open-text"></i>
|
||||
</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>
|
||||
</ul>
|
||||
</span>
|
||||
@@ -4,10 +4,17 @@
|
||||
@push('js')
|
||||
|
||||
<script>
|
||||
$('#{{ $model }}_pager').change(function() {
|
||||
var table = window.LaravelDataTables["{{ $model }}-table"];
|
||||
var len = $(this).val();
|
||||
table.page.len(len).draw();
|
||||
$( document ).ready(function() {
|
||||
var table = getDatatable("{{ $model }}");
|
||||
var state = getDatatableState("{{ $model }}");
|
||||
|
||||
if (state && (typeof(state.length) != 'undefined')) {
|
||||
$('#{{ $model }}_pager').val(state.length);
|
||||
}
|
||||
|
||||
$('#{{ $model }}_pager').change(function() {
|
||||
table.page.len($(this).val()).draw();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
<button type="button" class="btn bg-gradient-secondary btn-pdf">
|
||||
<i class="fa fa-file-pdf"></i>
|
||||
</button>
|
||||
<span>
|
||||
<button type="button" class="btn bg-gradient-secondary btn-pdf">
|
||||
<i class="fa fa-fw fa-file-pdf"></i>
|
||||
</button>
|
||||
</span>
|
||||
@@ -1,27 +1,15 @@
|
||||
<span>
|
||||
<button type="button" class="btn bg-gradient-secondary dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
|
||||
<i class="fa fa-print"></i>
|
||||
</button>
|
||||
|
||||
<ul class="dropdown-menu" x-placement="bottom-start">
|
||||
<li class="dropdown-item printWithFilter"><a href="#" target="_BLANK">Imprimer la sélection</a></li>
|
||||
<li class="dropdown-item"><a href="{{ $route }}/print" target="_BLANK">Imprimer la liste complète</a></li>
|
||||
</ul>
|
||||
</span>
|
||||
<button type="button" class="btn bg-gradient-secondary {{ $model }}-print">
|
||||
<i class="fa fa-fw fa-print"></i>
|
||||
</button>
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
var $print = $('#{{ $model }}-table-header .btn-print');
|
||||
$print.on( 'click', function () {
|
||||
var table = window.LaravelDataTables["{{ $model }}-table"];
|
||||
table.button(1).trigger();
|
||||
});
|
||||
|
||||
$('.printWithFilter').click(function() {
|
||||
var data = $('#filters').serialize();
|
||||
$('.{{ $model }}-print').click(function() {
|
||||
var data = $('#{{ $model }}-filters').serialize();
|
||||
var url = "{{ $route }}/print?" + data;
|
||||
window.location = url;
|
||||
})
|
||||
// window.location = url;
|
||||
var print = window.open(url, 'print');
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
|
||||
Reference in New Issue
Block a user