IQ Reisebausteine bis Gruppe

This commit is contained in:
Kevin Adametz 2021-08-06 15:28:57 +02:00
parent 6880c7e989
commit 9baa1a6233
43 changed files with 2206 additions and 24 deletions

View file

@ -0,0 +1,143 @@
@extends('layouts.layout-2')
@section('content')
<h4 class="font-weight-bold py-3 mb-1">
Reiseorte
</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>{{__('Beschreibung')}}</th>
<th>{{__('Land')}}</th>
<th>{{__('Latitude')}}</th>
<th>{{__('Longitude')}}</th>
<th>{{__('sichtbar')}}</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($travel_places 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-name="{{ $value->name }}"
data-description="{{ $value->description }}"
data-travel_country_id="{{$value->travel_country_id}}"
data-latitude="{{ $value->latitude }}"
data-longitude="{{ $value->longitude }}"
data-active="{{ $value->active }}">
<span class="fa fa-edit"></span>
</button>
</td>
<td data-sort="{{ $value->name }}">{{ $value->name }}</td>
<td data-sort="{{ $value->description }}">{{ $value->description }}</td>
<td data-sort="{{ $value->travel_country->name }}">{{ $value->travel_country->name }}</td>
<td data-sort="{{ $value->latitude }}">{{ $value->latitude }}</td>
<td data-sort="{{ $value->longitude }}">{{ $value->longitude }}</td>
<td data-sort="{{ $value->active }}">{!! get_active_badge($value->active) !!}</td>
<td><a class="text-danger" href="{{ route('admin_settings_travel_place_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-description=""
data-travel_country_id="0"
data-latitude=""
data-longitude=""
data-active="1"
>Neuen Reiseort anlegen</button>
</div>
</div>
</div>
<!-- Modal template -->
<div class="modal fade" id="modals-default">
<div class="modal-dialog">
<form class="modal-content" action="{{ route('admin_settings_travel_place_update') }}" method="post">
@csrf
<input type="hidden" class="form-control" name="id">
<div class="modal-header">
<h5 class="modal-title">Reiseort <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>
<input type="text" class="form-control" name="name" placeholder="{{__('Name')}}" required>
</div>
</div>
<div class="form-group">
<label for="travel_country_id" class="form-label">{{__('Land')}}*</label>
<select class="selectpicker" data-style="btn-default" name="travel_country_id" data-live-search="true" required>
{!! HTMLHelper::getTravelCountriesOptions(false, false) !!}
</select>
</div>
<div class="form-row">
<div class="form-group col">
<label for="description" class="form-label">Beschreibung</label>
<textarea class="form-control" rows="2" name="description"></textarea>
</div>
</div>
<div class="form-row">
<div class="form-group col">
<label for="latitude" class="form-label">Latitude</label>
<input type="text" class="form-control" name="latitude" placeholder="{{__('latitude')}}">
</div>
</div>
<div class="form-row">
<div class="form-group col">
<label for="longitude" class="form-label">Longitude</label>
<input type="text" class="form-control" name="longitude" placeholder="{{__('longitude')}}">
</div>
</div>
<div class="form-group">
<label class="custom-control custom-checkbox m-0">
<input class="custom-control-input" name="active" type="checkbox" value="1">
<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>
</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='slug']").val(button.data('slug'));
$(this).find(".modal-body input[name='identifier']").val(button.data('identifier'));
$(this).find(".modal-body input[name='pos']").val(button.data('pos'));
$(this).find(".modal-body input[name='active']").prop( "checked", button.data('active'));
$(this).find(".modal-body select[name='travel_country_id']").val(button.data('travel_country_id'));
$('.selectpicker').selectpicker('refresh');
});
$('.datatables-default').dataTable({
"bLengthChange": false,
"iDisplayLength": 50,
"order": [[ 1, "asc" ]],
"language": {
"url": "/js/German.json"
}
});
});
</script>
@endsection