Fixes
This commit is contained in:
@@ -60,4 +60,9 @@ class PriceGenericController extends Controller
|
|||||||
{
|
{
|
||||||
return PriceGenerics::destroy($id);
|
return PriceGenerics::destroy($id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getPrice($id) {
|
||||||
|
$data['generic'] = PriceGenerics::getFull($id);
|
||||||
|
return view('Shop.Admin.PriceGenerics.partials.table-prices', $data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ class Varieties
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static function destroy($id)
|
public static function destroy($id)
|
||||||
{
|
{
|
||||||
return Variety::destroy($id);
|
return Variety::destroy($id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,3 @@
|
|||||||
@include('boilerplate::load.fileinput')
|
|
||||||
@include('boilerplate::load.select2')
|
|
||||||
@include('load.set_options')
|
|
||||||
@include('boilerplate::load.tinymce')
|
|
||||||
|
|
||||||
<div class="row mt-3">
|
<div class="row mt-3">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="card card-primary card-outline card-outline-tabs">
|
<div class="card card-primary card-outline card-outline-tabs">
|
||||||
@@ -75,22 +70,28 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@include('components.save')
|
@include('components.save')
|
||||||
|
|
||||||
|
@include('boilerplate::load.fileinput')
|
||||||
|
@include('boilerplate::load.select2')
|
||||||
|
@include('load.set_options')
|
||||||
|
@include('boilerplate::load.tinymce')
|
||||||
|
@include('load.appender')
|
||||||
|
@include('load.toggle')
|
||||||
|
|
||||||
@push('js')
|
@push('js')
|
||||||
<script>
|
<script>
|
||||||
$(function() {
|
$(function() {
|
||||||
|
|
||||||
$('.select2').select2({ width: '100%' });
|
$('.select2').select2({ width: '100%' });
|
||||||
$('.editor').tinymce({});
|
$('.editor').tinymce({});
|
||||||
|
|
||||||
|
$('.active-checkbox').bootstrapToggle();
|
||||||
|
$('.active-checkbox').off('change').on('change', function(e) {
|
||||||
|
var id = $('#id').val();
|
||||||
|
// handleAdmin.toggle(id, $(this).prop('checked'));
|
||||||
|
});
|
||||||
|
|
||||||
$('.active-checkbox').bootstrapToggle();
|
|
||||||
$('.active-checkbox').off('change').on('change', function(e) {
|
|
||||||
var id = $('#id').val();
|
|
||||||
// handleAdmin.toggle(id, $(this).prop('checked'));
|
|
||||||
});
|
});
|
||||||
|
</script>
|
||||||
});
|
|
||||||
</script>
|
|
||||||
@endpush
|
@endpush
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
@include('Shop.Admin.Articles.partials.generic_prices.block_generic_price_new')
|
|
||||||
|
|
||||||
<div id="append_generic_price" class="row">
|
|
||||||
@include('Shop.Admin.Articles.partials.generic_prices.list-generic_prices')
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button type="button" class="btn btn-sm btn-primary add-new-generic_price">Associer un tarif générique<i class="fa fa-plus"></i></button>
|
|
||||||
|
|
||||||
|
|
||||||
@include('components.select-tree', ['name' => "article_price_generic_id", 'value' => $price['article_price_generic_id'] ?? null, 'list' => $price_generics ?? null, 'required' => false, 'class' => 'form-control-sm w-100'])
|
|
||||||
|
|
||||||
|
|
||||||
@push('js')
|
|
||||||
<script>
|
|
||||||
|
|
||||||
function append_generic_price() {
|
|
||||||
// handle_append_attribute();
|
|
||||||
$('.select2').select2();
|
|
||||||
// handle_change_attribute();
|
|
||||||
// load_attribute_values($('.attributes-value'), $('.attributes-family').val());
|
|
||||||
}
|
|
||||||
|
|
||||||
$("#append_generic_price").appender({
|
|
||||||
rowSection: '.row-new-generic_price',
|
|
||||||
type: '.row-generic_price',
|
|
||||||
addBtn: '.add-new-generic_price',
|
|
||||||
appendEffect: 'slide',
|
|
||||||
addClass: 'animated bounceInLeft',
|
|
||||||
rowNumber: '.row-generic_price-number',
|
|
||||||
deleteBtn: '.delete-new-generic_price-btn',
|
|
||||||
callback: append_generic_price,
|
|
||||||
rowNumberStart: 2,
|
|
||||||
hideSection: true
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
function handle_delete_generic_price() {
|
|
||||||
$('.delete-generic_price-btn').click(function() {
|
|
||||||
var $selector = $(this).parents('.row-generic_price');
|
|
||||||
var id = $selector.find('.generic_price_id').val();
|
|
||||||
|
|
||||||
/*
|
|
||||||
confirm_delete(id, "{## route('Shop.Admin.ArticlePrices.destroy') }}", function() {
|
|
||||||
$selector.remove();
|
|
||||||
});
|
|
||||||
*/
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
|
||||||
@endpush
|
|
||||||
@@ -1,15 +1,13 @@
|
|||||||
@include('Shop.Admin.Articles.partials.generic_prices.block_generic_price_new')
|
|
||||||
|
|
||||||
<div id="append_generic_price" class="row">
|
<div id="append_generic_price" class="row">
|
||||||
@include('Shop.Admin.Articles.partials.generic_prices.list-generic_prices')
|
@include('Shop.Admin.Articles.partials.generic_prices.list-generic_prices')
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row mt-3">
|
<div class="row mt-3">
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
@include('components.select-tree', ['name' => "article_price_generic_id", 'value' => $price['article_price_generic_id'] ?? null, 'list' => $price_generics ?? null, 'required' => false, 'class' => 'form-control-sm w-100'])
|
@include('components.select-tree', ['name' => "article_price_generic_id", 'id_name' => "article_price_generic_id", 'value' => $price['article_price_generic_id'] ?? null, 'list' => $price_generics ?? null, 'required' => false, 'class' => 'form-control-sm w-100'])
|
||||||
</div>
|
</div>
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
<button type="button" class="btn btn-sm btn-primary add-new-generic_price">Associer un tarif générique <i class="fa fa-plus"></i></button>
|
<button type="button" class="btn btn-sm btn-primary" id="add-new-generic_price">Associer un tarif générique <i class="fa fa-plus"></i></button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -17,39 +15,37 @@
|
|||||||
<script>
|
<script>
|
||||||
|
|
||||||
function append_generic_price() {
|
function append_generic_price() {
|
||||||
// handle_append_attribute();
|
|
||||||
$('.select2').select2();
|
$('.select2').select2();
|
||||||
// handle_change_attribute();
|
handleAddGeneric();
|
||||||
// load_attribute_values($('.attributes-value'), $('.attributes-family').val());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$("#append_generic_price").appender({
|
function handleAddGeneric() {
|
||||||
rowSection: '.row-new-generic_price',
|
$('#add-new-generic_price').click(function() {
|
||||||
type: '.row-generic_price',
|
var id = $('#article_price_generic_id').val();
|
||||||
addBtn: '.add-new-generic_price',
|
var content = $.get("{{ route('Shop.Admin.PriceGenerics.getPrice') }}/" + id, function(data) {
|
||||||
appendEffect: 'slide',
|
$('#append_generic_price').html(data);
|
||||||
addClass: 'animated bounceInLeft',
|
handleDeleteGenericPrice();
|
||||||
rowNumber: '.row-generic_price-number',
|
});
|
||||||
deleteBtn: '.delete-new-generic_price-btn',
|
});
|
||||||
callback: append_generic_price,
|
}
|
||||||
rowNumberStart: 2,
|
|
||||||
hideSection: true
|
|
||||||
});
|
|
||||||
|
|
||||||
|
function handleDeleteGenericPrice() {
|
||||||
function handle_delete_generic_price() {
|
$('.delete-generic_price-btn').off().click(function(e) {
|
||||||
$('.delete-generic_price-btn').click(function() {
|
console.log('ici');
|
||||||
var $selector = $(this).parents('.row-generic_price');
|
e.preventDefault();
|
||||||
var id = $selector.find('.generic_price_id').val();
|
// $('#append_generic_price').html('');
|
||||||
|
|
||||||
/*
|
/*
|
||||||
confirm_delete(id, "{## route('Shop.Admin.ArticlePrices.destroy') }}", function() {
|
confirm_delete(id, "{## route('Shop.Admin.GenericPrices.destroy') }}", function() {
|
||||||
$selector.remove();
|
$selector.remove();
|
||||||
});
|
});
|
||||||
*/
|
*/
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$(function() {
|
||||||
|
append_generic_price();
|
||||||
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@endpush
|
@endpush
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
@push('js')
|
@push('js')
|
||||||
<script>
|
<script>
|
||||||
$(function () {
|
$(function () {
|
||||||
handle_delete_generic_price();
|
handleDeleteGenericPrice();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
@endpush
|
@endpush
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
@if (count($generic['prices'] ?? []))
|
@if (count($generic['prices'] ?? []))
|
||||||
<table class="table table-bordered table-hover table-striped w-100 mb-0 dataTable">
|
<table class="table table-bordered table-hover table-striped w-100 mb-0 dataTable">
|
||||||
|
<input type="hidden" name="price_generics[0]" value="{{ $generic['id'] }}">
|
||||||
<thead>
|
<thead>
|
||||||
<th>
|
<th>
|
||||||
<button type="button" class="btn btn-xs btn-danger delete-price-btn mt-2" data-card-widget="collapse" data-toggle="tooltip" title="supprimer" data-id="{{ $generic['id'] }}">
|
<button type="button" class="btn btn-xs btn-danger delete-generic-price-btn mt-2" data-card-widget="collapse" data-toggle="tooltip" title="supprimer" data-id="{{ $generic['id'] }}">
|
||||||
<i class="fas fa-trash"></i>
|
<i class="fas fa-trash"></i>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<button type="{{ $type ?? 'button' }}" class="btn {{ $class ?? ''}}" @if (isset($id)) id="{{ $id }}"@endif>
|
<button type="{{ $type ?? 'button' }}" class="btn {{ $class ?? ''}}" @if (isset($id_button)) id="{{ $id_button }}"@endif>
|
||||||
<i class="fa fa-fw {{ $icon ?? '' }}"></i>
|
<i class="fa fa-fw {{ $icon ?? '' }}"></i>
|
||||||
{{ $txt ?? '' }}
|
{{ $txt ?? '' }}
|
||||||
</button>
|
</button>
|
||||||
@@ -8,5 +8,6 @@ Route::prefix('PriceGenerics')->name('PriceGenerics.')->group(function () {
|
|||||||
Route::post('store', 'PriceGenericController@store')->name('store');
|
Route::post('store', 'PriceGenericController@store')->name('store');
|
||||||
Route::get('edit/{id}', 'PriceGenericController@edit')->name('edit');
|
Route::get('edit/{id}', 'PriceGenericController@edit')->name('edit');
|
||||||
|
|
||||||
|
Route::get('getPrice/{id?}', 'PriceGenericController@getPrice')->name('getPrice');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user