[WIP] Admin for Families, Genres and Species
This commit is contained in:
@@ -8,14 +8,7 @@
|
||||
|
||||
@section('content')
|
||||
|
||||
{{ Form::open(['route' => 'Shop.Admin.families.store', 'id' => 'form', 'autocomplete' => 'off', 'files' => true]) }}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12 text-right">
|
||||
@include('components.button-save')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ Form::open(['route' => 'Shop.Admin.families.store', 'id' => 'form', 'autocomplete' => 'off', 'files' => true]) }}
|
||||
@include('Shop.Admin.families.form')
|
||||
</form>
|
||||
|
||||
|
||||
@@ -1,39 +1,16 @@
|
||||
@extends('layout.index', [
|
||||
'title' => 'Familles',
|
||||
'subtitle' => 'Edition d\'une famille',
|
||||
'title' => __('shop.families.title'),
|
||||
'subtitle' => __('shop.families.edit'),
|
||||
'breadcrumb' => ['Familles']
|
||||
])
|
||||
|
||||
@include('boilerplate::load.icheck')
|
||||
@include('boilerplate::load.fileinput')
|
||||
|
||||
@prepend('js')
|
||||
@include('components.js', ['js' => '/js/main.min.js'])
|
||||
@endprepend
|
||||
|
||||
@push('css')
|
||||
@include('components.css', ['css' => '/css/main.min.css'])
|
||||
@endpush
|
||||
|
||||
|
||||
@section('content')
|
||||
|
||||
{{ Form::open(['route' => 'Shop.Admin.Families.update', 'id' => 'lot-form', 'autocomplete' => 'off', 'files' => true]) }}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12 mbl">
|
||||
<a href="{{ route("Shop.Admin.Families.index") }}" class="btn btn-default">
|
||||
{{ __('families.list.title') }}
|
||||
</a>
|
||||
|
||||
<span class="btn-group pull-right">
|
||||
@include('components.button-save')
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="id" value="{{ $id }}">
|
||||
{{ Form::open(['route' => 'Shop.Admin.Families.store', 'id' => 'form', 'autocomplete' => 'off']) }}
|
||||
<input type="hidden" name="id" value="{{ $family['id'] }}">
|
||||
|
||||
@include('Shop.Admin.Families.form')
|
||||
|
||||
</form>
|
||||
|
||||
@endsection
|
||||
|
||||
@@ -1,38 +1,21 @@
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
{{ Form::label('name', 'Nom') }}
|
||||
@include('components.input', ['name' => 'name', 'value' => (isset($section['name'])) ? $section['name'] : null, 'required' => true])
|
||||
@include('components.input', ['name' => 'name', 'value' => (isset($family['name'])) ? $family['name'] : null, 'required' => true])
|
||||
|
||||
{{ Form::label('description', 'Description') }}
|
||||
@include('components.textarea', ['name' => 'description', 'id_name' => 'description', 'value' => (isset($section['description'])) ? $section['description'] : null, 'required' => true])
|
||||
{{ Form::label('alias', 'Alias') }}
|
||||
@include('components.input', ['name' => 'alias', 'value' => (isset($family['alias'])) ? $family['alias'] : null, 'required' => true])
|
||||
|
||||
{{ Form::label('description', 'Rubrique parente') }}
|
||||
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="row">
|
||||
<div class="col-md-12 row-new-lot-photo row-lot-photo mt-3">
|
||||
{{ Form::label('latin', 'Nom latin') }}
|
||||
@include('components.input', ['name' => 'latin', 'value' => (isset($family['latin'])) ? $family['latin'] : null, 'required' => true])
|
||||
|
||||
<!--
|
||||
<p>
|
||||
<button type="button" class="btn btn-danger delete-new-lot-photo-btn"><i class="fa fa-minus-circle"></i></button>
|
||||
Photo <span class="row-photo-number"></span>
|
||||
</p>
|
||||
-->
|
||||
|
||||
<input name="lot_photos[][file]" type="file" class="file" data-show-upload="false" data-show-caption="true" data-msg-placeholder="Choisissez une photo">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include('boilerplate::load.tinymce')
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
$(function() {
|
||||
$('#description').tinymce({});
|
||||
})
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="float-right mt-3">
|
||||
@include('components.button-save')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
@extends('layout.index', [
|
||||
'title' => __('shop.families.title'),
|
||||
'subtitle' => __('shop.families.list'),
|
||||
'breadcrumb' => [__('shop.families.title')]
|
||||
])
|
||||
|
||||
@@ -17,4 +18,36 @@
|
||||
|
||||
@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>
|
||||
|
||||
|
||||
@endpush
|
||||
Reference in New Issue
Block a user