[WIP] Adding prices
This commit is contained in:
38
Gruntfile.js
38
Gruntfile.js
@@ -4,17 +4,17 @@ var jsCompatibilty = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
var jsMain = [
|
var jsMain = [
|
||||||
'node_modules/sweetalert2/dist/sweetalert2.all.min.js',
|
// 'node_modules/sweetalert2/dist/sweetalert2.all.min.js',
|
||||||
'node_modules/inputmask/dist/min/jquery.inputmask.bundle.min.js',
|
'node_modules/inputmask/dist/min/jquery.inputmask.bundle.min.js',
|
||||||
/* 'node_modules/summernote/dist/summernote.min.js',
|
/* 'node_modules/summernote/dist/summernote.min.js',
|
||||||
'node_modules/summernote/dist/lang/summernote-fr-FR.min.js',
|
'node_modules/summernote/dist/lang/summernote-fr-FR.min.js',
|
||||||
*/
|
*/
|
||||||
'node_modules/@activix/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js',
|
// 'node_modules/@activix/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js',
|
||||||
'node_modules/@activix/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.fr.js',
|
// 'node_modules/@activix/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.fr.js',
|
||||||
'node_modules/bootstrap-fileinput/js/plugins/piexif.min.js',
|
'node_modules/bootstrap-fileinput/js/plugins/piexif.min.js',
|
||||||
'node_modules/bootstrap-slider/dist/bootstrap-slider.min.js',
|
// 'node_modules/bootstrap-slider/dist/bootstrap-slider.min.js',
|
||||||
'node_modules/bootstrap-validate/dist/bootstrap-validate.js',
|
// 'node_modules/bootstrap-validate/dist/bootstrap-validate.js',
|
||||||
'node_modules/jQuery-QueryBuilder/dist/js/jquery-builder.standalone.min.js',
|
// 'node_modules/jQuery-QueryBuilder/dist/js/jquery-builder.standalone.min.js',
|
||||||
/* 'node_modules/jQuery-QueryBuilder/dist/i18n/query-builder.fr.js', */
|
/* 'node_modules/jQuery-QueryBuilder/dist/i18n/query-builder.fr.js', */
|
||||||
/* 'node_modules/isotope-layout/dist/isotope.pkgd.min.js', */
|
/* 'node_modules/isotope-layout/dist/isotope.pkgd.min.js', */
|
||||||
'node_modules/wew.js/dist/wew.min.js',
|
'node_modules/wew.js/dist/wew.min.js',
|
||||||
@@ -24,27 +24,27 @@ var jsMain = [
|
|||||||
'node_modules/jqtree/tree.jquery.js',
|
'node_modules/jqtree/tree.jquery.js',
|
||||||
'node_modules/numeral/min/numeral.min.js',
|
'node_modules/numeral/min/numeral.min.js',
|
||||||
'node_modules/numeral/min/locales/fr.min.js',
|
'node_modules/numeral/min/locales/fr.min.js',
|
||||||
'build/js/url_on_tab.js',
|
'build/js/include/url_on_tab.js',
|
||||||
'build/js/set_options.js',
|
'build/js/include/set_options.js',
|
||||||
'build/js/confirm.js',
|
// 'build/js/include/confirm.js',
|
||||||
'build/js/appender.js',
|
'build/js/include/appender.js',
|
||||||
'build/js/app.js',
|
// 'build/js/include/app.js',
|
||||||
]
|
]
|
||||||
|
|
||||||
var cssMain = [
|
var cssMain = [
|
||||||
'node_modules/sweetalert2/dist/sweetalert2.min.css',
|
// 'node_modules/sweetalert2/dist/sweetalert2.min.css',
|
||||||
'node_modules/inputmask/css/inputmask.css',
|
'node_modules/inputmask/css/inputmask.css',
|
||||||
'node_modules/summernote/dist/summernote.css',
|
// 'node_modules/summernote/dist/summernote.css',
|
||||||
'node_modules/@activix/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css',
|
'node_modules/@activix/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css',
|
||||||
'node_modules/bootstrap-slider/dist/css/bootstrap-slider.min.css',
|
// 'node_modules/bootstrap-slider/dist/css/bootstrap-slider.min.css',
|
||||||
'node_modules/jQuery-QueryBuilder/dist/css/query-builder.default.min.css',
|
// 'node_modules/jQuery-QueryBuilder/dist/css/query-builder.default.min.css',
|
||||||
'node_modules/animate.css/animate.min.css',
|
'node_modules/animate.css/animate.min.css',
|
||||||
'node_modules/jqtree/jqtree.css',
|
'node_modules/jqtree/jqtree.css',
|
||||||
'build/css/modal-option.css',
|
// 'build/css/modal-option.css',
|
||||||
'build/css/shadow.css',
|
'build/css/shadow.css',
|
||||||
'build/css/utility.css',
|
// 'build/css/utility.css',
|
||||||
'build/css/site.css',
|
// 'build/css/site.css',
|
||||||
'build/css/admin.css'
|
// 'build/css/admin.css'
|
||||||
]
|
]
|
||||||
|
|
||||||
var jsDataTables = [
|
var jsDataTables = [
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<div class="row-price p-3 col-12">
|
||||||
|
|
||||||
|
<input type="hidden" name="prices[{{ $key }}][id]" value="@if (isset($price['id'])){{ $price['id'] }}@endif" class="price_id">
|
||||||
|
|
||||||
|
<p>
|
||||||
|
@include('components.button-delete', ['class' => 'delete-price-btn'])
|
||||||
|
Autre tarif
|
||||||
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
<div class="col-12 row-new-price row-price">
|
||||||
|
|
||||||
|
<input type="hidden" name="prices[][id]" value="">
|
||||||
|
|
||||||
|
<div class="card card-light">
|
||||||
|
<div class="card-header">
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-2">
|
||||||
|
{{ Form::label('tax_id', 'TVA') }}
|
||||||
|
@include('components.select', ['name' => 'prices[][tax_id]', 'value' => (isset($tax_id)) ? $tax_id : null, 'list' => isset($taxes) ? $taxes : null, 'required' => true])
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-2">
|
||||||
|
{{ Form::label('price', 'Prix HT') }}
|
||||||
|
@include('components.money', ['name' => 'prices[][price}', 'value' => (isset($price)) ? $price : 0, 'required' => true])
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-2">
|
||||||
|
{{ Form::label('price_taxed', 'Prix TTC') }}
|
||||||
|
@include('components.money', ['name' => 'prices[][price_taxed]', 'value' => (isset($price_ht)) ? $price_ht : 0, 'required' => true])
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-2">
|
||||||
|
<br/>
|
||||||
|
<button class="btn btn-primary btn-xs add-new-attribute-btn mt-3" data-toggle="collapse" href="#attributes" type="button">
|
||||||
|
Ajout d'un attribut
|
||||||
|
<i class="fas fa-plus"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-4 text-right">
|
||||||
|
<button type="button" class="btn btn-danger delete-new-price-btn mt-2" data-card-widget="collapse" data-toggle="tooltip" title="supprimer">
|
||||||
|
<i class="fa-2x fas fa-trash"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="collapse" id="attributes">
|
||||||
|
<div class="card-body">
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-xs-3 col-md-2">
|
||||||
|
{{ Form::label('quantity', 'Quantité') }}
|
||||||
|
@include('components.input', ['name' => 'prices[][quantity][]', 'value' => (isset($quantity)) ? $quantity : 1, 'required' => true])
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-4 col-md-4">
|
||||||
|
{{ Form::label('attribute_family_id', 'Attributs') }}
|
||||||
|
@include('components.select', ['name' => 'prices[][attribute_family_id][]', 'value' => (isset($attribute_value['attribute_family_id'])) ? $attribute_value['attribute_family_id'] : null, 'list' => $attribute_families, 'required' => true])
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-xs-5 col-md-4">
|
||||||
|
{{ Form::label('attribute_value_id', 'Valeur') }}
|
||||||
|
@include('components.select', ['name' => 'prices[][attribute_value_id][]', 'value' => (isset($attribute_value['id'])) ? $attribute_value['id'] : null, 'list' => (isset($attribute_values)) ? $attribute_values : null, 'required' => true])
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
@if (isset($prices) && (count($prices)))
|
||||||
|
@for ($i = 1; $i < count($prices); $i++)
|
||||||
|
@include('Shop.Admin.Articles.partials.block_price', ['key' => $i, 'price' => $prices[$i]])
|
||||||
|
@endfor
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@push('js')
|
||||||
|
<script>
|
||||||
|
$(function () {
|
||||||
|
|
||||||
|
$('.delete-price-btn').click(function() {
|
||||||
|
var $selector = $(this).parents('.row-price');
|
||||||
|
var id = $selector.find('.price_id').val();
|
||||||
|
|
||||||
|
confirm_delete(id, laroute.route('Hestimmo.ArticlePrices.destroy', {id : id}), function() {
|
||||||
|
$selector.remove();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
@endpush
|
||||||
|
|
||||||
@@ -1,31 +1,30 @@
|
|||||||
<div class="row">
|
@include('Shop.Admin.Articles.partials.block_price_new')
|
||||||
<div class="col-md-12">
|
|
||||||
<button class="btn btn-success" data-toggle="modal" data-targer="#add_price"><i class="fa fa-plus"></i> Ajouter</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="modal fade" id="modal-default" aria-hidden="true" style="display: none;">
|
|
||||||
<div class="modal-dialog">
|
|
||||||
<div class="modal-content">
|
|
||||||
<div class="modal-header">
|
|
||||||
<h4 class="modal-title">Ajout d'un tarif</h4>
|
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
|
||||||
<span aria-hidden="true">×</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div class="modal-body">
|
|
||||||
{{ Form::label('attribute_family_id', 'Familles d\'attributs') }}
|
|
||||||
@include('components.select', ['name' => 'attribute_family_id', 'value' => (isset($attribute_value['attribute_family_id'])) ? $attribute_value['attribute_family_id'] : null, 'list' => $attribute_families, 'required' => true])
|
|
||||||
|
|
||||||
|
|
||||||
|
<div id="append_price" class="row">
|
||||||
|
@include('Shop.Admin.Articles.partials.list-prices')
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
<button type="button" class="btn btn-primary add-new-price">Ajouter un tarif <i class="fa fa-plus"></i></button>
|
||||||
<div class="modal-footer justify-content-between">
|
|
||||||
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
@push('js')
|
||||||
<button type="button" class="btn btn-primary">Save changes</button>
|
<script>
|
||||||
</div>
|
|
||||||
</div>
|
function append_price() {
|
||||||
<!-- /.modal-content -->
|
}
|
||||||
</div>
|
|
||||||
<!-- /.modal-dialog -->
|
$("#append_price").appender({
|
||||||
</div>
|
rowSection: '.row-new-price',
|
||||||
|
type: '.row-price',
|
||||||
|
addBtn: '.add-new-price',
|
||||||
|
appendEffect: 'slide',
|
||||||
|
addClass: 'animated bounceInLeft',
|
||||||
|
rowNumber: '.row-price-number',
|
||||||
|
deleteBtn: '.delete-new-price-btn',
|
||||||
|
callback: append_price,
|
||||||
|
rowNumberStart: 2,
|
||||||
|
hideSection: true
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
@endpush
|
||||||
|
|||||||
Reference in New Issue
Block a user