Enhance interface
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
<input type="hidden" name="prices[{{ $key }}][attributes][quantity]" value="1">
|
<input type="hidden" name="prices[{{ $key }}][attributes][quantity]" value="1">
|
||||||
<input type="hidden" name="prices[{{ $key }}][attributes][id]" value="{{ (isset($attribute['id'])) ? $attribute['id'] : null }}">
|
<input type="hidden" name="prices[{{ $key }}][attributes][id]" value="{{ (isset($attribute['id'])) ? $attribute['id'] : null }}">
|
||||||
|
|
||||||
<div class="col-12 col-lg-6">
|
<div class="col-12 col-lg-7">
|
||||||
{{ Form::label('attribute_family_id', 'Attributs') }}<br/>
|
{{ Form::label('attribute_family_id', 'Attributs') }}<br/>
|
||||||
@include('components.select', [
|
@include('components.select', [
|
||||||
'name' => "prices[$key][attributes][attribute_family_id]",
|
'name' => "prices[$key][attributes][attribute_family_id]",
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
])
|
])
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-12 col-lg-6">
|
<div class="col-12 col-lg-5">
|
||||||
{{ Form::label('attribute_value_id', 'Valeur') }}<br/>
|
{{ Form::label('attribute_value_id', 'Valeur') }}<br/>
|
||||||
@include('components.select', [
|
@include('components.select', [
|
||||||
'name' => "prices[$key][attributes][attribute_value_id]",
|
'name' => "prices[$key][attributes][attribute_value_id]",
|
||||||
|
|||||||
@@ -8,28 +8,37 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
<div class="col-lg-1">
|
<div class="col-lg-1">
|
||||||
{{ Form::label('quantity', 'Quantité') }}<br/>
|
{{ Form::label('quantity', 'Qté.') }}<br/>
|
||||||
@include('components.number', ['name' => "prices[$key][quantity]", 'value' => (isset($price['quantity'])) ? $price['quantity'] : 1, 'required' => true, 'class' => 'form-control-sm'])
|
@include('components.number', ['name' => "prices[$key][quantity]", 'value' => (isset($price['quantity'])) ? $price['quantity'] : 1, 'required' => true, 'class' => 'form-control-sm'])
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-lg-5">
|
<div class="col-lg-4">
|
||||||
@include('Shop.Admin.Articles.partials.prices.block_attribute', ['attribute' => $price['article_attributes'][0]])
|
@include('Shop.Admin.Articles.partials.prices.block_attribute', ['attribute' => $price['article_attributes'][0]])
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-lg-1">
|
<div class="col-lg-6">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-3">
|
||||||
{{ Form::label('tax_id', 'TVA') }}<br/>
|
{{ Form::label('tax_id', 'TVA') }}<br/>
|
||||||
@include('components.select', ['name' => "prices[$key][tax_id]", 'value' => (isset($price['tax_id'])) ? $price['tax_id'] : null, 'list' => isset($taxes_options) ? $taxes_options : null, 'required' => true, 'class' => 'form-control form-control-sm'])
|
@include('components.select', ['name' => "prices[$key][tax_id]", 'value' => (isset($price['tax_id'])) ? $price['tax_id'] : null, 'list' => isset($taxes_options) ? $taxes_options : null, 'required' => true, 'class' => 'form-control form-control-sm'])
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-lg-2">
|
<div class="col-3">
|
||||||
|
{{ Form::label('generic_price_id', 'Générique') }}<br/>
|
||||||
|
@include('components.select', ['name' => "prices[$key][generic_price_id]", 'value' => (isset($price['generic_price_id'])) ? $price['generic_price_id'] : null, 'list' => ['Tarif barquette','Tarif semences'], 'required' => false, 'class' => 'form-control-sm'])
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-3">
|
||||||
{{ Form::label('price', 'Prix HT') }}
|
{{ Form::label('price', 'Prix HT') }}
|
||||||
@include('components.money', ['name' => "prices[$key][price]", 'value' => (isset($price['price'])) ? $price['price'] : 0, 'required' => true, 'class' => 'form-control-sm price-item'])
|
@include('components.money', ['name' => "prices[$key][price]", 'value' => (isset($price['price'])) ? $price['price'] : 0, 'required' => true, 'class' => 'form-control-sm price-item'])
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-lg-2">
|
<div class="col-3">
|
||||||
{{ Form::label('price_taxed', 'Prix TTC') }}
|
{{ Form::label('price_taxed', 'Prix TTC') }}
|
||||||
@include('components.money', ['name' => "prices[$key][price_taxed]", 'value' => (isset($price['price_taxed'])) ? $price['price_taxed'] : 0, 'required' => true, 'class' => 'form-control-sm price-taxed-item'])
|
@include('components.money', ['name' => "prices[$key][price_taxed]", 'value' => (isset($price['price_taxed'])) ? $price['price_taxed'] : 0, 'required' => true, 'class' => 'form-control-sm price-taxed-item'])
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="col-lg-1 text-right">
|
<div class="col-lg-1 text-right">
|
||||||
<br/>
|
<br/>
|
||||||
|
|||||||
11
resources/views/components/button-cancel.blade.php
Normal file
11
resources/views/components/button-cancel.blade.php
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<button @if (isset($type))type="{{ $type }}"@else type="button"@endif class="btn btn-secondary cancel @if (isset($class)){{ $class }}@endif" @if (isset($id_name)) id="{{ $id_name }}"@endif>
|
||||||
|
<i class="fa fa-fw fa-ban"></i> {{ __('cancel') }}
|
||||||
|
</button>
|
||||||
|
|
||||||
|
@push('js')
|
||||||
|
<script>
|
||||||
|
$('.form-buttons .cancel').click(function() {
|
||||||
|
window.history.back();
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
@endpush
|
||||||
@@ -1,4 +1,13 @@
|
|||||||
<div id="{{ $model }}-datatable-content">
|
<div id="{{ $model }}-datatable-content">
|
||||||
@include('components.datatables.header')
|
@include('components.datatables.header')
|
||||||
{{$dataTable->table(['class'=>'table table-bordered table-hover table-striped w-100'])}}
|
{{$dataTable->table(['class'=>'table table-bordered table-hover table-striped w-100 mb-0'])}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@push('css')
|
||||||
|
<link rel="stylesheet" href="{{ asset('assets/plugins/datatables.min.css') }}">
|
||||||
|
@endpush
|
||||||
|
|
||||||
|
@push('scripts')
|
||||||
|
<script src="{{ asset('assets/plugins/datatables.min.js') }}"></script>
|
||||||
|
<script src="{{ asset('vendor/datatables/buttons.server-side.js') }}"></script>
|
||||||
|
@endpush
|
||||||
@@ -1,10 +1,11 @@
|
|||||||
<button type="button" class="btn bg-gradient-info btn-add"><i class="fa fa-plus-circle"></i></button>
|
<button type="button" class="btn bg-primary btn-add"><i class="fa fa-plus-circle"></i></button>
|
||||||
|
|
||||||
@push('js')
|
@push('js')
|
||||||
<script>
|
<script>
|
||||||
$('#{{ $model }}-table-header .btn-add').click(function() {
|
$('#{{ $model }}-table-header .btn-add').click(function() {
|
||||||
url = '{{ $route }}' + '/create/';
|
url = '{{ $route }}' + '/create/';
|
||||||
window.location = url;
|
window.location = url;
|
||||||
|
// openUrl(url);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
@endpush
|
@endpush
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
<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>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
@push('js')
|
||||||
|
<script>
|
||||||
|
var $colvis = $('#{{ $model }}-table-header .btn-colvis');
|
||||||
|
|
||||||
|
$colvis.on( 'click', function () {
|
||||||
|
var table = window.LaravelDataTables["{{ $model }}-table"];
|
||||||
|
// table.search($search.val()).draw();
|
||||||
|
buttons = table.buttons();
|
||||||
|
console.log(table.button('colvis'));
|
||||||
|
console.log(buttons);
|
||||||
|
/*
|
||||||
|
for (var i = buttons.length - 1; i >= 0; i--) {
|
||||||
|
console.log(buttons[i]);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
@endpush
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
<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>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<ul class="dropdown-menu" x-placement="bottom-start">
|
||||||
|
<li class="dropdown-item excelWithFilter"><a href="#"><i class="fa fa-file-excel"></i> Exporter la sélection</a></li>
|
||||||
|
<li class="dropdown-item"><a href="{{ $route }}/exportExcel"><i class="fa fa-file-excel"></i> Exporter la liste complète</a></li>
|
||||||
|
<li class="dropdown-item"><a href="#"><i class="fa fa-file-pdf"></i> Exporter la sélection</a></li>
|
||||||
|
<li class="dropdown-item"><a href="{{ $route }}/exportPDF"><i class="fa fa-file-pdf"></i> Exporter la liste complète</a></li>
|
||||||
|
</ul>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
@push('js')
|
||||||
|
<script>
|
||||||
|
$('.excelWithFilter').click(function() {
|
||||||
|
/*
|
||||||
|
var data = $('#filters').serializeJSON();
|
||||||
|
var query = encodeURIComponent(JSON.stringify(data));
|
||||||
|
console.log(data);
|
||||||
|
console.log(query);
|
||||||
|
var url = "{{ $route }}/exportExcel?filters=" + query;
|
||||||
|
console.log(url);
|
||||||
|
*/
|
||||||
|
var data = $('#filters').serialize();
|
||||||
|
var url = "{{ $route }}/exportExcel?" + data;
|
||||||
|
window.location = url;
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
@endpush
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<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>
|
||||||
|
|
||||||
|
<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>
|
||||||
@@ -1,14 +1,6 @@
|
|||||||
<div class="datatable-export-buttons">
|
<div class="datatable-export-buttons">
|
||||||
|
|
||||||
<button type="button" class="btn bg-gradient-secondary btn-print" data-placement="top" data-original-title="Imprimer le tableau">
|
@include('components.datatables.buttons.print')
|
||||||
<i class="fa fa-print"></i>
|
@include('components.datatables.buttons.download')
|
||||||
</button>
|
|
||||||
|
|
||||||
<button type="button" class="btn bg-gradient-secondary btn-excel">
|
|
||||||
<i class="fa fa-file-excel"></i>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<button type="button" class="btn bg-gradient-secondary btn-pdf">
|
|
||||||
<i class="fa fa-file-pdf"></i>
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
<button type="button" class="btn bg-gradient-secondary btn-filter" data-toggle="modal" data-target="#modal-filters">
|
<button type="button" class="btn bg-gradient-secondary btn-filter" data-toggle="modal" data-target="#modal-filters">
|
||||||
<i class="fa fa-filter"></i>
|
<i class="fa fa-filter"></i>
|
||||||
<span class="badge badge-info"></span>
|
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
@push('js')
|
@push('js')
|
||||||
@@ -8,7 +7,7 @@
|
|||||||
var $filter = $('#{{ $model }}-table-header .btn-filter');
|
var $filter = $('#{{ $model }}-table-header .btn-filter');
|
||||||
|
|
||||||
$('#modal-filters').on('shown.bs.modal', function () {
|
$('#modal-filters').on('shown.bs.modal', function () {
|
||||||
// initSelect2();
|
initSelect2();
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#modal-filters .apply').click(function() {
|
$('#modal-filters .apply').click(function() {
|
||||||
@@ -16,5 +15,25 @@
|
|||||||
var table = window.LaravelDataTables["{{ $model }}-table"];
|
var table = window.LaravelDataTables["{{ $model }}-table"];
|
||||||
table.draw();
|
table.draw();
|
||||||
})
|
})
|
||||||
|
|
||||||
|
$('#modal-filters .reset').click(function() {
|
||||||
|
$('#filters').trigger("reset");
|
||||||
|
$('#filters .select2').val(null).trigger("change");
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
$filter.on( 'click', function () {
|
||||||
|
var table = window.LaravelDataTables["{{ $model }}-table"];
|
||||||
|
// table.search($search.val()).draw();
|
||||||
|
openModal('{{ __('Filters') }}', '{{ $route }}/getFiltersHtml', {
|
||||||
|
onApply: function() {
|
||||||
|
filters = $('#filters').serialize();
|
||||||
|
console.log(filters);
|
||||||
|
table.draw();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} );
|
||||||
|
*/
|
||||||
</script>
|
</script>
|
||||||
@endpush
|
@endpush
|
||||||
@@ -1,2 +1,14 @@
|
|||||||
@include('components.select', ['name' => 'pager', 'list' => ['5', '10','25', '50', '100']])
|
@include('components.select', ['name' => 'pager', 'id_name'=> $model . '_pager', 'list' => [5 => '5', 10 => '10', 25 => '25', 50 => '50', 100 => '100']])
|
||||||
|
|
||||||
|
|
||||||
|
@push('js')
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$('#{{ $model }}_pager').change(function() {
|
||||||
|
var table = window.LaravelDataTables["{{ $model }}-table"];
|
||||||
|
var len = $(this).val();
|
||||||
|
table.page.len(len).draw();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
@endpush
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
<button type="button" class="btn bg-gradient-secondary btn-pdf">
|
||||||
|
<i class="fa fa-file-pdf"></i>
|
||||||
|
</button>
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
<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 btn-print"><a href="#">Imprimer la sélection</a></li>
|
||||||
|
<li class="dropdown-item"><a href="{{ $route }}/print">Imprimer la liste complète</a></li>
|
||||||
|
</ul>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
@push('js')
|
||||||
|
<script>
|
||||||
|
var $print = $('#{{ $model }}-table-header .btn-print');
|
||||||
|
$print.on( 'click', function () {
|
||||||
|
var table = window.LaravelDataTables["{{ $model }}-table"];
|
||||||
|
table.button(1).trigger();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
@endpush
|
||||||
|
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
<button type="button" class="btn btn-sm bg-gradient-secondary dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
|
||||||
|
<i class="fa fa-cog"></i>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<div class="dropdown-menu text-right" x-placement="bottom-start">
|
||||||
|
<a class="dropdown-item btn-view"><i class="fa fa-eye" data-tooltip="{{ __('view') }}"></i></a>
|
||||||
|
<a class="dropdown-item btn-edit"><i class="fa fa-pencil-alt" data-tooltip="{{ __('edit') }}"></i></a>
|
||||||
|
<a class="dropdown-item btn-del"><i class="fa fa-trash-alt" data-tooltip="{{ __('delete') }}"></i></a>
|
||||||
|
</div>
|
||||||
@@ -1,10 +1,12 @@
|
|||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<div class="input-group-prepend">
|
<div class="input-group-prepend">
|
||||||
|
@include('components.datatables.buttons.pageLength')
|
||||||
<span class="input-group-text"><i class="fa fa-search"></i></span>
|
<span class="input-group-text"><i class="fa fa-search"></i></span>
|
||||||
</div>
|
</div>
|
||||||
<input type="text" class="form-control search-btn" placeholder="Rechercher..." value="">
|
<input type="text" class="form-control search-btn" placeholder="Rechercher..." value="">
|
||||||
<div class="input-group-append">
|
<div class="input-group-append">
|
||||||
@include('components.datatables.buttons.filters')
|
@include('components.datatables.buttons.filters')
|
||||||
|
@include('components.datatables.buttons.colvis')
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
$.extend( true, $.fn.dataTable.defaults, {
|
$.extend( true, $.fn.dataTable.defaults, {
|
||||||
language: {
|
language: {
|
||||||
url: "/assets/vendor/boilerplate/js/datatables/i18n/French.json"
|
url: "/assets/vendor/boilerplate/js/datatables/i18n/French.json"
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -11,30 +11,44 @@
|
|||||||
<script>
|
<script>
|
||||||
|
|
||||||
$('#{{ $model }}-table').on( 'draw.dt', function () {
|
$('#{{ $model }}-table').on( 'draw.dt', function () {
|
||||||
$('.btn-edit').click(function() {
|
|
||||||
url = '{{ $route }}' + '/edit/' + $(this).data('id');
|
var table = window.LaravelDataTables["{{ $model }}-table"];
|
||||||
window.location = url;
|
|
||||||
|
$('.btn-edit').off('click').click(function() {
|
||||||
|
var id = table.row(this).id();
|
||||||
|
url = '{{ $route }}' + '/edit/' + id;
|
||||||
|
openURL(url);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('.btn-show').off('click').click(function() {
|
||||||
|
|
||||||
$('.btn-del').on('click', '.destroy', function (e) {
|
var id = table.row(this).id();
|
||||||
|
url = '{{ $route }}' + '/show/' + id;
|
||||||
|
openURL(url);
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.btn-del').off('click').click(function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
var id = table.row(this).id();
|
||||||
|
|
||||||
bootbox.confirm("{{ __('boilerplate::shop.admin.confirmdelete') }}", function (result) {
|
bootbox.confirm("{{ __('admin.confirmdelete') }}", function (result) {
|
||||||
if (result === false) return;
|
if (result === false) return;
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: href,
|
url: '{{ $route }}' + '/destroy/' + id,
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
headers: {'X-CSRF-TOKEN': '{{ csrf_token() }}'},
|
headers: {'X-CSRF-TOKEN': '{{ csrf_token() }}'},
|
||||||
success: function(){
|
success: function(){
|
||||||
line.remove();
|
line.remove();
|
||||||
growl("{{ __('boilerplate::shop.admin.deletesuccess') }}", 'success');
|
table.draw();
|
||||||
|
growl("{{ __('admin.deletesuccess') }}", 'success');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// datatablesHelper.getDatatableLength('{{ $model }}', 34);
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<div class="row pt-3 pb-5">
|
<div class="row pt-0 pb-3">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="text-right mt-3">
|
<div class="text-right form-buttons">
|
||||||
|
@include('components.button-cancel')
|
||||||
@include('components.button-save')
|
@include('components.button-save')
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
<select
|
<select
|
||||||
name="{{ $name }}"
|
name="{{ $name }}"
|
||||||
@if (isset($id_name))id="{{ $id_name }}"@endif
|
@if (isset($id_name))id="{{ $id_name }}"@endif
|
||||||
class="@if (isset($class)){{ $class }} @else form-control @endif"
|
class="form-control @if (isset($class)){{ $class }} @endif"
|
||||||
@if (isset($style))style="{{ $style }}" @endif
|
@if (isset($style))style="{{ $style }}" @endif
|
||||||
@if (isset($required))required="required"@endif
|
@if (isset($required))required="required"@endif
|
||||||
@if (isset($multiple))multiple="multiple"@endif
|
@if (isset($multiple))multiple="multiple"@endif
|
||||||
@if (isset($meta)){{ $meta }}@endif
|
|
||||||
>
|
>
|
||||||
@if (isset($with_empty))
|
@if (isset($with_empty))
|
||||||
<option>{{ $with_empty }}</option>
|
<option value=''>{{ $with_empty }}</option>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@include('components.options')
|
@include('components.options')
|
||||||
|
|||||||
Reference in New Issue
Block a user