Promotion Backend v1
This commit is contained in:
parent
0ed47d3553
commit
f0da981737
43 changed files with 2765 additions and 45 deletions
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
@if($user->isRenewalAccount())
|
||||
<div class="card w-100 mb-4">
|
||||
<h5 class="card-header">Deine Mitglidschaft wurde am {{ $user->nextRenewalAccount() }} verlängert.</h5>
|
||||
<h5 class="card-header">Deine Mitgliedschaft wurde am {{ $user->nextRenewalAccount() }} verlängert.</h5>
|
||||
<div class="card-body">
|
||||
@if($userHistoryPaymentOrder && $userHistoryPaymentOrder->status > 2)
|
||||
<h6 class="alert badge-{{$userHistoryPaymentOrder->getStatusColor()}}">Eine Zahlung wurde ausgeführt. Status: {{ trans('payment.status.'.$userHistoryPaymentOrder->getStatusType())}}</h6>
|
||||
|
|
@ -102,7 +102,7 @@
|
|||
<div class="card w-100 mb-4">
|
||||
<h5 class="card-header">{{__('Mitgliedschaft')}} {{__('anpassen')}}</h5>
|
||||
<div class="card-body">
|
||||
<h6 class="d-block text-dark">Du kannst Deine Mitglidschaft bis zur nächsten Vertragsverlängerung, am {{ $user->nextRenewalAccount() }}, ändern.</h6>
|
||||
<h6 class="d-block text-dark">Du kannst Deine Mitgliedschaft bis zur nächsten Vertragsverlängerung, am {{ $user->nextRenewalAccount() }}, ändern.</h6>
|
||||
<p>Die restlichen Laufzeiten bleiben erhalten, erst mit der Verlängerung wird das geänderte Paket aktiv.</p>
|
||||
@include('user.membership._change')
|
||||
</div>
|
||||
|
|
@ -117,7 +117,7 @@
|
|||
<div class="card w-100 mb-4">
|
||||
<h5 class="card-header">{{__('Mitgliedschaft')}} {{__('anpassen')}}</h5>
|
||||
<div class="card-body">
|
||||
<h6 class="d-block text-dark">Du kannst Deine Mitglidschaftsrolle bis zur nächsten Vertragsverlängerung ({{ $user->nextRenewalAccount() }}), ändern.
|
||||
<h6 class="d-block text-dark">Du kannst Deine Mitgliedschaftsrolle bis zur nächsten Vertragsverlängerung ({{ $user->nextRenewalAccount() }}), ändern.
|
||||
<br> <span class="small">Erst nach der Verlängerug ist die neue Rolle aktiv.</span>
|
||||
</h6>
|
||||
@include('user.membership._change_level')
|
||||
|
|
|
|||
17
resources/views/user/promotion/cart.blade.php
Normal file
17
resources/views/user/promotion/cart.blade.php
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<h5>
|
||||
Potentielle Kosten für diese Promotion:
|
||||
{{ formatNumber($user_promotion_cart['price_net']) }} € netto / {{ formatNumber($user_promotion_cart['price']) }} € inkl. MwSt.
|
||||
</h5>
|
||||
<p>Text ...</p>
|
||||
|
||||
@if(isset($checkPaymentCredit))
|
||||
@if($checkPaymentCredit === 'empty')
|
||||
<h6 class="alert badge-danger mt-3 py-2">Du hast kein Guthaben aus Deinem Konto auf, lade Dein Konto auf, bis dahin ist die Promotion gestoppt.</h6>
|
||||
@endif
|
||||
@if($checkPaymentCredit === 'okay')
|
||||
<h6 class="alert badge-success mt-3 py-2">Dein Guthaben ist für diese Promotion</h6>
|
||||
@endif
|
||||
@if($checkPaymentCredit === 'not')
|
||||
<h6 class="alert badge-danger mt-3 py-2">Dein Guthaben ist nicht ausreichend für diese Promotion, lade Dein Konto auf, bis dahin ist die Promotion gestoppt.</h6>
|
||||
@endif
|
||||
@endif
|
||||
47
resources/views/user/promotion/detail.blade.php
Normal file
47
resources/views/user/promotion/detail.blade.php
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
@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-2 mb-2">
|
||||
<div>{{ __('navigation.my_promotions') }} / {{ __('bearbeiten') }}</div>
|
||||
</h4>
|
||||
|
||||
{!! Form::open(['url' => route('user_promotion_detail', $user_promotion->id), 'class' => 'form-horizontal', 'id'=>"user-promotion-form-validations"]) !!}
|
||||
|
||||
<div class="text-left mt-0 mb-2">
|
||||
<button type="submit" class="btn btn-submit" name="action" value="save-user-promotion">Promotion {{ __('save') }}</button>
|
||||
<a href="{{ route('user_promotions') }}" class="btn btn-default">{{ __('back') }}</a>
|
||||
</div>
|
||||
|
||||
@include('user.promotion.form')
|
||||
|
||||
<div class="text-left mt-0 mb-2">
|
||||
<button type="submit" class="btn btn-submit" name="action" value="save-user-promotion">Promotion {{ __('save') }}</button>
|
||||
<a href="{{ route('user_promotions') }}" class="btn btn-default">{{ __('back') }}</a>
|
||||
</div>
|
||||
|
||||
{!! Form::close() !!}
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
$( document ).ready(function() {
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
341
resources/views/user/promotion/form.blade.php
Normal file
341
resources/views/user/promotion/form.blade.php
Normal file
|
|
@ -0,0 +1,341 @@
|
|||
|
||||
<div class="card mb-2">
|
||||
<h5 class="card-header">
|
||||
{{ __('Promotion') }}
|
||||
</h5>
|
||||
<div class="card-body">
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12 {{ $errors->has('name') ? 'has-error' : '' }}">
|
||||
<label class="custom-control custom-checkbox float-right">
|
||||
{!! Form::checkbox('active', 1, $user_promotion->active, ['class' => 'custom-control-input']) !!}
|
||||
<span class="custom-control-label">{{ __('Promotion aktiv') }}</span>
|
||||
</label>
|
||||
<label class="form-label" for="name">Promotion Name vergeben*</label>
|
||||
{{ Form::text('name', $user_promotion->name, ['placeholder' => __('Promotion Name'), 'class' => 'form-control', 'id' => 'name', 'required' => true]) }}
|
||||
@if ($errors->has('name'))
|
||||
<span class="help-block">
|
||||
<strong>{{ $errors->first('name') }}</strong>
|
||||
</span>
|
||||
@endif
|
||||
</div>
|
||||
<div class="form-group col-12">
|
||||
<label class="form-label" for="description">Kurzbeschreibung (optional)</label>
|
||||
{{ Form::textarea('description', $user_promotion->description, ['placeholder' => __('Kurzbeschreibung'), 'class' => 'form-control', 'rows' => 2, 'id' => 'description']) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p>Text...</p>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-8">
|
||||
<div class="input-group mt-2 mb-2 ">
|
||||
<span class="input-group-prepend">
|
||||
<div class="py-2 px-1">
|
||||
<strong>www.testemicht.jetzt/ </strong>
|
||||
</div>
|
||||
</span>
|
||||
{{ Form::text('user_promotion_url', $user_promotion->url, ['placeholder' => 'z.B. "thomas" oder "dani21" o.ä.', 'class' => 'form-control' . ($errors->has('user_promotion_url') ? ' is-invalid' : ''), 'id' => 'user_promotion_url', 'required' => true]) }}
|
||||
</div>
|
||||
@if ($errors->has('user_promotion_url'))
|
||||
<span class="invalid-feedback" style="display: inline-block;">
|
||||
<strong>{{ $errors->first('user_promotion_url') }}</strong>
|
||||
</span>
|
||||
@endif
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<div class="px-3 py-0 py-md-3">
|
||||
<div class="badge badge-success" style="display: none" id="user_promotion_url_success"><i
|
||||
class="fa fa-check"></i> ist noch frei</div>
|
||||
<div class="badge badge-danger" style="display: none" id="user_promotion_url_error"><i
|
||||
class="fa fa-times"></i> nicht verfügbar/Fehler</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="from-group mb-2 col-md-8">
|
||||
<label class="form-label">Vorschau Domain</label>
|
||||
{{ Form::text('preview_user_promotion_url', $user_promotion->getUrlPreview(), ['placeholder' => __('Vorschau Shop-Internet Adresse'), 'class' => 'form-control', 'id' => 'preview_user_promotion_url', 'readonly']) }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-sm-12">
|
||||
<hr>
|
||||
<label class="custom-control custom-checkbox mt-2">
|
||||
{!! Form::checkbox('pick_up', 1, $user_promotion->pick_up, ['class' => 'custom-control-input']) !!}
|
||||
<span class="custom-control-label">Kunden können bei mir persönlich abholen.</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<hr class="m-0">
|
||||
<div class="card-body">
|
||||
<p>Text ...</p>
|
||||
<h5>
|
||||
Aktuelles Guthaben: {{ Auth::user()->getFormattedPaymentCredit() }} €
|
||||
<span class="text-muted small">(Guthaben aufladen unter: <a
|
||||
href="{{ route('user_order_my_delivery', ['me']) }}">Bestellungen aufgeben</a> -> Produkt
|
||||
Guthaben aufladen)</span>
|
||||
</h5>
|
||||
<style>
|
||||
table.table-product,
|
||||
table.table-product tr td,
|
||||
table.table-product tr th {
|
||||
border: none;
|
||||
}
|
||||
|
||||
table.table-product tr.border-top td {
|
||||
border-top: 1px solid #b8b8b9;
|
||||
}
|
||||
|
||||
table.table-product tr.border-bottom td,
|
||||
table.table-product tr.border-bottom th {
|
||||
border-bottom: 1px solid #b8b8b9;
|
||||
}
|
||||
|
||||
|
||||
.btn-md-extra {
|
||||
padding: 0.3rem 0.6rem;
|
||||
font-size: 0.8rem;
|
||||
line-height: 1.5;
|
||||
border-radius: 0.25rem;
|
||||
}
|
||||
|
||||
.md-btn-extra {
|
||||
width: calc(1.7rem + 2px) !important;
|
||||
line-height: 1.5rem;
|
||||
}
|
||||
|
||||
.form-control.input-extra {
|
||||
padding: 0.28rem 0.6rem;
|
||||
font-size: 0.8rem;
|
||||
font-weight: 500;
|
||||
min-height: calc(1.8rem + 2px);
|
||||
height: calc(1.8rem + 2px);
|
||||
width: 44px;
|
||||
}
|
||||
|
||||
.input-group-min-w {
|
||||
min-width: 102px;
|
||||
}
|
||||
|
||||
.img-extra {
|
||||
min-width: 55px;
|
||||
max-height: 160px;
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.default-style:not([dir=rtl]) div.card-datatable table.dataTable thead th:first-child, .default-style:not([dir=rtl]) div.card-datatable table.dataTable tbody td:first-child, .default-style:not([dir=rtl]) div.card-datatable table.dataTable tfoot th:first-child {
|
||||
padding-left: 0.6rem !important;
|
||||
}
|
||||
|
||||
.img-extra {
|
||||
min-width: 35px;
|
||||
max-height: 160px;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-product table-striped m-0" id="datatables-promotion-list" data-url="{{ route('user_promotion_load') }}" data-action="updateCart" data-user_promotion_id="{{ $user_promotion->id }}">
|
||||
<thead>
|
||||
<tr class="border-bottom">
|
||||
<th style="max-width: 60px;">Aktiv</th>
|
||||
<th>{{ __('Anzahl') }}</th>
|
||||
<th>{{ __('Produkt') }}</th>
|
||||
<th class="text-right">{{ __('Mein Preis netto') }}</th>
|
||||
<th class="text-right">{{ __('Mein Preis brutto') }}</th>
|
||||
<th class="text-right">{{ __('geordert') }}</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($user_promotion->promotion_admin->promotion_admin_products_active as $promotion_admin_product)
|
||||
<tr class="border-bottom">
|
||||
<td class="align-middle">
|
||||
<label class="custom-control custom-checkbox mt-2">
|
||||
{!! Form::checkbox('products_active['.$promotion_admin_product->id.']', 1, $promotion_admin_product->getPromotionUserProducts($user_promotion, 'active'),
|
||||
['class' => 'custom-control-input check-event-promotion-onchange', 'id'=>'product_check_'.$promotion_admin_product->id]) !!}
|
||||
<span class="custom-control-label"></span>
|
||||
</label>
|
||||
</td>
|
||||
<td class="align-middle">
|
||||
<div class="no-line-break input-group-min-w">
|
||||
<div class="input-group d-inline-flex w-auto">
|
||||
<span class="input-group-prepend">
|
||||
<button type="button" class="btn btn-secondary icon-btn md-btn-extra remove-product-promotion" data-product-id="{{ $promotion_admin_product->id }}">-</button>
|
||||
</span>
|
||||
<input type="text" class="form-control text-center input-extra input-event-promotion-onchange"
|
||||
name="products_qty[{{ $promotion_admin_product->id }}]"
|
||||
id="product_qty_{{ $promotion_admin_product->id }}" data-product-id="{{ $promotion_admin_product->id }}"
|
||||
value="{{ $promotion_admin_product->getPromotionUserProducts($user_promotion, 'open_items') }}">
|
||||
<input type="hidden" name="products_user[{{ $promotion_admin_product->id }}]" value="{{ $promotion_admin_product->getPromotionUserProducts($user_promotion, 'id') }}">
|
||||
<span class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary icon-btn md-btn-extra add-product-promotion" data-product-id="{{ $promotion_admin_product->id }}">+</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="px-3 py-2 align-middle">
|
||||
<div class="media align-items-center">
|
||||
@if ($promotion_admin_product->product)
|
||||
@if ($promotion_admin_product->product->images)
|
||||
@if ($image = $promotion_admin_product->product->images->first())
|
||||
<img src="{{ route('product_image', [$image->slug]) }}"
|
||||
class="d-block ui-w-80 mr-4" alt>
|
||||
@endif
|
||||
@endif
|
||||
<div class="media-body">
|
||||
<a href="{{ route('admin_product_edit', [$promotion_admin_product->product->id]) }}"
|
||||
class="d-block">{{ $promotion_admin_product->product->name }}
|
||||
<span
|
||||
class="text-muted">#{{ $promotion_admin_product->product->number }}</span></a>
|
||||
<small>
|
||||
<span class="text-muted">Inhalt: </span>
|
||||
{{ $promotion_admin_product->product->contents }}<br>
|
||||
<span class="text-muted">Gewicht: </span>
|
||||
{{ $promotion_admin_product->product->weight }} g<br>
|
||||
</small>
|
||||
<a href="" class="" data-modal="modal-lg" data-toggle="modal" data-target="#modals-load-content"
|
||||
data-id="{{ $promotion_admin_product->product->id }}"
|
||||
data-route="{{ route('modal_load') }}"
|
||||
data-action="user-order-show-product" data-view="customer">
|
||||
<div class=""><i class="ion ion-md-eye"></i></div></a>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</td>
|
||||
<td class="align-middle px-3 py-2 nowrap text-right" style="">
|
||||
{{ $promotion_admin_product->getFormattedPriceWith(true) }} €
|
||||
</td>
|
||||
<td class="align-middle px-3 py-2 text-right" style="">
|
||||
{{ $promotion_admin_product->getFormattedPriceWith(false) }} €
|
||||
</td>
|
||||
<td class="align-middle px-3 py-2 text-right" style="">
|
||||
{{ $promotion_admin_product->getPromotionUserProducts($user_promotion, 'sell_items') }}
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<hr class="m-0">
|
||||
<div class="card-body" id="holder_html_view_cart">
|
||||
@include('user.promotion.cart', ['user_promotion_cart'=> $user_promotion_cart, 'checkPaymentCredit' => $checkPaymentCredit] )
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="application/javascript">
|
||||
$(document).ready(function() {
|
||||
$.extend($.validator.messages, {
|
||||
required: "Dieses Feld ist ein Pflichtfeld.",
|
||||
maxlength: $.validator.format("Gib bitte maximal {0} Zeichen ein."),
|
||||
minlength: $.validator.format("Gib bitte mindestens {0} Zeichen ein."),
|
||||
rangelength: $.validator.format("Gib bitte mindestens {0} und maximal {1} Zeichen ein."),
|
||||
email: "Gib bitte eine gültige E-Mail Adresse ein.",
|
||||
url: "Gib bitte eine gültige URL ein.",
|
||||
date: "Bitte gib ein gültiges Datum ein.",
|
||||
number: "Gib bitte eine Nummer ein.",
|
||||
digits: "Gib bitte nur Ziffern ein.",
|
||||
equalTo: "Bitte denselben Wert wiederholen.",
|
||||
range: $.validator.format("Gib bitte einen Wert zwischen {0} und {1} ein."),
|
||||
max: $.validator.format("Gib bitte einen Wert kleiner oder gleich {0} ein."),
|
||||
min: $.validator.format("Gib bitte einen Wert größer oder gleich {0} ein."),
|
||||
creditcard: "Gib bitte eine gültige Kreditkarten-Nummer ein."
|
||||
});
|
||||
// Set up validator
|
||||
var message = 'Default error message';
|
||||
$('#user-promotion-form-validations').validate({
|
||||
rules: {
|
||||
'user_promotion_url': {
|
||||
required: true,
|
||||
remote: {
|
||||
url: "{{ route('user_promotion_load') }}",
|
||||
type: "post",
|
||||
data: {
|
||||
user_promotion_url: function() {
|
||||
return $(
|
||||
'#user-promotion-form-validations :input[name="user_promotion_url"]'
|
||||
).val();
|
||||
},
|
||||
action: 'validate_url'
|
||||
},
|
||||
encode: true,
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
dataFilter: function(response) {
|
||||
response = $.parseJSON(response);
|
||||
console.log(response);
|
||||
$('#user_promotion_url_success').hide();
|
||||
$('#user_promotion_url_error').hide();
|
||||
if (response.success === true) {
|
||||
$('#user_promotion_url_success').show();
|
||||
$('#preview_user_promotion_url').val(response
|
||||
.preview_user_promotion_url);
|
||||
return true;
|
||||
} else {
|
||||
$('#user_promotion_url_error').show();
|
||||
message = response.errors.user_promotion_url;
|
||||
$('#preview_user_promotion_url').val('');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
errorPlacement: function errorPlacement(error, element) {
|
||||
$(element).parents('.form-group').find('.input-group').after(
|
||||
error.addClass('invalid-feedback d-block font-weight-bold')
|
||||
)
|
||||
},
|
||||
highlight: function(element) {
|
||||
if($(element).attr('required')){
|
||||
$(element).parent().find('button').removeClass('btn-success');
|
||||
$(element).parent().find('button').addClass('btn-danger');
|
||||
$(element).parent().find('button i').removeClass('fa-check');
|
||||
$(element).parent().find('button i').addClass('fa-times');
|
||||
$(element).removeClass('is-valid');
|
||||
$(element).addClass('is-invalid');
|
||||
}
|
||||
},
|
||||
unhighlight: function(element) {
|
||||
if($(element).attr('required')){
|
||||
$(element).removeClass('is-invalid');
|
||||
$(element).addClass('is-valid');
|
||||
$(element).parent().find('button').removeClass('btn-danger');
|
||||
$(element).parent().find('button').addClass('btn-success');
|
||||
$(element).parent().find('button i').removeClass('fa-times');
|
||||
$(element).parent().find('button i').addClass('fa-check');
|
||||
$(element).parents('.form-group').find('.is-invalid').removeClass('is-invalid');
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
messages: {
|
||||
required: "{{ __('This field is required.') }}",
|
||||
user_promotion_url: {
|
||||
email: "{{ __('Please enter a valid email address.') }}",
|
||||
remote: function() {
|
||||
return message;
|
||||
}
|
||||
},
|
||||
},
|
||||
onkeyup: function(element) {
|
||||
$(element).valid()
|
||||
},
|
||||
});
|
||||
|
||||
var iqPromotionCart = IqPromotionCart.init();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@section('scripts')
|
||||
<script src="{{ asset('/js/iq-promotion-cart.js') }}?v=2{{ get_file_last_time('/js/iq-promotion-cart.js') }}"></script>
|
||||
@endsection
|
||||
199
resources/views/user/promotion/index.blade.php
Normal file
199
resources/views/user/promotion/index.blade.php
Normal file
|
|
@ -0,0 +1,199 @@
|
|||
@extends('layouts.layout-2')
|
||||
|
||||
@section('content')
|
||||
<h4 class="font-weight-bold py-2 mb-2 d-flex justify-content-between align-items-center w-100 ">
|
||||
<div>{{ __('navigation.my_promotions') }} / {{ __('navigation.overview') }}</div>
|
||||
<button type="button" class="btn btn-secondary rounded-pill d-block float-right" data-toggle="modal" data-target="#modals-new-user-promotion">
|
||||
<span class="ion ion-md-add"></span> Neue Promotion anlegen
|
||||
</button>
|
||||
</h4>
|
||||
|
||||
<p> Text ...</p>
|
||||
|
||||
<div class="card mb-3">
|
||||
<h5 class="card-header bg-white">
|
||||
<a href="#" class="" data-toggle="collapse" data-target="#collapsePromotionFaq" aria-expanded="false" aria-controls="collapsePromotionFaq">
|
||||
<i class="fa fa-caret-expand"></i> {{ __('Und so geht\'s / FAQs') }}
|
||||
</a>
|
||||
</h5>
|
||||
<div class="collapse" id="collapsePromotionFaq">
|
||||
<div class="px-4 py-3">
|
||||
<p>Text ...</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
|
||||
@foreach($values as $value)
|
||||
|
||||
<div class="card mb-4">
|
||||
<div class="card-body d-flex justify-content-between align-items-start pb-2">
|
||||
<div>
|
||||
<a href="{{route('user_promotion_detail', [$value->id])}}" class="text-body text-big font-weight-semibold">{{$value->name}}</a>
|
||||
</div>
|
||||
@if($value->canDelete())
|
||||
<div class="btn-group project-actions">
|
||||
<a href="{{ route('user_promotion_delete', [$value->id, 'user_promotion']) }}"
|
||||
class=" dropdown-item" onclick="return confirm('Promotion wirklich löschen?');">
|
||||
<span class="ion ion-md-trash text-danger"></span>
|
||||
</a>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
<div class="progress rounded-0" style="height: 2px;">
|
||||
<div class="progress-bar" style="width: 100%;"></div>
|
||||
</div>
|
||||
<div class="card-body pt-3 pb-1">
|
||||
{{$value->description}}
|
||||
<hr>
|
||||
</div>
|
||||
<div class="card-body pt-0">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="text-muted small">Promotion Produkte</div>
|
||||
<div class="font-weight-bold">{{$value->promotion_admin->promotion_admin_products_active->count()}}
|
||||
{{ formatPlural($value->promotion_admin->promotion_admin_products_active->count(), 'Sorte', 'n') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<div class="text-muted small">aktive Produkte</div>
|
||||
<div class="font-weight-bold">{{$value->promotion_user_products_active->count()}}
|
||||
{{ formatPlural($value->promotion_user_products_active->count(), 'Sorte', 'n') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<div class="text-muted small">geplant Produkte</div>
|
||||
<div class="font-weight-bold">{{$value->getCountOpenItems()}} Stk.</div>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<div class="text-muted small">geordert Produkte</div>
|
||||
<div class="font-weight-bold">{{$value->getCountSellItems()}} Stk.</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="row mt-3">
|
||||
<div class="col">
|
||||
<div class="text-muted small">Promotion aktiv</div>
|
||||
<div class="font-weight-bold">{!! get_active_badge($value->active) !!}</div>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<div class="text-muted small">persönliche Abholung</div>
|
||||
<div class="font-weight-bold">{!! get_active_badge($value->pick_up) !!}</div>
|
||||
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="text-muted small">Potentielle Kosten</div>
|
||||
@php($user_promotion_cart = $value->calculateCart())
|
||||
<div class="font-weight-bold">{{ formatNumber($user_promotion_cart['price']) }} € brutto</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="text-muted small">Kosten bisher</div>
|
||||
@php($user_promotion_sell = $value->calculateSell())
|
||||
<div class="font-weight-bold">{{ formatNumber($user_promotion_sell['price']) }} € brutto</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<hr class="m-0">
|
||||
<div class="card-body py-3">
|
||||
<div class="form-row">
|
||||
<div class="form-group col-10 mb-0">
|
||||
<label class="form-label">Domain / URL für Deine Promotion</label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-prepend">
|
||||
<button class="btn btn-sm btn-secondary" type="button" title="Kopiert!" data-clipboard-demo data-clipboard-target="#promotion_link_{{$value->id}}"><i class="ion ion-ios-copy"></i> Domain kopieren</button>
|
||||
</span>
|
||||
<input type="text" class="form-control" name="promotion_link_{{$value->id}}" value="{{ $value->getUrlPreview() }}" id="promotion_link_{{$value->id}}" placeholder="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-2 mb-0">
|
||||
<label class="form-label"> </label>
|
||||
<div>
|
||||
<a class="btn btn-sm btn-outline-primary mt-1" href="{{ $value->getUrlPreview() }}" target="_blank"><i class="ion ion-ios-share-alt"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@php($checkPaymentCredit = $value->checkPaymentCredit())
|
||||
@if($checkPaymentCredit === 'empty')
|
||||
<h6 class="alert badge-danger mt-3 py-2">Du hast kein Guthaben aus Deinem Konto auf, lade Dein Konto auf, bis dahin ist die Promotion gestoppt.</h6>
|
||||
@endif
|
||||
@if($checkPaymentCredit === 'okay')
|
||||
<h6 class="alert badge-success mt-3 py-2">Dein Guthaben ist für diese Promotion</h6>
|
||||
@endif
|
||||
@if($checkPaymentCredit === 'not')
|
||||
<h6 class="alert badge-danger mt-3 py-2">Dein Guthaben ist nicht ausreichend für diese Promotion, lade Dein Konto auf, bis dahin ist die Promotion gestoppt.</h6>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<hr class="m-0">
|
||||
<div class="card-body py-3">
|
||||
<div class="d-flex flex-wrap">
|
||||
<a href="{{route('user_promotion_detail', [$value->id])}}" class="btn btn-secondary mr-2 mb-2"><i class="ion ion-ios-cog"></i> Bearbeiten</a>
|
||||
{{--
|
||||
<a href="#" class="btn btn-secondary mr-2 mb-2"><i class="ion ion-md-basket"></i> Promotions ansehen (n.b!)</a>
|
||||
<a href="#" class="btn btn-secondary mr-2 mb-2"><i class="ion ion-md-basket"></i> Bestellung ansehen (n.b!)</a>
|
||||
--}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!-- Modal template -->
|
||||
<div class="modal fade" id="modals-new-user-promotion">
|
||||
<div class="modal-dialog">
|
||||
<form class="modal-content" action="{{route('user_promotion_detail', ['new'])}}" method="post">
|
||||
@csrf
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">Neue Promotion anlegen</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-md-12">
|
||||
<label for="country_ids" class="form-label">Wähle die Art deiner Promotion</label>
|
||||
<select class="selectpicker" name="promotion_admin_id" id="promotion_admin_id" data-style="btn-light" data-live-search="true" required>
|
||||
{!! HTMLHelper::getAnyOptions(null, \App\Models\PromotionAdmin::getActiveAdminPromotionsAsArray(), true) !!}
|
||||
</select>
|
||||
</div>
|
||||
</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" name="action" value="new-user-promotion">{{__('anlegen')}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$( document ).ready(function() {
|
||||
$( document ).ready(function() {
|
||||
var clipboardDemos = new ClipboardJS('[data-clipboard-demo]');
|
||||
clipboardDemos.on('success', function (e) {
|
||||
e.clearSelection();
|
||||
$(e.trigger).tooltip('enable').tooltip('show');
|
||||
});
|
||||
clipboardDemos.on('error', function (e) {
|
||||
console.error('Action:', e.action);
|
||||
console.error('Trigger:', e.trigger);
|
||||
});
|
||||
|
||||
$('button[data-clipboard-demo]').on('mouseout', function () {
|
||||
$(this).tooltip('disable');
|
||||
})
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
Loading…
Add table
Add a link
Reference in a new issue