Change tag routines, articles saving is ok
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
@include('components.uploader.widget', ['delete_url' => route('Botanic.Admin.Varieties.deleteImage') ])
|
||||
@include('components.uploader.widget', ['load_url' => route('Botanic.Admin.Varieties.getImages', ['id' => (isset($id)) ? $id : false]), 'delete_url' => route('Botanic.Admin.Varieties.deleteImage') ])
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
@section('content')
|
||||
|
||||
{{ Form::open(['route' => 'Shop.Admin.Articles.update', 'id' => 'article-form', 'autocomplete' => 'off', 'files' => true]) }}
|
||||
{{ Form::open(['route' => 'Shop.Admin.Articles.store', 'id' => 'article-form', 'autocomplete' => 'off', 'files' => true]) }}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12 mbl">
|
||||
|
||||
@@ -2,38 +2,42 @@
|
||||
<div class="col-md-8">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
{{ Form::label('model', 'Familles de produit') }}
|
||||
@include('components.select', ['name' => 'model', 'id_name' => 'model', 'list' => $models, 'value' => isset($model) ? $model : null, 'class' => 'select2 form-control'])
|
||||
<div class="col-2">
|
||||
{{ Form::label('ref', 'Référence') }}<br>
|
||||
@include('components.input', ['name' => 'ref', 'value' => isset($ref) ? $ref : null])
|
||||
</div>
|
||||
<div class="col-4">
|
||||
{{ Form::label('model', 'Familles de produit') }}<br>
|
||||
@include('components.select', ['name' => 'model', 'id_name' => 'model', 'list' => $models_options, 'value' => isset($model) ? $model : null, 'class' => 'select2 form-control'])
|
||||
</div>
|
||||
<div class="col-6">
|
||||
{{ Form::label('model_id', 'Produit') }}
|
||||
{{ Form::label('model_id', 'Produit') }}<br>
|
||||
@include('components.select2', ['name' => 'model_id', 'id_name' => 'model_id', 'value' => isset($model_id) ? $model_id : null, 'class' => 'select2 form-control'])
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-8">
|
||||
{{ Form::label('name', 'Nom') }}
|
||||
{{ Form::label('name', 'Nom') }}<br>
|
||||
@include('components.input', ['name' => 'name', 'value' => isset($name) ? $name : null, 'required' => true])
|
||||
</div>
|
||||
<div class="col-4">
|
||||
{{ Form::label('family_id', 'Famille d\'articles') }}
|
||||
@include('components.select', ['name' => 'family_id', 'list' => $families, 'value' => isset($family_id) ? $family_id : null, 'class' => 'select2 form-control'])
|
||||
{{ Form::label('family_id', 'Famille d\'articles') }}<br>
|
||||
@include('components.select', ['name' => 'article_family_id', 'list' => $families_options, 'value' => isset($article_family_id) ? $article_family_id : null, 'class' => 'select2 form-control'])
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
{{ Form::label('categories', 'Catégories') }}
|
||||
@include('components.select', ['name' => 'categories', 'list' => $categories, 'value' => isset($category_id) ? $category_id : null, 'class' => 'select2 form-control', 'multiple' => true])
|
||||
{{ Form::label('categories', 'Catégories') }}<br>
|
||||
@include('components.select', ['name' => 'categories[]', 'list' => $categories_options, 'values' => isset($categories) ? $categories : null, 'class' => 'select2 form-control', 'multiple' => true])
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
{{ Form::label('tags', 'Tags') }}
|
||||
@include('components.select-tree', ['name' => 'tags', 'list' => $tags_list, 'value' => isset($tags) ? $tags : null, 'class' => 'select2 form-control', 'multiple' => true])
|
||||
{{ Form::label('tags', 'Tags') }}<br>
|
||||
@include('components.select-tree', ['name' => 'tags[]', 'list' => $tags_list, 'values' => isset($tags) ? $tags : null, 'class' => 'select2 form-control', 'multiple' => true])
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -46,7 +50,7 @@
|
||||
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
@include('components.uploader.widget', ['delete_url' => route('Shop.Admin.Articles.deleteImage') ])
|
||||
@include('components.uploader.widget', ['load_url' => route('Shop.Admin.Articles.getImages', ['id' => (isset($id)) ? $id : false]), 'delete_url' => route('Shop.Admin.Articles.deleteImage') ])
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -70,6 +74,7 @@
|
||||
data: {model: $('#model').val()},
|
||||
success : function(data) {
|
||||
$("#model_id").select2({data: data});
|
||||
$("#model_id").val({{ $model_id }}).trigger('change');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<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[][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'])
|
||||
@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_options, 'required' => true, 'class' => 'select2 form-control form-control-sm attributes-family'])
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-lg-6 2">
|
||||
|
||||
@@ -18,17 +18,17 @@
|
||||
|
||||
<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'])
|
||||
@include('components.select', ['name' => 'prices[0][tax_id]', 'value' => (isset($tax_id)) ? $tax_id : null, 'list' => isset($taxes_options) ? $taxes_options : 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[0][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 price-item'])
|
||||
</div>
|
||||
|
||||
<div class="col-lg-2">
|
||||
{{ Form::label('price_taxed', 'Prix TTC') }}
|
||||
@include('components.money', ['name' => 'prices[0][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_taxed)) ? $price_taxed : 0, 'required' => true, 'class' => 'form-control-sm price-taxed-item'])
|
||||
</div>
|
||||
|
||||
<div class="col-lg-1 text-right">
|
||||
|
||||
@@ -4,16 +4,14 @@
|
||||
'breadcrumb' => [__('tags.title'), __('tags.create.title')]
|
||||
])
|
||||
|
||||
@include('boilerplate::load.fileinput')
|
||||
|
||||
@section('content')
|
||||
|
||||
{{ Form::open(['route' => 'Shop.Admin.ArticleFamilies.store', 'id' => 'tag-form', 'autocomplete' => 'off', 'files' => true]) }}
|
||||
{{ Form::open(['route' => 'Shop.Admin.Tags.store', 'id' => 'tag-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') }}
|
||||
{{ __('tags.list.title') }}
|
||||
</a>
|
||||
|
||||
<span class="btn-group pull-right">
|
||||
@@ -22,7 +20,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include('Shop.Admin.ArticleFamilies.form')
|
||||
@include('Shop.Admin.Tags.form')
|
||||
</form>
|
||||
|
||||
@endsection
|
||||
|
||||
@@ -1,19 +1,17 @@
|
||||
@extends('layout.index', [
|
||||
'title' => 'Famille d\'articles',
|
||||
'subtitle' => 'Edition d\'une famille d\'article',
|
||||
'breadcrumb' => ['Articles']
|
||||
'title' => __('tags.title'),
|
||||
'subtitle' => __('tags.edit.title'),
|
||||
'breadcrumb' => [__('tags.title'), __('tags.create.title')]
|
||||
])
|
||||
|
||||
@include('boilerplate::load.fileinput')
|
||||
|
||||
@section('content')
|
||||
|
||||
{{ Form::open(['route' => 'Shop.Admin.ArticleFamilies.update', 'id' => 'article-family-form', 'autocomplete' => 'off', 'files' => true]) }}
|
||||
{{ Form::open(['route' => 'Shop.Admin.Tags.store', 'id' => 'tag-form', 'autocomplete' => 'off']) }}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12 mbl">
|
||||
<a href="{{ route("Shop.Admin.ArticleFamilies.index") }}" class="btn btn-default">
|
||||
{{ __('article_families.list.title') }}
|
||||
<a href="{{ route("Shop.Admin.Tags.index") }}" class="btn btn-default">
|
||||
{{ __('tags.title') }}
|
||||
</a>
|
||||
|
||||
<span class="btn-group pull-right">
|
||||
@@ -23,7 +21,7 @@
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="id" value="{{ $id }}">
|
||||
@include('Shop.Admin.ArticleFamilies.form')
|
||||
@include('Shop.Admin.Tags.form')
|
||||
</form>
|
||||
|
||||
@endsection
|
||||
|
||||
@@ -1,8 +1,17 @@
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
|
||||
{{ Form::label('name', 'Nom') }}
|
||||
@include('components.input', ['name' => 'name', 'value' => isset($name) ? $name : null, 'required' => true])
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
{{ Form::label('name', 'Groupe') }}
|
||||
@include('components.select', ['name' => 'tag_group_id', 'list' => $tag_groups, 'value' => isset($tag_group_id) ? $tag_group_id : null, 'required' => true])
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
{{ Form::label('name', 'Nom') }}
|
||||
@include('components.input', ['name' => 'name', 'value' => isset($name) ? $name : null, 'required' => true])
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1 +1 @@
|
||||
@include('components.input', ['type' => 'number'])
|
||||
@include('components.input', ['type' => 'number', 'meta' => "step = '.01'"])
|
||||
5
resources/views/components/options-multiple.blade.php
Normal file
5
resources/views/components/options-multiple.blade.php
Normal file
@@ -0,0 +1,5 @@
|
||||
@if (isset($list) && count($list))
|
||||
@foreach($list as $key => $item)
|
||||
<option @if (isset($values) && in_array($key, $values)) selected @endif value="{{$key}}">{{ $item }}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
5
resources/views/components/options-simple.blade.php
Normal file
5
resources/views/components/options-simple.blade.php
Normal file
@@ -0,0 +1,5 @@
|
||||
@if (isset($list) && count($list))
|
||||
@foreach($list as $key => $item)
|
||||
<option @if (isset($value) && ($key == $value)) selected @endif value="{{$key}}">{{ $item }}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
@@ -1,5 +1,9 @@
|
||||
@if (isset($list) && count($list))
|
||||
@foreach($list as $key => $item)
|
||||
<option @if (isset($value) && ($key == $value)) selected @endif value="{{$key}}">{{ $item }}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
@if (isset($complex) && $complex)
|
||||
@include('components.options-complex')
|
||||
@else
|
||||
@if (isset($multiple) && $multiple)
|
||||
@include('components.options-multiple')
|
||||
@else
|
||||
@include('components.options-simple')
|
||||
@endif
|
||||
@endif
|
||||
@@ -9,9 +9,7 @@
|
||||
@if (isset($with_empty))
|
||||
<option>{{ $with_empty }}</option>
|
||||
@endif
|
||||
@if (isset($complex) && $complex)
|
||||
@include('components.options-complex')
|
||||
@else
|
||||
@include('components.options')
|
||||
@endif
|
||||
|
||||
@include('components.options')
|
||||
|
||||
</select>
|
||||
@@ -1,16 +1,18 @@
|
||||
@foreach($images as $key => $image)
|
||||
<figure class="mr-2">
|
||||
<img src="{{ $image['url'] }}" class="img-thumbnail img-caption" style="max-height:92px;">
|
||||
<figcaption class="text-center pt-2">
|
||||
<button type="button" class="btn btn-xs btn-outline-secondary">
|
||||
<i class="fas fa-expand-alt"></i>
|
||||
</button>
|
||||
<button type="button" class="btn btn-xs btn-outline-danger">
|
||||
<i class="fas fa-trash" data-index="{{ $key }}"></i>
|
||||
</button>
|
||||
</figcaption>
|
||||
</figure>
|
||||
@endforeach
|
||||
@if ($images)
|
||||
@foreach($images as $key => $image)
|
||||
<figure class="mr-2">
|
||||
<img src="{{ $image['url'] }}" class="img-thumbnail img-caption" style="max-height:92px;">
|
||||
<figcaption class="text-center pt-2">
|
||||
<button type="button" class="btn btn-xs btn-outline-secondary">
|
||||
<i class="fas fa-expand-alt"></i>
|
||||
</button>
|
||||
<button type="button" class="btn btn-xs btn-outline-danger">
|
||||
<i class="fas fa-trash" data-index="{{ $key }}"></i>
|
||||
</button>
|
||||
</figcaption>
|
||||
</figure>
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
<script>
|
||||
handleDeleteImages();
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
{
|
||||
$gallery = $("#uploader-mini-gallery");
|
||||
if ($gallery) {
|
||||
$gallery.load("{{ route('Botanic.Admin.Varieties.getImages', ['id' => (isset($id)) ? $id : false]) }}");
|
||||
$gallery.load("{{ $load_url }}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user