17 Nov - Static Sites to laravel

This commit is contained in:
Kevin Adametz 2018-11-17 02:01:22 +01:00
parent 610aa1e202
commit 5ff57a21a7
3661 changed files with 569001 additions and 771 deletions

View file

@ -0,0 +1,45 @@
@extends('layouts.layout-2')
@section('content')
@if ($errors->any())
<div class="row">
<div class="col-sm-12">
<div class="alert alert-danger">
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
</div>
</div>
@endif
<h4 class="font-weight-bold py-3 mb-0">
{{ __('Create/Edit Produkt') }}
</h4>
{!! Form::open(['url' => route('admin_product_store'), 'class' => 'form-horizontal', 'id'=>'']) !!}
<input type="hidden" name="id" id="id" value="@if($product->id>0){{$product->id}}@else new @endif">
<div class="text-left mt-0 mb-2">
<button type="submit" class="btn btn-submit">{{ __('save') }}</button>&nbsp;
<a href="{{ route('admin_product_show') }}" class="btn btn-default">{{ __('back') }}</a>
</div>
@include('admin.product.form')
<div class="text-left mt-0 mb-2">
<button type="submit" class="btn btn-submit">{{ __('save') }}</button>&nbsp;
<a href="{{ route('admin_product_show') }}" class="btn btn-default">{{ __('back') }}</a>
</div>
{!! Form::close() !!}
@include('admin.product.images')
@endsection

View file

@ -0,0 +1,130 @@
<div class="card mb-2">
<h5 class="card-header">
{{ __('Produkt') }}
</h5>
<div class="card-body">
<div class="form-group">
<label class="custom-control custom-checkbox float-right">
{!! Form::checkbox('active', 1, $product->active, ['class'=>'custom-control-input']) !!}
<span class="custom-control-label">{{__('aktiv')}}</span>
</label>
<label class="form-label" for="name">{{ __('Name') }}*</label>
{{ Form::text('name', $product->name, array('placeholder'=>__('Name'), 'class'=>'form-control', 'id'=>'name', 'required')) }}
</div>
<div class="form-group">
<label class="form-label" for="title">{{ __('Title') }}</label>
{{ Form::text('title', $product->title, array('placeholder'=>__('Title'), 'class'=>'form-control', 'id'=>'title')) }}
</div>
<div class="form-row">
<div class="form-group col-sm-8">
<label class="form-label" for="title">{{ __('Kategorie(n)') }}</label>
<select class="selectpicker" name="categories[]" id="categories" data-style="btn-light" data-live-search="false" multiple>
{!! HTMLHelper::getCategoriesOptions($product->categories()->pluck('category_id')->toArray()) !!}
</select>
</div>
<div class="form-group col-sm-4">
<label class="form-label" for="pos">{{ __('pos') }}</label>
{{ Form::text('pos', $product->pos, array('placeholder'=>__('pos'), 'class'=>'form-control', 'id'=>'pos')) }}
</div>
</div>
<div class="form-group">
<label class="form-label" for="copy">{{ __('copy') }}</label>
{{ Form::textarea('copy', $product->copy , array('placeholder'=>__('Leistungen'), 'class'=>'form-control summernote', 'id'=>'copy')) }}
</div>
</div>
</div>
<div class="card mb-2">
<h5 class="card-header">
{{ __('Preise') }}
</h5>
<div class="card-body">
<div class="form-row">
<div class="form-group col-sm-4">
<label class="form-label" for="price">{{ __('price') }}</label>
{{ Form::text('price', $product->getFormattedPrice(), array('placeholder'=>__('price'), 'class'=>'form-control', 'id'=>'price')) }}
</div>
<div class="form-group col-sm-4">
<label class="form-label" for="price_ek">{{ __('price_ek') }}</label>
{{ Form::text('price_ek', $product->getFormattedPriceEk(), array('placeholder'=>__('price_ek'), 'class'=>'form-control', 'id'=>'price_ek')) }}
</div>
<div class="form-group col-sm-4">
<label class="form-label" for="tax">{{ __('tax') }}</label>
{{ Form::text('tax', $product->getFormattedTax(), array('placeholder'=>__('tax'), 'class'=>'form-control', 'id'=>'tax')) }}
</div>
</div>
<div class="form-row">
<div class="form-group col-sm-4">
<label class="form-label" for="price_old">{{ __('price_old') }}</label>
{{ Form::text('price_old', $product->getFormattedPriceOld(), array('placeholder'=>__('price_old'), 'class'=>'form-control', 'id'=>'price_old')) }}
</div>
<div class="form-group col-sm-4">
<label class="form-label" for="amount">{{ __('amount') }}</label>
{{ Form::text('amount', $product->amount, array('placeholder'=>__('amount'), 'class'=>'form-control', 'id'=>'amount')) }}
</div>
</div>
</div>
</div>
<div class="card mb-2">
<h5 class="card-header">
{{ __('Inhalte') }}
</h5>
<div class="card-body">
<div class="form-group">
<label class="form-label" for="contents">{{ __('contents') }}</label>
{{ Form::text('contents', $product->contents, array('placeholder'=>__('contents'), 'class'=>'form-control', 'id'=>'contents')) }}
</div>
<div class="form-group">
<label class="form-label" for="number">{{ __('number') }}</label>
{{ Form::text('number', $product->number, array('placeholder'=>__('number'), 'class'=>'form-control', 'id'=>'number')) }}
</div>
<div class="form-group">
<label class="form-label" for="icons">{{ __('icons') }}</label>
{{ Form::text('icons', $product->icons, array('placeholder'=>__('icons'), 'class'=>'form-control', 'id'=>'icons')) }}
</div>
<div class="form-group">
<label class="form-label" for="title">{{ __('Attribute') }}</label>
<select class="selectpicker" name="attributes[]" id="attributes" data-style="btn-light" data-live-search="false" multiple>
{!! HTMLHelper::getAttributesOptions($product->attributes()->pluck('attribute_id')->toArray()) !!}
</select>
</div>
<div class="form-group">
<label class="form-label" for="description">{{ __('description') }}</label>
{{ Form::textarea('description', $product->description , array('placeholder'=>__('description'), 'class'=>'form-control summernote', 'id'=>'description')) }}
</div>
<div class="form-group">
<label class="form-label" for="usage">{{ __('usage') }}</label>
{{ Form::textarea('usage', $product->usage , array('placeholder'=>__('usage'), 'class'=>'form-control summernote', 'id'=>'usage')) }}
</div>
<div class="form-group">
<label class="form-label" for="ingredients">{{ __('ingredients') }}</label>
{{ Form::textarea('ingredients', $product->ingredients , array('placeholder'=>__('ingredients'), 'class'=>'form-control summernote', 'id'=>'ingredients')) }}
</div>
</div>
</div>

View file

@ -0,0 +1,80 @@
<div class="card mb-2">
<h5 class="card-header">
{{ __('Bilder') }}
</h5>
<div class="card-body">
@if($product->id>0)
<style>
.dz-message {
margin: 2rem 0;
}
.default-style .dz-message {
font-size: 1.1em;
}
</style>
<div class="row">
<div class="col-md-8 col-sm-6">
<div class="row">
@foreach($product->images as $image)
<div class="col-6 col-md-4 text-center" style="border: 1px solid #eee;">
<img class="img-fluid" alt="" src="{{ route('product_image', [$image->slug]) }}">
<br>
<a href="{{ route('admin_product_delete_image', [$image->id, $product->id]) }}" class="btn btn-sm btn-primary mt-2 mb-2" onclick="return confirm('Bild wirklich löschen?');">Bild löschen</a>
</div>
@endforeach
</div>
</div>
<div class="col-md-4 col-sm-6">
<div class="card">
<div class="card-body">
<form method="POST" action="{{ route('admin_product_upload_image') }}" accept-charset="UTF-8" class="avatar" enctype="multipart/form-data">
@csrf
<input type="hidden" name="product_id" value="{{$product->id}}">
<div class="slim_holder text-center">
<div class="slim" style="margin:20px auto;"
data-label='<span class="text-green">Foto-Upload</span><br>(Datei suchen oder Drag & Drop)'
data-fetcher="fetch.php"
data-size="600,800"
data-min-size="200,200"
data-max-file-size="10"
data-status-image-too-small="Bild zu klein<br>min. $0 Pixel"
data-status-file-type="Ungültige Datei<br>bitte nur: $0"
data-status-file-size="Die Datei ist zu groß<br>max. $0 MB"
data-button-confirm-label="bestätigen"
data-button-cancel-label="abbrechen"
data-button-confirm-title="bestätigen"
data-button-cancel-title="abbrechen"
data-button-rotate-title="drehen"
data-ratio="3:4">
<input type="file" name="images[]" required />
</div>
<br>
<button class="btn btn-primary" type="submit">Bild speichern</button>
</div>
</form>
</div>
</div>
</div>
</div>
@else
<p>Produkt erst speichern</p>
@endif
</div>
</div>

View file

@ -0,0 +1,78 @@
@extends('layouts.layout-2')
@section('content')
<div class="card">
<h6 class="card-header">
{{__('Produkte')}}
</h6>
<div class="card-datatable table-responsive">
<table class="datatables-style table table-striped table-bordered">
<thead>
<tr>
<th style="max-width: 60px;">&nbsp;</th>
<th>{{__('Pos')}}</th>
<th>{{__('Bild')}}</th>
<th>{{__('Name')}}</th>
<th>{{__('Kategorie')}}</th>
<th>{{__('Status')}}</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($values as $value)
<tr>
<td>
<a href="{{route('admin_product_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(count($value->images))
<img class="img-fluid" alt="" style="max-height: 80px" src="{{ route('product_image', [$value->images->first()->slug]) }}">
@endif
</td>
<td>{{ $value->name }}</td>
<td>
@foreach($value->categories as $category)
{{ $category->category->name }}
@endforeach
</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('admin_product_delete', [$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_edit', ['new'])}}" class="btn btn-sm btn-primary">
{{__('Neues Produkt erstellen')}}
</a>
</div>
</div>
</div>
<script>
$( document ).ready(function() {
$('.datatables-style').dataTable({
"bLengthChange": false,
"iDisplayLength": 50,
"aoColumns": [
{ "sWidth": "8%" },
{ "sWidth": "8%" },
{ "sWidth": "19%" },
{ "sWidth": "19%" },
{ "sWidth": "30%" },
{ "sWidth": "10%" },
{ "sWidth": "8%" },
],
"language": {
"url": "/js/German.json"
}
});
});
</script>
@endsection