[WIP] Fix cosmetics, prices
This commit is contained in:
@@ -1,19 +1,19 @@
|
||||
@extends('layout.index', [
|
||||
'title' => __('article_families.title'),
|
||||
'subtitle' => __('article_families.create.title'),
|
||||
'breadcrumb' => [__('article_families.title'), __('article_families.create.title')]
|
||||
'title' => __('article_attribute_families.title'),
|
||||
'subtitle' => __('article_attribute_families.create.title'),
|
||||
'breadcrumb' => [__('article_attribute_families.title'), __('article_attribute_families.create.title')]
|
||||
])
|
||||
|
||||
@include('boilerplate::load.fileinput')
|
||||
|
||||
@section('content')
|
||||
|
||||
{{ Form::open(['route' => 'Shop.Admin.ArticleFamilies.store', 'id' => 'article-family-form', 'autocomplete' => 'off', 'files' => true]) }}
|
||||
{{ Form::open(['route' => 'Shop.Admin.ArticleAttributeFamilies.store', 'id' => 'article-attribute-family-form', 'autocomplete' => 'off']) }}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12 mbl">
|
||||
<a href="{{ route("Shop.Admin.Articles.index") }}" class="btn btn-default">
|
||||
{{ __('article_families.list.title') }}
|
||||
<a href="{{ route("Shop.Admin.ArticleAttributeFamilies.index") }}" class="btn btn-default">
|
||||
{{ __('article_attribute_families.title') }}
|
||||
</a>
|
||||
|
||||
<span class="btn-group pull-right">
|
||||
@@ -22,7 +22,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include('Shop.Admin.ArticleFamilies.form')
|
||||
@include('Shop.Admin.ArticleAttributeFamilies.form')
|
||||
</form>
|
||||
|
||||
@endsection
|
||||
|
||||
@@ -1,21 +1,13 @@
|
||||
@extends('layout.index', [
|
||||
'title' => __('Shop.article_families.title'),
|
||||
'subtitle' => __('Shop.article_families.list'),
|
||||
'breadcrumb' => [__('Shop.article_families.title')]
|
||||
'title' => __('Shop.article_attribute_families.title'),
|
||||
'subtitle' => __('Shop.article_attribute_families.list'),
|
||||
'breadcrumb' => [__('Shop.article_attribute_families.title')]
|
||||
])
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="row pb-3">
|
||||
<div class="col text-right">
|
||||
<a href="{{ route('Shop.Admin.ArticleFamilies.create') }}" class="btn btn-sm btn-success">{{ __('Shop.Admin.ArticleFamilies.add') }} <i class="fa fa-plus"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{$dataTable->table()}}
|
||||
|
||||
@include('components.datatable', ['route' => route('Shop.Admin.ArticleAttributeFamilies.create'), 'label' => __('Shop.article_attribute_families.add')])
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
@include('components.js.datatable', ['route' => '/Shop/Admin/ArticleFamilies', 'model' => 'articlefamilies'])
|
||||
@include('components.js.datatable', ['route' => '/Shop/Admin/ArticleAttributeFamilies', 'model' => 'ArticleAttributefamilies'])
|
||||
@endpush
|
||||
@@ -1,21 +1,13 @@
|
||||
@extends('layout.index', [
|
||||
'title' => __('Shop.article_families.title'),
|
||||
'subtitle' => __('Shop.article_families.list'),
|
||||
'breadcrumb' => [__('Shop.article_families.title')]
|
||||
'title' => __('Shop.article_attribute_values.title'),
|
||||
'subtitle' => __('Shop.article_attribute_values.list'),
|
||||
'breadcrumb' => [__('Shop.article_attribute_values.title')]
|
||||
])
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="row pb-3">
|
||||
<div class="col text-right">
|
||||
<a href="{{ route('Shop.Admin.ArticleFamilies.create') }}" class="btn btn-sm btn-success">{{ __('Shop.Admin.ArticleFamilies.add') }} <i class="fa fa-plus"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{$dataTable->table()}}
|
||||
|
||||
@include('components.datatable', ['route' => route('Shop.Admin.ArticleAttributeValues.create'), 'label' => __('Shop.article_attribute_values.add')])
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
@include('components.js.datatable', ['route' => '/Shop/Admin/ArticleFamilies', 'model' => 'articlefamilies'])
|
||||
@include('components.js.datatable', ['route' => '/Shop/Admin/ArticleAttributeValues', 'model' => 'articleattributes'])
|
||||
@endpush
|
||||
@@ -5,15 +5,7 @@
|
||||
])
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="row pb-3">
|
||||
<div class="col text-right">
|
||||
<a href="{{ route('Shop.Admin.ArticleFamilies.create') }}" class="btn btn-sm btn-success">{{ __('Shop.Admin.ArticleFamilies.add') }} <i class="fa fa-plus"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{$dataTable->table()}}
|
||||
|
||||
@include('components.datatable', ['route' => route('Shop.Admin.ArticleFamilies.create'), 'label' => __('Shop.article_families.add')])
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
@extends('layout.index', [
|
||||
'title' => __('articles.title'),
|
||||
'subtitle' => __('articles.create.title'),
|
||||
'breadcrumb' => [__('articles.title'), __('articles.create.title')]
|
||||
'title' => __('Shop.articles.title'),
|
||||
'subtitle' => __('Shop.articles.add'),
|
||||
'breadcrumb' => [__('Shop.articles.title'), __('Shop.articles.add')]
|
||||
])
|
||||
|
||||
@include('boilerplate::load.fileinput')
|
||||
@@ -9,7 +9,6 @@
|
||||
@section('content')
|
||||
|
||||
{{ Form::open(['route' => 'Shop.Admin.Articles.store', 'id' => 'article-form', 'autocomplete' => 'off', 'files' => true]) }}
|
||||
|
||||
@include('Shop.Admin.Articles.form')
|
||||
</form>
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<div class="row">
|
||||
<div class="col-sm-12 mbl">
|
||||
<a href="{{ route("Shop.Admin.Articles.index") }}" class="btn btn-default">
|
||||
{{ __('lots.list.title') }}
|
||||
{{ __('Shop.articles.title') }}
|
||||
</a>
|
||||
|
||||
<span class="btn-group pull-right">
|
||||
|
||||
@@ -79,43 +79,17 @@
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
$(function() {
|
||||
$(function() {
|
||||
|
||||
$("#model_id").off('change').on('change', function(e) {
|
||||
var model = $('#model_id').select2('data');
|
||||
var name = model[0]['text'];
|
||||
console.log(name);
|
||||
$('input[name="name"]').val(name);
|
||||
});
|
||||
|
||||
$(".select2").select2();
|
||||
$('.editor').tinymce({});
|
||||
|
||||
$('#model').change( function() {
|
||||
$.ajax({
|
||||
url : '{{ route('Botanic.Admin.Varieties.getSelect') }}',
|
||||
method : 'POST',
|
||||
data: {model: $('#model').val()},
|
||||
success : function(data) {
|
||||
console.log(data);
|
||||
$("#model_id").select2({
|
||||
data: data
|
||||
});
|
||||
// setOptions('#model_id',data);
|
||||
//
|
||||
}
|
||||
});
|
||||
});
|
||||
$('.select2').select2();
|
||||
$('.editor').tinymce({});
|
||||
|
||||
$('.active-checkbox').bootstrapToggle();
|
||||
|
||||
$('.active-checkbox').off('change').on('change', function(e) {
|
||||
var id = $('#id').val();
|
||||
// handleAdmin.toggle(id, $(this).prop('checked'));
|
||||
});
|
||||
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
@@ -5,15 +5,7 @@
|
||||
])
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="row pb-3">
|
||||
<div class="col text-right">
|
||||
<a href="{{ route('Shop.Admin.Articles.create') }}" class="btn btn-sm btn-success">{{ __('Shop.articles.add') }} <i class="fa fa-plus"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{$dataTable->table()}}
|
||||
|
||||
@include('components.datatable', ['route' => route('Shop.Admin.Articles.create'), 'label' => __('Shop.articles.add')])
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
|
||||
@@ -49,3 +49,31 @@
|
||||
@include('components.uploader.widget', ['delete_url' => route('Shop.Admin.Articles.deleteImage') ])
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
|
||||
$("#model_id").change( function(e) {
|
||||
var model = $('#model_id').select2('data');
|
||||
var name = model[0]['text'];
|
||||
$('input[name="name"]').val(name);
|
||||
});
|
||||
|
||||
$('#model').change( function() {
|
||||
loadVarieties();
|
||||
});
|
||||
|
||||
function loadVarieties() {
|
||||
$.ajax({
|
||||
url : '{{ route('Botanic.Admin.Varieties.getSelect') }}',
|
||||
method : 'POST',
|
||||
data: {model: $('#model').val()},
|
||||
success : function(data) {
|
||||
$("#model_id").select2({data: data});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
loadVarieties();
|
||||
</script>
|
||||
@endpush
|
||||
@@ -10,7 +10,9 @@
|
||||
<script>
|
||||
|
||||
function append_price() {
|
||||
handle_append_attribute();
|
||||
// handle_append_attribute();
|
||||
$('.select2').select2();
|
||||
handle_change_attribute();
|
||||
}
|
||||
|
||||
$("#append_price").appender({
|
||||
@@ -31,7 +33,7 @@
|
||||
|
||||
function handle_append_attribute(selector) {
|
||||
console.log('handle_append_attribute');
|
||||
$("#append_attribute").appender({
|
||||
$(".append_attribute").appender({
|
||||
rowSection: '.row-new-attribute',
|
||||
type: '.row-attribute',
|
||||
addBtn: '.add-new-attribute',
|
||||
@@ -45,6 +47,28 @@
|
||||
});
|
||||
}
|
||||
|
||||
function handle_change_attribute() {
|
||||
$('.attributes-family').change( function() {
|
||||
var family_id = $(this).val();
|
||||
var $family = $(this);
|
||||
var $parent = $family.parent().parent();
|
||||
// console.log($parent);
|
||||
var $selector = $parent.find('.attributes-value');
|
||||
// console.log($selector);
|
||||
load_attribute_values($selector, family_id);
|
||||
});
|
||||
}
|
||||
|
||||
function load_attribute_values($selector, family_id) {
|
||||
$.ajax({
|
||||
url : "{{ route('Shop.Admin.ArticleAttributeValues.getOptionsByFamily') }}",
|
||||
method : 'POST',
|
||||
data: { family_id: family_id },
|
||||
success : function(data) {
|
||||
$selector.empty().select2({data: data});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div id="attributes" class="appender" data-id="">
|
||||
@include('Shop.Admin.Articles.partials.prices.block_attribute_new')
|
||||
<div id="append_attribute"></div>
|
||||
<div class="append_attribute"></div>
|
||||
</div>
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
<div class="row row-new-attribute row-attribute">
|
||||
<div class="col-xs-3 col-lg-2">
|
||||
{{ Form::label('quantity', 'Quantité') }}<br/>
|
||||
@include('components.input', ['name' => 'prices[][quantity][]', 'value' => (isset($quantity)) ? $quantity : 1, 'required' => true, 'class' => 'form-control-sm'])
|
||||
</div>
|
||||
<div class="col-xs-4 col-lg-4">
|
||||
<input type="hidden" name="prices[][attributes][quantity]" value="1">
|
||||
<div class="col-12 col-lg-6 1">
|
||||
{{ Form::label('attribute_family_id', 'Attributs') }}<br/>
|
||||
@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, 'class' => 'form-control form-control-sm'])
|
||||
@include('components.select', ['name' => 'prices[][attributes][attribute_family_id]', 'value' => (isset($attribute_value['attribute_family_id'])) ? $attribute_value['attribute_family_id'] : null, 'list' => $attribute_families, 'required' => true, 'class' => 'select2 form-control form-control-sm attributes-family'])
|
||||
</div>
|
||||
|
||||
<div class="col-xs-5 col-lg-4">
|
||||
<div class="col-12 col-lg-6 2">
|
||||
{{ Form::label('attribute_value_id', 'Valeur') }}<br/>
|
||||
@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, 'class' => 'form-control form-control-sm'])
|
||||
@include('components.select', ['name' => 'prices[][attributes][attribute_value_id]', 'value' => (isset($attribute_value['id'])) ? $attribute_value['id'] : null, 'list' => (isset($attribute_values)) ? $attribute_values : null, 'required' => true, 'class' => 'select2 form-control form-control-sm attributes-value'])
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -7,43 +7,39 @@
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-lg-2">
|
||||
{{ Form::label('tax_id', 'TVA') }}<br/>
|
||||
@include('components.select', ['name' => 'prices[][tax_id]', 'value' => (isset($tax_id)) ? $tax_id : null, 'list' => isset($taxes) ? $taxes : null, 'required' => true, 'class' => 'form-control form-control-sm'])
|
||||
<div class="col-lg-1">
|
||||
{{ Form::label('quantity', 'Quantité') }}<br/>
|
||||
@include('components.number', ['name' => 'prices[0][quantity]', 'value' => (isset($quantity)) ? $quantity : 1, 'required' => true, 'class' => 'form-control-sm'])
|
||||
</div>
|
||||
|
||||
<div class="col-lg-2">
|
||||
{{ Form::label('quantity', 'Quantité') }}<br/>
|
||||
@include('components.number', ['name' => 'prices[][quantity}', 'value' => (isset($quantity)) ? $quantity : 1, 'required' => true, 'class' => 'form-control-sm'])
|
||||
<div class="col-lg-5">
|
||||
@include('Shop.Admin.Articles.partials.prices.block_attribute_new')
|
||||
</div>
|
||||
|
||||
<div class="col-lg-1">
|
||||
{{ Form::label('tax_id', 'TVA') }}<br/>
|
||||
@include('components.select', ['name' => 'prices[0][tax_id]', 'value' => (isset($tax_id)) ? $tax_id : null, 'list' => isset($taxes) ? $taxes : null, 'required' => true, 'class' => 'form-control form-control-sm'])
|
||||
</div>
|
||||
|
||||
<div class="col-lg-2">
|
||||
{{ Form::label('price', 'Prix HT') }}
|
||||
@include('components.money', ['name' => 'prices[][price}', 'value' => (isset($price)) ? $price : 0, 'required' => true, 'class' => 'form-control-sm'])
|
||||
@include('components.money', ['name' => 'prices[0][price]', 'value' => (isset($price)) ? $price : 0, 'required' => true, 'class' => 'form-control-sm'])
|
||||
</div>
|
||||
|
||||
<div class="col-lg-2">
|
||||
{{ Form::label('price_taxed', 'Prix TTC') }}
|
||||
@include('components.money', ['name' => 'prices[][price_taxed]', 'value' => (isset($price_ht)) ? $price_ht : 0, 'required' => true, 'class' => 'form-control-sm'])
|
||||
@include('components.money', ['name' => 'prices[0][price_taxed]', 'value' => (isset($price_ht)) ? $price_ht : 0, 'required' => true, 'class' => 'form-control-sm'])
|
||||
</div>
|
||||
|
||||
<div class="col-lg-2">
|
||||
<div class="col-lg-1 text-right">
|
||||
<br/>
|
||||
<button class="btn btn-primary btn-xs add-new-attribute mt-1" href="#attributes" type="button">
|
||||
Ajout d'un attribut
|
||||
<i class="fas fa-plus"></i>
|
||||
<button type="button" class="btn btn-xs btn-danger delete-new-price-btn mt-2" data-card-widget="collapse" data-toggle="tooltip" title="supprimer">
|
||||
<i class="fas fa-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-2 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>
|
||||
@include('Shop.Admin.Articles.partials.prices.attributes')
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -5,15 +5,7 @@
|
||||
])
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="row pb-3">
|
||||
<div class="col text-right">
|
||||
<a href="{{ route('Shop.Admin.TagGroups.create') }}" class="btn btn-sm btn-success">{{ __('Shop.Admin.TagGroups.add') }} <i class="fa fa-plus"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{$dataTable->table()}}
|
||||
|
||||
@include('components.datatable', ['route' => route('Shop.Admin.TagGroups.create'), 'label' => __('Shop.tag_groups.add')])
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
|
||||
@@ -5,17 +5,10 @@
|
||||
])
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="row pb-3">
|
||||
<div class="col text-right">
|
||||
<a href="{{ route('Shop.Admin.Tags.create') }}" class="btn btn-sm btn-success">{{ __('Shop.tags.add') }} <i class="fa fa-plus"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{$dataTable->table()}}
|
||||
|
||||
@include('components.datatable', ['route' => route('Shop.Admin.Tags.create'), 'label' => __('Shop.tags.add')])
|
||||
@endsection
|
||||
|
||||
|
||||
@push('scripts')
|
||||
|
||||
<script>
|
||||
|
||||
Reference in New Issue
Block a user