01 2022 Microsite Promotion
This commit is contained in:
parent
3f1fb9377d
commit
38e7fd504a
39 changed files with 761 additions and 336 deletions
|
|
@ -23,6 +23,7 @@
|
|||
{!! Form::open(['url' => route('admin_product_category_store'), 'class' => 'form-horizontal', 'id'=>'']) !!}
|
||||
|
||||
<input type="hidden" name="id" id="id" value="@if($category->id>0){{$category->id}}@else new @endif">
|
||||
<input type="hidden" name="action" value="save-form">
|
||||
|
||||
<div class="text-left mt-0 mb-2">
|
||||
<button type="submit" class="btn btn-submit">{{ __('save') }}</button>
|
||||
|
|
@ -38,6 +39,7 @@
|
|||
|
||||
{!! Form::close() !!}
|
||||
|
||||
@include('admin.category.products')
|
||||
|
||||
@include('admin.category.images')
|
||||
|
||||
|
|
|
|||
|
|
@ -27,12 +27,20 @@
|
|||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-8">
|
||||
<div class="form-group col">
|
||||
<label class="form-label" for="show_on">{{ __('Kategorie anzeigen (Mehrfachauswahl)') }}</label>
|
||||
{{ Form::select('show_on[]', \App\Services\Type::$showONs, $category->show_on, array('data-live-search'=>'false', 'class'=>'selectpicker', 'id'=>'show_on', 'multiple') ) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
{{--<div class="form-group col-8">
|
||||
<label for="parent_id" class="form-label">{{__('Hauptkategorie')}}</label>
|
||||
<select class="selectpicker" data-style="btn-default" name="">
|
||||
{!! HTMLHelper::getCategoriesWithoutParents($category->parent_id) !!}
|
||||
</select>
|
||||
</div>
|
||||
--}}
|
||||
<div class="form-group col-sm-4">
|
||||
<label class="form-label" for="pos">{{ __('pos') }}</label>
|
||||
{{ Form::text('pos', $category->pos, array('placeholder'=>__('pos'), 'class'=>'form-control', 'id'=>'pos')) }}
|
||||
|
|
|
|||
|
|
@ -11,32 +11,39 @@
|
|||
<tr>
|
||||
<th style="max-width: 60px;"> </th>
|
||||
<th>{{__('Pos')}}</th>
|
||||
<th>{{__('Hauptkategorie')}}</th>
|
||||
<th>{{__('Kategorie')}}</th>
|
||||
{{--<th>{{__('Kategorie')}}</th>--}}
|
||||
<th>{{__('Headline')}}</th>
|
||||
<th>{{__('Translate') }}</th>
|
||||
<th>{{__('Headline')}}</th>
|
||||
<th>{{__('Produkte')}}</th>
|
||||
<th>{{__('sichbar')}}</th>
|
||||
{{-- <th>__('Translate') </th>--}}
|
||||
<th>{{__('Status')}}</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($values as $value)
|
||||
<tr>
|
||||
<td>
|
||||
<a href="{{route('admin_product_category_edit', [$value->id])}}" class="btn icon-btn btn-sm btn-primary">
|
||||
<span class="far fa-edit"></span>
|
||||
</a>
|
||||
</td>
|
||||
<td>{{ $value->pos }}</td>
|
||||
<td>@if($value->parent) {{ $value->parent->name }} @else {{ $value->name }} @endif</td>
|
||||
<td>@if($value->parent) {{ $value->name }} @else - @endif</td>
|
||||
<td>{{ $value->headline }}</td>
|
||||
<!-- <td>{{ $value->getTranNames() }}</td> -->
|
||||
<td data-sort="{{ $value->active }}">@if($value->active) <span class="badge badge-pill badge-success"><i class="fa fa-check"></i></span>@else<span class="badge badge-pill badge-danger"><i class="fa fa-times"></i></span>@endif</td>
|
||||
<td><a class="text-danger" href="{{ route('admin_product_category_delete', [$value->id]) }}" onclick="return confirm('{{__('Really delete entry?')}}');"><i class="far fa-trash-alt"></i></a></td>
|
||||
@foreach($values as $value)
|
||||
<tr>
|
||||
<td>
|
||||
<a href="{{route('admin_product_category_edit', [$value->id])}}" class="btn icon-btn btn-sm btn-primary">
|
||||
<span class="far fa-edit"></span>
|
||||
</a>
|
||||
</td>
|
||||
<td>{{ $value->pos }}</td>
|
||||
<td>@if($value->parent) {{ $value->parent->name }} @else {{ $value->name }} @endif</td>
|
||||
{{-- <td>@if($value->parent) {{ $value->name }} @else - @endif</td>--}}
|
||||
<td>{{ $value->headline }}</td>
|
||||
<td>{{ $value->product_categories->count() }}</td>
|
||||
<td>{!! implode($value->getShowOnTypes(), '<br>') !!}</td>
|
||||
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
{{-- <td>{{ $value->getTranNames() }}</td> --}}
|
||||
<td data-sort="{{ $value->active }}">@if($value->active) <span class="badge badge-pill badge-success"><i class="fa fa-check"></i></span>@else<span class="badge badge-pill badge-danger"><i class="fa fa-times"></i></span>@endif</td>
|
||||
<td><a class="text-danger" href="{{ route('admin_product_category_delete', ['category', $value->id]) }}" onclick="return confirm('{{__('Really delete entry?')}}');"><i class="far fa-trash-alt"></i></a></td>
|
||||
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="mt-4 ml-4">
|
||||
<a href="{{route('admin_product_category_edit', ['new'])}}" class="btn btn-sm btn-primary">
|
||||
|
|
@ -49,21 +56,11 @@
|
|||
|
||||
<script>
|
||||
$( document ).ready(function() {
|
||||
|
||||
|
||||
$('.datatables-style').dataTable({
|
||||
"bLengthChange": false,
|
||||
"iDisplayLength": 50,
|
||||
"order": [[ 1, "asc" ]],
|
||||
"aoColumns": [
|
||||
{ "sWidth": "8%" },
|
||||
{ "sWidth": "8%" },
|
||||
{ "sWidth": "19%" },
|
||||
{ "sWidth": "19%" },
|
||||
{ "sWidth": "30%" },
|
||||
{ "sWidth": "10%" },
|
||||
{ "sWidth": "8%" },
|
||||
],
|
||||
"order": [[ 1, "desc" ]],
|
||||
|
||||
"language": {
|
||||
"url": "/js/German.json"
|
||||
}
|
||||
|
|
|
|||
118
resources/views/admin/category/products.blade.php
Normal file
118
resources/views/admin/category/products.blade.php
Normal file
|
|
@ -0,0 +1,118 @@
|
|||
<div class="card mb-2">
|
||||
<h6 class="card-header">
|
||||
{{__('Produktliste')}} / {{ $category->name }}
|
||||
</h6>
|
||||
<div class="mt-3 ml-3">
|
||||
<button type="button" class="btn btn-sm btn-primary" data-toggle="modal" data-target="#modals-categorie-products"
|
||||
data-id="new"
|
||||
data-pos="0"
|
||||
data-produkt_id=""
|
||||
>{{__('Produkt hinzufügen')}}</button>
|
||||
</div>
|
||||
<div class="card-datatable table-responsive">
|
||||
<table class="datatables-style table table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Pos</th>
|
||||
<th>Produkt</th>
|
||||
<th>#</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($category->product_categories as $product_category)
|
||||
<tr>
|
||||
<td>
|
||||
<button type="button" class="btn icon-btn btn-sm btn-primary" data-toggle="modal" data-target="#modals-categorie-products"
|
||||
data-id="{{ $product_category->id }}"
|
||||
data-pos="{{ $product_category->pos }}"
|
||||
data-product_id="{{ $product_category->product_id }}">
|
||||
<span class="far fa-edit"></span>
|
||||
</button>
|
||||
</td>
|
||||
<td>
|
||||
{{ $product_category->pos }}
|
||||
</td>
|
||||
<td>
|
||||
@if($product_category->product)
|
||||
{{ $product_category->product->name }}
|
||||
@if($product_category->product->active)
|
||||
| <span class="badge badge-pill badge-success"><i class="fa fa-check"></i></span>
|
||||
@else
|
||||
| <span class="badge badge-pill badge-danger"><i class="fa fa-times"></i></span>
|
||||
@endif
|
||||
| <span class="small">{!! implode($product_category->product->getShowOnTypes(), ' / ') !!}</span>
|
||||
| <a href="{{ route('admin_product_edit', [$product_category->product->id]) }}" class="btn btn-xs btn-secondary"><i class="fa fa-eye"></i></a>
|
||||
@else
|
||||
-
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
<a class="text-danger" href="{{ route('admin_product_category_delete', ['product_category', $product_category->id]) }}" onclick="return confirm('{{__('Really delete entry?')}}');"><i class="far fa-trash-alt"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="mt-3 ml-3">
|
||||
<button type="button" class="btn btn-sm btn-primary" data-toggle="modal" data-target="#modals-categorie-products"
|
||||
data-id="new"
|
||||
data-pos="0"
|
||||
data-produkt_id=""
|
||||
>{{__('Produkt hinzufügen')}}</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Modal template -->
|
||||
<div class="modal fade" id="modals-categorie-products">
|
||||
<div class="modal-dialog">
|
||||
<form class="modal-content" action="{{ route('admin_product_category_store') }}" method="post">
|
||||
@csrf
|
||||
<input type="hidden" name="id">
|
||||
<input type="hidden" name="category_id" value="{{ $category->id }}">
|
||||
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"> {{__('Produkt')}} <span class="font-weight-light">{{__('create/edit')}}</span></h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-row">
|
||||
|
||||
<div class="form-group col-md-12">
|
||||
<label class="form-label" for="pos">{{ __('pos') }}</label>
|
||||
{{ Form::text('pos', $category->pos, array('placeholder'=>__('pos'), 'class'=>'form-control')) }}
|
||||
</div>
|
||||
<div class="form-group col-md-12">
|
||||
<label for="country_ids" class="form-label">{{__('Produkt')}}</label>
|
||||
<select class="selectpicker" name="product_id" id="product_id" data-style="btn-light" data-live-search="true" required>
|
||||
{!! HTMLHelper::getProductsOptions() !!}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">{{__('close')}}</button>
|
||||
<button type="submit" class="btn btn-primary" name="action" value="save-product_category">{{__('save')}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
$( document ).ready(function() {
|
||||
|
||||
$('#modals-categorie-products').on('show.bs.modal', function (event) {
|
||||
var button = $(event.relatedTarget);
|
||||
$(this).find(".modal-content input[name='id']").val(button.data('id'));
|
||||
$(this).find(".modal-body input[name='pos']").val(button.data('pos'));
|
||||
$(this).find(".modal-body select[name='product_id']").val(button.data('product_id'));
|
||||
$('.selectpicker').selectpicker('refresh');
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
Loading…
Add table
Add a link
Reference in a new issue