This commit is contained in:
Kevin Adametz 2020-05-06 15:52:59 +02:00
parent 68b9d1ff88
commit b9c26d06d0
75 changed files with 2143 additions and 818 deletions

View file

@ -0,0 +1,123 @@
@extends('layouts.layout-2')
@section('content')
<h4 class="font-weight-bold py-3 mb-1">
Leistungsträger
</h4>
<div class="card">
<div class="card-datatable table-responsive">
<table class="datatables-default table table-striped table-bordered">
<thead>
<tr>
<th style="max-width: 60px;">&nbsp;</th>
<th>{{__('Name')}}</th>
<th>{{__('E-Mail(s)')}}</th>
<th>{{__('Type')}}</th>
<th>{{__('sichtbar')}}</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($service_provider as $value)
<tr>
<td data-sort="{{ $value->id }}">
<button type="button" class="btn icon-btn btn-sm btn-primary" data-toggle="modal" data-target="#modals-default"
data-id="{{ $value->id }}"
data-name="{{ $value->name }}"
data-type="{{ $value->type }}"
data-contact_emails="{{\App\Services\Util::_implodeLines($value->contact_emails)}}"
data-active="{{ $value->active }}">
<span class="fa fa-edit"></span>
</button>
</td>
<td>{{ $value->name }}</td>
<td>{!! \App\Services\Util::_implodeLines($value->contact_emails, "<br>") !!}</td>
<td data-sort="{{ $value->type }}">{{$value->type}}</td>
<td data-sort="{{ $value->active }}">{!! \App\Services\HTMLHelper::getActiveIcon($value->active) !!}</td>
<td><a class="text-danger" href="{{ route('admin_settings_service_provider_delete', [$value->id]) }}" onclick="return confirm('{{__('Wirklich löschen?')}}');"><i class="fa fa-trash-alt"></i></a></td>
</tr>
@endforeach
</tbody>
</table>
<div class="mt-4 col">
<button type="button" class="btn btn-sm btn-primary" data-toggle="modal" data-target="#modals-default"
data-id="new"
data-name=""
data-type=""
data-contact_emails=""
data-active="1"
>Neuen Leistungsträger anlegen</button>
</div>
</div>
<div class="modal fade" id="modals-default">
<div class="modal-dialog">
{!! Form::open([ 'url' => route('admin_settings_service_provider_update'), 'method' => 'post', 'class' => 'modal-content' ]) !!}
{{ Form::hidden('id', '') }}
<div class="modal-header">
<h5 class="modal-title">Leistungsträger <span class="font-weight-light">anlegen/bearbeiten</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>
{{ Form::text('name', '', array('placeholder'=>__('Description'), 'class'=>'form-control', 'required'=>true)) }}
</div>
</div>
<div class="form-row">
<div class="form-group col">
<label class="form-label" for="type">Type</label>
{{ Form::select('type', \App\Models\ServiceProvider::$types , '', array('class'=>'custom-select', 'required'=>true)) }}
</div>
</div>
<div class="form-row">
<div class="form-group col">
<label class="form-label" for="contact_emails">Für interene Mails <span class="text-muted">(jede E-Mail in eine extra Zeile)</span></label>
{{ Form::textarea('contact_emails', '', array('class'=>'form-control', 'rows'=>4)) }}
</div>
</div>
<div class="form-group">
<label class="custom-control custom-checkbox m-0">
{{ Form::checkbox('active', 1, '', array('class'=>'custom-control-input')) }}
<span class="custom-control-label">{{__('sichtbar')}}</span>
</label>
</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">{{__('save')}}</button>
</div>
{!! Form::close() !!}
</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 select[name='type']").val(button.data('type'));
$(this).find(".modal-body textarea[name='contact_emails']").val(button.data('contact_emails'));
$(this).find(".modal-body input[name='active']").prop( "checked", button.data('active'));
});
$('.datatables-default').dataTable({
"bLengthChange": false,
"iDisplayLength": 50,
"order": [[ 0, "asc" ]],
"language": {
"url": "/js/German.json"
}
});
});
</script>
</div>
@endsection