Fix on preview mode
This commit is contained in:
@@ -1,27 +1,34 @@
|
||||
<div class="row mb-3">
|
||||
<div class="col-8">
|
||||
<div class="col-3">
|
||||
<div class="row mb-3">
|
||||
<div class="col-8">
|
||||
<div class="col-12">
|
||||
{{ Form::label('article_id', 'Article') }}
|
||||
@include('components.form.autocomplete', ['name' => 'article', 'data' => $offer ?? null, 'url' => route('Admin.Shop.Articles.autocomplete')])
|
||||
@include('components.select', ['name' => 'article_id', 'id_name' => 'article_id', 'list' => $articles ?? null, 'value' => $offer['article_id'] ?? null, 'with_empty' => '', 'class' => 'select2 select_article'])
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-8">
|
||||
<div class="col-12">
|
||||
{{ Form::label('variation_id', 'Déclinaison') }}
|
||||
@include('components.form.autocomplete', ['name' => 'variation', 'data' => $offer ?? null, 'url' => route('Admin.Shop.Variations.autocomplete')])
|
||||
@include('components.select', ['name' => 'variation_id', 'id_name' => 'variation_id', 'list' => $variations ?? null, 'value' => $offer['variation_id'] ?? null, 'with_empty' => '', 'class' => 'select2 select_variation'])
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-8">
|
||||
<div class="col-12">
|
||||
{{ Form::label('tariff_id', 'Tarif') }}
|
||||
@include('components.form.autocomplete', ['name' => 'tariff', 'data' => $offer ?? null, 'url' => route('Admin.Shop.Tariffs.autocomplete')])
|
||||
@include('components.select', ['name' => 'tariff_id', 'id_name' => 'tariff_id', 'list' => $tariffs ?? null, 'value' => $offer['tariff_id'] ?? null, 'with_empty' => '', 'class' => 'select2 select_tariffs'])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<div class="col-6">
|
||||
@component('components.card', ['title' => 'Previsualisation'])
|
||||
<div id="preview-article"></div>
|
||||
<div id="preview-variation"></div>
|
||||
<div id="preview-tariff"></div>
|
||||
@endcomponent
|
||||
</div>
|
||||
<div class="col-3">
|
||||
@component('components.card', ['title' => 'Disponibilité'])
|
||||
<div class="row mb-3">
|
||||
<div class="col-6">
|
||||
@@ -55,11 +62,44 @@
|
||||
|
||||
@include('components.save')
|
||||
|
||||
@include('load.form.autocomplete')
|
||||
@include('load.layout.chevron')
|
||||
@include('load.form.save')
|
||||
@include('load.form.select2')
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
initAutocomplete();
|
||||
function handleArticle() {
|
||||
$('.select_article').change(function() {
|
||||
var url = '{{ route('Admin.Shop.Offers.previewArticle') }}/' + $(this).val();
|
||||
$('#preview-article').load(url, function() {
|
||||
initChevron();
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
function handleVariation() {
|
||||
$('.select_variation').change(function() {
|
||||
var url = '{{ route('Admin.Shop.Offers.previewVariation') }}/' + $(this).val();
|
||||
$('#preview-variation').load(url, function() {
|
||||
initChevron();
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
function handleTariff() {
|
||||
$('.select_tariffs').change(function() {
|
||||
var url = '{{ route('Admin.Shop.Offers.previewTariff') }}/' + $(this).val();
|
||||
$('#preview-tariff').load(url, function() {
|
||||
initChevron();
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
handleArticle();
|
||||
handleVariation();
|
||||
handleTariff();
|
||||
initChevron();
|
||||
initSaveForm();
|
||||
initSelect2();
|
||||
</script>
|
||||
@endpush
|
||||
Reference in New Issue
Block a user