Add varieties
This commit is contained in:
40
resources/views/components/js/datatable.blade.php
Normal file
40
resources/views/components/js/datatable.blade.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<script>
|
||||
$.extend( true, $.fn.dataTable.defaults, {
|
||||
language: {
|
||||
url: "/assets/vendor/boilerplate/js/datatables/i18n/French.json"
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
{{$dataTable->scripts()}}
|
||||
|
||||
<script>
|
||||
|
||||
$('#{{ $model }}-table').on( 'draw.dt', function () {
|
||||
$('.btn-edit').click(function() {
|
||||
url = '{{ $route }}' + '/edit/' + $(this).data('id');
|
||||
window.location = url;
|
||||
});
|
||||
|
||||
|
||||
$('.btn-del').on('click', '.destroy', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
bootbox.confirm("{{ __('boilerplate::shop.admin.confirmdelete') }}", function (result) {
|
||||
if (result === false) return;
|
||||
|
||||
$.ajax({
|
||||
url: href,
|
||||
method: 'delete',
|
||||
headers: {'X-CSRF-TOKEN': '{{ csrf_token() }}'},
|
||||
success: function(){
|
||||
line.remove();
|
||||
growl("{{ __('boilerplate::shop.admin.deletesuccess') }}", 'success');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
@@ -17,37 +17,5 @@
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
{{$dataTable->scripts()}}
|
||||
|
||||
<script>
|
||||
$('#families-table').on( 'draw.dt', function () {
|
||||
$('.btn-edit').click(function() {
|
||||
url = '/Shop/Admin/Families/edit/' + $(this).data('id');
|
||||
window.location = url;
|
||||
});
|
||||
|
||||
|
||||
$('.btn-del').on('click', '.destroy', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
bootbox.confirm("{{ __('boilerplate::shop.admin.families.list.confirmdelete') }}", function (result) {
|
||||
if (result === false) return;
|
||||
|
||||
$.ajax({
|
||||
url: href,
|
||||
method: 'delete',
|
||||
headers: {'X-CSRF-TOKEN': '{{ csrf_token() }}'},
|
||||
success: function(){
|
||||
line.remove();
|
||||
growl("{{ __('boilerplate::shop.admin.families.list.deletesuccess') }}", 'success');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@include('components.js.datatable', ['route' => '/Shop/Admin/Families', 'model' => 'families'])
|
||||
@endpush
|
||||
@@ -7,7 +7,7 @@
|
||||
@section('content')
|
||||
|
||||
{{ Form::open(['route' => 'Shop.Admin.Genres.store', 'id' => 'form', 'autocomplete' => 'off']) }}
|
||||
<input type="hidden" name="id" value="{{ $genre['id'] }}">
|
||||
<input type="hidden" name="id" value="{{ $id }}">
|
||||
|
||||
@include('Shop.Admin.Genres.form')
|
||||
|
||||
|
||||
@@ -1,16 +1,19 @@
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
{{ Form::label('name', 'Nom') }}
|
||||
@include('components.input', ['name' => 'name', 'value' => (isset($genre['name'])) ? $genre['name'] : null, 'required' => true])
|
||||
@include('components.input', ['name' => 'name', 'value' => isset($name) ? $name : null, 'required' => true])
|
||||
|
||||
{{ Form::label('alias', 'Alias') }}
|
||||
@include('components.input', ['name' => 'alias', 'value' => (isset($genre['alias'])) ? $genre['alias'] : null, 'required' => true])
|
||||
@include('components.input', ['name' => 'alias', 'value' => isset($alias) ? $alias : null, 'required' => true])
|
||||
|
||||
{{ Form::label('latin', 'Nom latin') }}
|
||||
@include('components.input', ['name' => 'latin', 'value' => (isset($genre['latin'])) ? $genre['latin'] : null, 'required' => true])
|
||||
@include('components.input', ['name' => 'latin', 'value' => isset($latin) ? $latin : null, 'required' => true])
|
||||
|
||||
{{ Form::label('description', 'Description') }}
|
||||
@include('components.textarea', ['name' => 'description', 'value' => (isset($genre['description'])) ? $genre['description'] : null, 'class' => 'editor', 'required' => false])
|
||||
@include('components.textarea', ['name' => 'description', 'value' => isset($description) ? $description : null, 'class' => 'editor', 'required' => false])
|
||||
|
||||
{{ Form::label('family', 'Famille') }}
|
||||
@include('components.select', ['name' => 'family_id', 'list' => $families, 'value' => isset($family_id) ? $family_id : null, 'required' => false])
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -17,16 +17,6 @@
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
{{$dataTable->scripts()}}
|
||||
|
||||
<script>
|
||||
$('#genres-table').on( 'draw.dt', function () {
|
||||
$('.btn-edit').click(function() {
|
||||
url = '/Shop/Admin/Genres/edit/' + $(this).data('id');
|
||||
window.location = url;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
@include('components.js.datatable', ['route' => '/Shop/Admin/Genres', 'model' => 'genres'])
|
||||
@endpush
|
||||
|
||||
|
||||
@@ -1,16 +1,19 @@
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
{{ Form::label('name', 'Nom') }}
|
||||
@include('components.input', ['name' => 'name', 'value' => (isset($specie['name'])) ? $specie['name'] : null, 'required' => true])
|
||||
@include('components.input', ['name' => 'name', 'value' => isset($name) ? $name : null, 'required' => true])
|
||||
|
||||
{{ Form::label('alias', 'Alias') }}
|
||||
@include('components.input', ['name' => 'alias', 'value' => (isset($specie['alias'])) ? $specie['alias'] : null, 'required' => true])
|
||||
@include('components.input', ['name' => 'alias', 'value' => isset($alias) ? $alias : null, 'required' => true])
|
||||
|
||||
{{ Form::label('latin', 'Nom latin') }}
|
||||
@include('components.input', ['name' => 'latin', 'value' => (isset($specie['latin'])) ? $specie['latin'] : null, 'required' => true])
|
||||
@include('components.input', ['name' => 'latin', 'value' => isset($latin) ? $latin : null, 'required' => true])
|
||||
|
||||
{{ Form::label('description', 'Description') }}
|
||||
@include('components.textarea', ['name' => 'description', 'value' => (isset($specie['description'])) ? $specie['description'] : null, 'class' => 'editor', 'required' => false])
|
||||
@include('components.textarea', ['name' => 'description', 'value' => isset($description) ? $description : null, 'class' => 'editor', 'required' => false])
|
||||
|
||||
{{ Form::label('genre', 'Genre') }}
|
||||
@include('components.select', ['name' => 'genre_id', 'list' => $genres, 'value' => isset($genre_id) ? $genre_id : null, 'required' => false])
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -22,3 +25,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -17,16 +17,6 @@
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
{{$dataTable->scripts()}}
|
||||
|
||||
<script>
|
||||
$('#species-table').on( 'draw.dt', function () {
|
||||
$('.btn-edit').click(function() {
|
||||
url = '/Shop/Admin/Species/edit/' + $(this).data('id');
|
||||
window.location = url;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
@include('components.js.datatable', ['route' => '/Shop/Admin/Species', 'model' => 'species'])
|
||||
@endpush
|
||||
|
||||
|
||||
16
resources/views/shop/admin/Varieties/create.blade.php
Normal file
16
resources/views/shop/admin/Varieties/create.blade.php
Normal file
@@ -0,0 +1,16 @@
|
||||
@extends('layout.index', [
|
||||
'title' => __('shop.varieties.title'),
|
||||
'subtitle' => __('shop.varieties.add'),
|
||||
'breadcrumb' => [__('shop.varieties.title'), __('shop.varieties.add')]
|
||||
])
|
||||
|
||||
@include('boilerplate::load.fileinput')
|
||||
|
||||
@section('content')
|
||||
|
||||
{{ Form::open(['route' => 'Shop.Admin.Varieties.store', 'id' => 'form', 'autocomplete' => 'off', 'files' => true]) }}
|
||||
|
||||
@include('Shop.Admin.Varieties.form')
|
||||
</form>
|
||||
|
||||
@endsection
|
||||
16
resources/views/shop/admin/Varieties/edit.blade.php
Normal file
16
resources/views/shop/admin/Varieties/edit.blade.php
Normal file
@@ -0,0 +1,16 @@
|
||||
@extends('layout.index', [
|
||||
'title' => __('shop.varieties.title'),
|
||||
'subtitle' => __('shop.varieties.edit'),
|
||||
'breadcrumb' => ['Familles']
|
||||
])
|
||||
|
||||
@section('content')
|
||||
|
||||
{{ Form::open(['route' => 'Shop.Admin.Varieties.store', 'id' => 'form', 'autocomplete' => 'off']) }}
|
||||
<input type="hidden" name="id" value="{{ $specie['id'] }}">
|
||||
|
||||
@include('Shop.Admin.Varieties.form')
|
||||
|
||||
</form>
|
||||
|
||||
@endsection
|
||||
28
resources/views/shop/admin/Varieties/form.blade.php
Normal file
28
resources/views/shop/admin/Varieties/form.blade.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
{{ Form::label('name', 'Nom') }}
|
||||
@include('components.input', ['name' => 'name', 'value' => isset($name) ? $name : null, 'required' => true])
|
||||
|
||||
{{ Form::label('alias', 'Alias') }}
|
||||
@include('components.input', ['name' => 'alias', 'value' => isset($alias) ? $alias : null, 'required' => true])
|
||||
|
||||
{{ Form::label('latin', 'Nom latin') }}
|
||||
@include('components.input', ['name' => 'latin', 'value' => isset($latin) ? $latin : null, 'required' => true])
|
||||
|
||||
{{ Form::label('description', 'Description') }}
|
||||
@include('components.textarea', ['name' => 'description', 'value' => isset($description) ? $description : null, 'class' => 'editor', 'required' => false])
|
||||
|
||||
{{ Form::label('genre', 'Genre') }}
|
||||
@include('components.select', ['name' => 'genre_id', 'list' => $genres, 'value' => isset($genre_id) ? $genre_id : null, 'required' => false])
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="float-right mt-3">
|
||||
@include('components.button-save')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
22
resources/views/shop/admin/Varieties/list.blade.php
Normal file
22
resources/views/shop/admin/Varieties/list.blade.php
Normal file
@@ -0,0 +1,22 @@
|
||||
@extends('layout.index', [
|
||||
'title' => __('shop.varieties.title'),
|
||||
'subtitle' => __('shop.varieties.list'),
|
||||
'breadcrumb' => [__('shop.varieties.title')]
|
||||
])
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="row pb-3">
|
||||
<div class="col text-right">
|
||||
<a href="{{ route('Shop.Admin.Varieties.create') }}" class="btn btn-sm btn-success">{{ __('shop.varieties.add') }} <i class="fa fa-plus"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{$dataTable->table()}}
|
||||
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
@include('components.js.datatable', ['route' => '/Shop/Admin/Varieties', 'model' => 'varieties'])
|
||||
@endpush
|
||||
|
||||
30
resources/views/shop/admin/Varieties/show.blade.php
Normal file
30
resources/views/shop/admin/Varieties/show.blade.php
Normal file
@@ -0,0 +1,30 @@
|
||||
@extends('layout.index', [
|
||||
'title' => __('products.title'),
|
||||
'subtitle' => __('products.title'),
|
||||
'breadcrumb' => [__('products.title')]
|
||||
])
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-offset-2 col-md-8">
|
||||
|
||||
<div class="box box-info">
|
||||
<div class="box-body">
|
||||
<div class="col-md-6">
|
||||
<h3>{{ name }}</h3>
|
||||
<h4>
|
||||
{{ $product.section.name }}<br>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
@include('components.carousel')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
Reference in New Issue
Block a user