First Commit

This commit is contained in:
Kevin Adametz 2018-10-29 09:15:36 +01:00
commit 0c9a118281
633 changed files with 76612 additions and 0 deletions

View file

@ -0,0 +1,227 @@
@extends('layouts.layout-2')
@section('content')
<h4 class="font-weight-bold py-3 mb-1">
Vorlage verwalten
</h4>
{!! Form::open(['url' => route('draft_detail', [$id]), 'class' => 'form-horizontal', 'id'=>'lead-form-validation']) !!}
<input type="hidden" name="id" id="id" value="{{$id}}">
<!-- draft -->
<div class="card mb-2">
<div class="card-body">
<div class="form-group">
<label class="custom-control custom-checkbox float-right">
{!! Form::checkbox('active', 1, $draft->active, ['class'=>'custom-control-input']) !!}
<span class="custom-control-label">{{__('sichtbar')}}</span>
</label>
<label class="form-label" for="draft_name">{{ __('Bezeichnung') }}*</label>
{{ Form::text('name', $draft->name, array('placeholder'=>__('Name'), 'class'=>'form-control', 'id'=>'draft_name', 'required'=>true)) }}
</div>
</div>
</div>
@if(count($draft->draft_items))
@php($i = 1)
<div class="text-right mb-2">
<button type="submit" name="action" value="addItem" class="btn btn-sm btn-primary"><i class="far fa-plus"></i> Neue Leistung hinzufügen</button>
</div>
@foreach($draft->draft_items as $draft_item)
<!-- item -->
<div class="card mb-2">
<div class="card-body row">
<div class="form-group col-sm-4">
<select class="selectpicker" data-style="btn-light" name="draft_item[{{$draft_item->id}}][draft_type_id]" id="draft_item_{{$draft_item->id }}_draft_type_id" data-live-search="true" required>
<option value="" disabled>Vorlagen-Typ*</option>
{!! HTMLHelper::getDraftTypes($draft_item->draft_type_id) !!}
</select>
</div>
<div class="form-group col-sm-3 col-6">
<select class="selectpicker" data-style="btn-light" name="draft_item[{{$draft_item->id}}][days_start]]" id="draft_item_{{$draft_item->id }}_days_start">
<option value="">(Datum) Start + Tage</option>
{!! HTMLHelper::getRangeOptions($draft_item->days_start, 30, ' Tag(e)') !!}
</select>
</div>
<div class="form-group col-sm-3 col-6">
<select class="selectpicker" data-style="btn-light" name="draft_item[{{$draft_item->id}}][days_duration]" id="draft_item_{{$draft_item->id }}_days_duration">
<option value="">(Datum) Dauer + Tage</option>
{!! HTMLHelper::getRangeOptions($draft_item->days_duration, 30, ' Tag(e)') !!}
</select>
</div>
<div class="form-group col-sm-2 text-right">
<h5 class="float-right mt-1">#{{ $i++ }} </h5>
<button type="submit" name="action" value="up_{{$draft_item->id}}" class="btn btn-xs btn-default"><i class="fa fa-arrow-up"></i> </button>
<button type="submit" name="action" value="down_{{$draft_item->id}}" class="btn btn-xs btn-default mr-2"><i class="fa fa-arrow-down"></i> </button>
</div>
<div class="form-group col-sm-12">
{{ Form::textarea('draft_item['.$draft_item->id.'][service]', $draft_item->service, array('placeholder'=>__('Leistungen'), 'class'=>'form-control', 'id'=>'draft_item_'.$draft_item->id.'_service', 'rows'=>'1')) }}
</div>
<div class="form-group col-sm-2 col-3">
<select class="selectpicker" data-style="btn-light" name="draft_item[{{$draft_item->id}}][adult]" id="draft_item_{{$draft_item->id }}_adult">
<option value="">Teilnehmer</option>
{!! HTMLHelper::getRangeOptions($draft_item->adult, 10, ' T.') !!}
</select>
</div>
<div class="form-group col-sm-2 col-3">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"></span>
</div>
{{ Form::text('draft_item['.$draft_item->id.'][price_adult]', $draft_item->price_adult, array('placeholder'=>__('Preis in €'), 'class'=>'form-control', 'id'=>'draft_item_'.$draft_item->id.'_price_adult',)) }}
</div>
</div>
<div class="form-group col-sm-2 col-3">
<select class="selectpicker" data-style="btn-light" name="draft_item[{{$draft_item->id}}][children]" id="draft_item_{{$draft_item->id}}_children">
<option value="">Kinder</option>
{!! HTMLHelper::getRangeOptions($draft_item->children, 10, ' K.') !!}
</select>
</div>
<div class="form-group col-sm-2 col-3">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"></span>
</div>
{{ Form::text('draft_item['.$draft_item->id.'][price_children]', $draft_item->price_children, array('placeholder'=>__('Preis in €'), 'class'=>'form-control', 'id'=>'draft_item_'.$draft_item->id.'_price_children')) }}
</div>
</div>
<div class="form-group col-sm-2 col-3">
<label class="custom-control custom-checkbox mt-2">
{!! Form::checkbox('draft_item['.$draft_item->id.'][in_pdf]', 1, $draft_item->in_pdf, ['class'=>'custom-control-input']) !!}
<span class="custom-control-label">{{__('in PDF')}}</span>
</label>
</div>
<div class="form-group col-sm-2 col-6">
<div class="text-right mt-3">
<a class="text-danger" href="{{ route('draft_item_delete', [$draft_item->id]) }}" onclick="return confirm('{{__('Wirklich löschen?')}}');"><i class="far fa-trash-alt"></i></a>
</div>
</div>
</div>
</div>
@endforeach
@endif
@if(!empty($draft_items))
@foreach($draft_items as $key => $draft_item)
<!-- item -->
<div class="card mb-2">
<div class="card-body row">
<div class="form-group col-sm-6">
<select class="selectpicker" data-style="btn-light" name="draft_item[{{$key}}][draft_type_id]" id="draft_item_{{$key }}_draft_type_id" data-live-search="true" required>
<option value="" disabled>Vorlagen-Typ*</option>
{!! HTMLHelper::getDraftTypes($draft_item['draft_type_id']) !!}
</select>
</div>
<div class="form-group col-sm-3 col-6">
<select class="selectpicker" data-style="btn-light" name="draft_item[{{$key}}][days_start]]" id="draft_item_{{$key }}_days_start">
<option value="">(Datum) Start + Tage</option>
{!! HTMLHelper::getRangeOptions($draft_item['days_start'], 30, ' Tag(e)') !!}
</select>
</div>
<div class="form-group col-sm-3 col-6">
<select class="selectpicker" data-style="btn-light" name="draft_item[{{$key}}][days_duration]" id="draft_item_{{$key }}_days_duration">
<option value="">(Datum) Dauer + Tage</option>
{!! HTMLHelper::getRangeOptions($draft_item['days_duration'], 30, ' Tag(e)') !!}
</select>
</div>
<div class="form-group col-sm-12">
{{ Form::textarea('draft_item['.$key.'][service]', $draft_item['service'], array('placeholder'=>__('Leistungen'), 'class'=>'form-control', 'id'=>'draft_item_'.$key.'_service', 'rows'=>'1')) }}
</div>
<div class="form-group col-sm-2 col-3">
<select class="selectpicker" data-style="btn-light" name="draft_item[{{$key}}][adult]" id="draft_item_{{$key }}_adult">
<option value="">Teilnehmer</option>
{!! HTMLHelper::getRangeOptions($draft_item['adult'], 10, ' T.') !!}
</select>
</div>
<div class="form-group col-sm-2 col-3">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"></span>
</div>
{{ Form::text('draft_item['.$key.'][price_adult]', $draft_item['price_adult'], array('placeholder'=>__('Preis in €'), 'class'=>'form-control', 'id'=>'draft_item_'.$key.'_price_adult',)) }}
</div>
</div>
<div class="form-group col-sm-2 col-3">
<select class="selectpicker" data-style="btn-light" name="draft_item[{{$key}}][children]" id="draft_item_{{$key}}_children">
<option value="">Kinder</option>
{!! HTMLHelper::getRangeOptions($draft_item['children'], 10, ' K.') !!}
</select>
</div>
<div class="form-group col-sm-2 col-3">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"></span>
</div>
{{ Form::text('draft_item['.$key.'][price_children]', $draft_item['price_children'], array('placeholder'=>__('Preis in €'), 'class'=>'form-control', 'id'=>'draft_item_'.$key.'_price_children')) }}
</div>
</div>
<div class="form-group col-sm-2 col-3">
<label class="custom-control custom-checkbox mt-2">
{!! Form::checkbox('draft_item['.$key.'][in_pdf]', 1, $draft_item['in_pdf'], ['class'=>'custom-control-input']) !!}
<span class="custom-control-label">{{__('in PDF')}}</span>
</label>
</div>
</div>
</div>
@endforeach
<div class="text-left mt-3">
<button type="submit" name="action" value="saveAllFromOld" class="btn btn-submit">{{ __('aus Vorlage speichern') }}</button>&nbsp;
<a href="{{route('drafts')}}" class="btn btn-default">{{ __('back') }}</a>
</div>
@else
<div class="text-right">
<button type="submit" name="action" value="addItem" class="btn btn-sm btn-primary"><i class="far fa-plus"></i> Neue Leistung hinzufügen</button>
</div>
<div class="text-left mt-3">
<button type="submit" name="action" value="saveAll" class="btn btn-submit">{{ __('save changes') }}</button>&nbsp;
<a href="{{route('drafts')}}" class="btn btn-default">{{ __('back') }}</a>
</div>
@endif
{!! Form::close() !!}
@endsection

View file

@ -0,0 +1,187 @@
@extends('layouts.layout-2')
@section('content')
<h4 class="font-weight-bold py-3 mb-1">
Vorlagen
</h4>
<div class="nav-tabs-top mb-4">
<ul class="nav nav-tabs">
<li class="nav-item">
<a class="nav-link @if($step == false) active show @endif" data-toggle="tab" href="#navs-top-drafts">Übersicht</a>
</li>
<li class="nav-item">
<a class="nav-link @if($step == 'type') active show @endif" data-toggle="tab" href="#navs-top-draft_types">Typen</a>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane fade @if($step == false) active show @endif" id="navs-top-drafts">
<div class="card-body">
<div class="card-datatable table-responsive">
<table class="datatables-drafts table table-striped table-bordered">
<thead>
<tr>
<th style="max-width: 60px;">&nbsp;</th>
<th>{{__('Name')}}</th>
<th>{{__('sichtbar')}}</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($drafts as $value)
<tr>
<td>
<a href="{{ route('draft_detail', [$value->id]) }}" class="btn icon-btn btn-sm btn-primary">
<span class="far fa-edit"></span>
</a>
</td>
<td><a href="{{ route('draft_detail', [$value->id]) }}">{{ $value->name }}</a></td>
<td data-sort="{{ $value->active }}">
@if($value->active)
<span class="badge badge-pill badge-success"><i class="far fa-check"></i></span>
@else
<span class="badge badge-pill badge-danger"><i class="far fa-times"></i></span>
@endif
</td>
<td><a class="text-danger" href="{{ route('draft_delete', [$value->id]) }}" onclick="return confirm('{{__('Wirklich löschen?')}}');"><i class="far fa-trash-alt"></i></a></td>
</tr>
@endforeach
</tbody>
</table>
<div class="mt-4">
<a href="{{ route('draft_detail', ['new']) }}" class="btn btn-sm btn-primary">Neue Vorlage anlegen</a>
<a href="{{ route('draft_load_old') }}" class="btn btn-sm btn-default float-right">aus alter Vorlage laden</a><br>
<a href="{{ route('draft_load_new') }}" class="btn btn-sm btn-default float-right mt-2">aus Vorlage duplizieren</a>
</div>
</div>
<script>
$( document ).ready(function() {
$('.datatables-drafts').dataTable({
"bLengthChange": false,
"iDisplayLength": 50,
"language": {
"url": "/js/German.json"
}
});
});
</script>
</div>
</div>
<div class="tab-pane fade @if($step == 'type') active show @endif" id="navs-top-draft_types">
<div class="card-body">
<div class="card-datatable table-responsive">
<table class="datatables-types table table-striped table-bordered">
<thead>
<tr>
<th style="max-width: 60px;">&nbsp;</th>
<th>{{__('Name')}}</th>
<th>{{__('sichtbar')}}</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($draft_types as $value)
<tr>
<td>
<button type="button" class="btn icon-btn btn-sm btn-primary" data-toggle="modal" data-target="#modals-type"
data-id="{{ $value->id }}"
data-name="{{ $value->name }}"
data-active="{{ $value->active }}">
<span class="far fa-edit"></span>
</button>
</td>
<td>{{ $value->name }}</td>
<td data-sort="{{ $value->active }}">
@if($value->active)
<span class="badge badge-pill badge-success"><i class="far fa-check"></i></span>
@else
<span class="badge badge-pill badge-danger"><i class="far fa-times"></i></span>
@endif
</td>
<td><a class="text-danger" href="{{ route('draft_type_delete', [$value->id]) }}" onclick="return confirm('{{__('Wirklich löschen?')}}');"><i class="far fa-trash-alt"></i></a></td>
</tr>
@endforeach
</tbody>
</table>
<div class="mt-4 text-right">
<button type="button" class="btn btn-sm btn-primary" data-toggle="modal" data-target="#modals-type"
data-id="new"
data-name=""
data-active="1"
>Neuen Typ anlegen</button>
</div>
</div>
<!-- Modal template -->
<div class="modal fade" id="modals-type">
<div class="modal-dialog">
<form class="modal-content" action="{{ route('draft_type_update') }}" method="post">
@csrf
<input type="hidden" class="form-control" name="id">
<div class="modal-header">
<h5 class="modal-title">Vorlagen-Typ <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="{{__('Description')}}" required>
</div>
</div>
<div class="form-group">
<label class="custom-control custom-checkbox m-0">
<input type="checkbox" class="custom-control-input" name="active" checked>
<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-type').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'));
$('.selectpicker').selectpicker('refresh');
$(this).find(".modal-body input[name='active']").prop( "checked", button.data('active'));
});
$('.datatables-types').dataTable({
"bLengthChange": false,
"iDisplayLength": 50,
"language": {
"url": "/js/German.json"
}
});
});
</script>
</div>
</div>
</div>
</div>
@endsection

View file

@ -0,0 +1,40 @@
@extends('layouts.layout-2')
@section('content')
<h4 class="font-weight-bold py-3 mb-1">
Vorlage duplizieren
</h4>
{!! Form::open(['url' => route('draft_load_new'), 'class' => 'form-horizontal', 'id'=>'lead-form-validation']) !!}
<div class="card mb-2">
<div class="card-body row">
<div class="form-group col-sm-6">
<select class="selectpicker" data-style="btn-light" name="load_new" id="load_new" data-live-search="true" required>
@foreach($drafts as $d)
<option value="{{$d->id}}">{{$d->name}}</option>
@endforeach
</select>
</div>
</div>
</div>
<div class="text-left mt-3">
<button type="submit" name="action" value="loadOld" class="btn btn-submit">{{ __('laden') }}</button>&nbsp;
<a href="{{route('drafts')}}" class="btn btn-default">{{ __('back') }}</a>
</div>
{!! Form::close() !!}
@endsection

View file

@ -0,0 +1,40 @@
@extends('layouts.layout-2')
@section('content')
<h4 class="font-weight-bold py-3 mb-1">
Vorlage laden
</h4>
{!! Form::open(['url' => route('draft_load_old'), 'class' => 'form-horizontal', 'id'=>'lead-form-validation']) !!}
<div class="card mb-2">
<div class="card-body row">
<div class="form-group col-sm-6">
<select class="selectpicker" data-style="btn-light" name="load_old" id="load_old" data-live-search="true" required>
@foreach($templates as $t)
<option value="{{$t->id}}">{{$t->title}}</option>
@endforeach
</select>
</div>
</div>
</div>
<div class="text-left mt-3">
<button type="submit" name="action" value="loadOld" class="btn btn-submit">{{ __('laden') }}</button>&nbsp;
<a href="{{route('drafts')}}" class="btn btn-default">{{ __('back') }}</a>
</div>
{!! Form::close() !!}
@endsection