This commit is contained in:
Kevin Adametz 2022-06-15 18:08:45 +02:00
parent 9b0b5feb7e
commit 7a040c3e19
106 changed files with 4074 additions and 1349 deletions

View file

@ -2,9 +2,9 @@
@section('content')
<div class="card">
<h6 class="card-header">
<h5 class="card-header">
{{__('Karriere-Level')}}
</h6>
</h5>
<div class="card-datatable table-responsive">
<table class="datatables-style table table-striped table-bordered">
<thead>
@ -12,30 +12,50 @@
<th style="max-width: 60px;">&nbsp;</th>
<th>{{__('Pos')}}</th>
<th>{{__('Description')}}</th>
<th>{{__('Marge') }}</th>
<th>{{__('Translate') }}</th>
<th>{{__('Nächste Ebene')}}</th>
<th>{{__('Pr.') }}</th>
<th>{{__('Pr.Shop') }}</th>
<th>{{__('Qual.KP') }}</th>
<th>{{__('Qual.TP') }}</th>
<th>{{__('Pr. L.1') }}</th>
<th>{{__('Pr. L.2') }}</th>
<th>{{__('Pr. L.3') }}</th>
<th>{{__('Pr. L.4') }}</th>
<th>{{__('Pr. L.5') }}</th>
<th>{{__('Pr. L.6') }}</th>
<th>{{__('W.Bonus') }}</th>
<th>{{__('Status')}}</th>
<th>{{__('Standard')}}</th>
<th>{{__('ID')}}</th>
</tr>
</thead>
<tbody>
@foreach($values as $value)
<tr>
<td>
<button type="button" class="btn icon-btn btn-sm btn-primary" data-toggle="modal" data-target="#modals-default"
data-id="{{ $value->id }}"
data-pos="{{ $value->pos }}"
data-name="{{ $value->name }}"
data-margin="{{ $value->getFormattedMargin() }}"
data-trans_name="{{ json_encode($value->trans_name) }}"
data-active="{{ $value->active }}">
<span class="far fa-edit"></span>
</button>
<button type="button" class="btn icon-btn btn-sm btn-primary" data-toggle="modal" data-target="#modals-load-content"
data-id="{{ $value->id }}"
data-action="user-level-edit"
data-view="view"
data-route="{{ route('modal_load') }}"><span class="fa fa-edit"></span></button>
</td>
<td>{{ $value->pos }}</td>
<td>{{ $value->name }}</td>
<td>{{ $value->getFormattedMargin() }}</td>
<td>{{ $value->getTranNames() }}</td>
<td>@if($value->next_user_level) {{ $value->next_user_level->name }} @endif</td>
<td>{{ $value->margin }}</td>
<td>{{ $value->margin_shop }}</td>
<td>{{ $value->qual_kp }}</td>
<td>{{ $value->qual_tp }}</td>
<td>{{ $value->pr_line_1 }}</td>
<td>{{ $value->pr_line_2 }}</td>
<td>{{ $value->pr_line_3 }}</td>
<td>{{ $value->pr_line_4 }}</td>
<td>{{ $value->pr_line_5 }}</td>
<td>{{ $value->pr_line_6 }}</td>
<td>{{ $value->getFormattedGrowthBonus() }}</td>
<td data-sort="{{ $value->active }}">{!! get_active_badge($value->active) !!}</td>
<td data-sort="{{ $value->default }}">{!! get_active_badge($value->default) !!}</td>
<td>{{ $value->id }}</td>
</tr>
@endforeach
</tbody>
@ -51,99 +71,15 @@
</div>
</div>
</div>
<!-- Modal template -->
<div class="modal fade" id="modals-default">
<div class="modal-dialog">
<form class="modal-content" action="{{ route('admin_level_store') }}" method="post">
@csrf
<input type="hidden" class="form-control" name="id">
<div class="modal-header">
<h5 class="modal-title"> {{__('Attribute')}} <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">
<label for="name" class="form-label">{{__('Name')}}</label>
<input type="text" class="form-control" name="name" placeholder="{{__('Bezeichnung')}}">
</div>
</div>
<div class="form-row">
<div class="form-group col">
<label for="margin" class="form-label">{{__('Marge in %')}}</label>
<input type="text" class="form-control" name="margin" placeholder="{{__('Marge in %')}}">
</div>
</div>
<div class="form-row">
<div class="form-group col-6">
<label class="custom-control custom-checkbox m-2">
<input type="checkbox" class="custom-control-input" name="active" checked>
<span class="custom-control-label">{{__('active')}}</span>
</label>
</div>
<div class="form-group col-6">
<input type="text" class="form-control" name="pos" placeholder="{{__('Number to move the position if necessary')}}">
</div>
</div>
<hr>
@foreach($trans as $tran)
@if($tran != 'de')
<div class="form-row">
<div class="form-group col">
<label for="name" class="form-label">{{__('Translate')}} <strong style="text-transform: uppercase">{{$tran}}</strong></label>
<input type="text" class="form-control" name="trans[{{$tran}}]" id="trans_{{$tran}}" placeholder="">
</div>
</div>
@endif
@endforeach
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">{{__('close')}}</button>
<button type="submit" class="btn btn-primary">{{__('save')}}</button>
</div>
</form>
</div>
</div>
</div>
<script>
$( document ).ready(function() {
$('#modals-default').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='name']").val(button.data('name'));
$(this).find(".modal-body input[name='pos']").val(button.data('pos'));
$(this).find(".modal-body input[name='margin']").val(button.data('margin'));
$(this).find(".modal-body input[name='active']").prop( "checked", button.data('active'));
$.each(button.data('trans_name'), function (i, item) {
var name = '#trans_'+i;
$(name).val(item);
});
});
$('.datatables-style').dataTable({
"bLengthChange": false,
"iDisplayLength": 50,
"aoColumns": [
{ "sWidth": "8%" },
{ "sWidth": "8%" },
{ "sWidth": "19%" },
{ "sWidth": "19%" },
{ "sWidth": "30%" },
{ "sWidth": "10%" },
{ "sWidth": "8%" },
],
"order": [[ 1, "asc" ]],
"language": {
"url": "/js/German.json"
}