mivita/resources/views/admin/incentive/_form.blade.php
2026-04-10 17:15:27 +02:00

214 lines
10 KiB
PHP

@if ($errors->any())
<div class="alert alert-danger">
<ul class="mb-0">
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
{{-- ===== KONFIGURATION ===== --}}
<div class="card mb-4">
<div class="card-header">
<i class="ion ion-md-settings mr-1"></i>
<strong>{{ __('incentive.configuration') }}</strong>
</div>
<div class="card-body">
<div class="form-row">
<div class="form-group col-md-8">
<label for="name">{{ __('incentive.name') }} *</label>
<input type="text" class="form-control" id="name" name="name"
value="{{ old('name', $incentive->name ?? '') }}" required>
<small class="form-text text-muted">{{ __('incentive.name_help') }}</small>
</div>
<div class="form-group col-md-4">
<label for="status">{{ __('incentive.status') }} *</label>
<select class="custom-select" id="status" name="status" required>
@foreach (\App\Models\Incentive::$statusTypes as $key => $label)
<option value="{{ $key }}" @if (old('status', $incentive->status ?? 0) == $key) selected @endif>
{{ __('incentive.status_' . $label) }}
</option>
@endforeach
</select>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-4">
<label for="qualification_start">{{ __('incentive.qualification_start') }} *</label>
{!! Form::text(
'qualification_start',
old(
'qualification_start',
isset($incentive->qualification_start) ? $incentive->qualification_start->format('d.m.Y') : '',
),
[
'class' => 'form-control datepicker-base',
'required' => true,
],
) !!}
</div>
<div class="form-group col-md-4">
<label for="qualification_end">{{ __('incentive.qualification_end') }} *</label>
{!! Form::text(
'qualification_end',
old(
'qualification_end',
isset($incentive->qualification_end) ? $incentive->qualification_end->format('d.m.Y') : '',
),
[
'class' => 'form-control datepicker-base',
'required' => true,
],
) !!}
</div>
<div class="form-group col-md-4">
<label for="calculation_end">{{ __('incentive.calculation_end') }} *</label>
{!! Form::text(
'calculation_end',
old('calculation_end', isset($incentive->calculation_end) ? $incentive->calculation_end->format('d.m.Y') : ''),
[
'class' => 'form-control datepicker-base',
'required' => true,
],
) !!}
</div>
</div>
<div class="form-row">
<div class="form-group col-md-4">
<label for="points_partner_onetime">{{ __('incentive.points_partner_onetime') }} *</label>
<input type="number" class="form-control" id="points_partner_onetime" name="points_partner_onetime"
value="{{ old('points_partner_onetime', $incentive->points_partner_onetime ?? 600) }}"
min="0" required>
</div>
<div class="form-group col-md-4">
<label for="points_abo_onetime">{{ __('incentive.points_abo_onetime') }} *</label>
<input type="number" class="form-control" id="points_abo_onetime" name="points_abo_onetime"
value="{{ old('points_abo_onetime', $incentive->points_abo_onetime ?? 400) }}" min="0"
required>
</div>
<div class="form-group col-md-4">
<label for="max_winners">{{ __('incentive.max_winners') }} *</label>
<input type="number" class="form-control" id="max_winners" name="max_winners"
value="{{ old('max_winners', $incentive->max_winners ?? 30) }}" min="1" required>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6">
<label for="min_direct_partners">{{ __('incentive.min_direct_partners') }} *</label>
<input type="number" class="form-control" id="min_direct_partners" name="min_direct_partners"
value="{{ old('min_direct_partners', $incentive->min_direct_partners ?? 4) }}" min="0"
required>
</div>
<div class="form-group col-md-6">
<label for="min_customer_abos">{{ __('incentive.min_customer_abos') }} *</label>
<input type="number" class="form-control" id="min_customer_abos" name="min_customer_abos"
value="{{ old('min_customer_abos', $incentive->min_customer_abos ?? 6) }}" min="0" required>
</div>
</div>
<div class="form-group mb-0">
<label for="image">{{ __('incentive.image') }}</label>
<input type="text" class="form-control" id="image" name="image"
value="{{ old('image', $incentive->image ?? '') }}">
<small class="form-text text-muted">{{ __('incentive.image_help') }}</small>
</div>
</div>
</div>
{{-- ===== INHALTE: DEUTSCH (Standard) ===== --}}
<div class="card mb-4">
<div class="card-header bg-primary text-white">
<i class="ion ion-md-flag mr-1"></i>
<strong>{{ __('incentive.content_lang_de') }}</strong>
<span class="badge badge-light ml-1">{{ __('incentive.default_language') }}</span>
</div>
<div class="card-body">
<div class="form-group">
<label for="subtitle">{{ __('incentive.subtitle') }}</label>
<input type="text" class="form-control" id="subtitle" name="subtitle"
value="{{ old('subtitle', $incentive->subtitle ?? '') }}"
placeholder="{{ __('incentive.subtitle_placeholder') }}">
<small class="form-text text-muted">{{ __('incentive.subtitle_help') }}</small>
</div>
<div class="form-group">
<label for="description">
<i class="ion ion-md-text mr-1"></i>
{{ __('incentive.description') }}
</label>
<textarea class="form-control summernote-small" id="description" name="description" rows="6">{{ old('description', $incentive->description ?? '') }}</textarea>
<small class="form-text text-muted">{{ __('incentive.description_help') }}</small>
</div>
<div class="form-group mb-0">
<label for="terms">
<i class="ion ion-md-document mr-1"></i>
{{ __('incentive.terms') }}
</label>
<textarea class="form-control summernote-small" id="terms" name="terms" rows="8">{{ old('terms', $incentive->terms ?? '') }}</textarea>
<small class="form-text text-muted">{{ __('incentive.terms_help') }}</small>
</div>
</div>
</div>
{{-- ===== INHALTE: WEITERE SPRACHEN ===== --}}
@foreach ($languages as $locale => $localeData)
@if ($locale !== 'de')
<div class="card mb-4">
<div class="card-header">
<i class="ion ion-md-flag mr-1"></i>
<strong>{{ $localeData['native'] }}</strong>
<span class="badge badge-secondary ml-1">{{ strtoupper($locale) }}</span>
<small class="text-muted ml-2">{{ __('incentive.lang_fallback_hint') }}</small>
</div>
<div class="card-body">
@php $existingIncentive = $incentive ?? null; @endphp
<div class="form-group">
<label for="trans_name_{{ $locale }}">{{ __('incentive.name') }}</label>
<input type="text" class="form-control" id="trans_name_{{ $locale }}"
name="trans_name_{{ $locale }}"
value="{{ old('trans_name_' . $locale, $existingIncentive ? $existingIncentive->getTrans('name', $locale) : '') }}"
placeholder="{{ $existingIncentive->name ?? '' }}">
</div>
<div class="form-group">
<label for="trans_subtitle_{{ $locale }}">{{ __('incentive.subtitle') }}</label>
<input type="text" class="form-control" id="trans_subtitle_{{ $locale }}"
name="trans_subtitle_{{ $locale }}"
value="{{ old('trans_subtitle_' . $locale, $existingIncentive ? $existingIncentive->getTrans('subtitle', $locale) : '') }}"
placeholder="{{ $existingIncentive->subtitle ?? __('incentive.subtitle_placeholder') }}">
</div>
<div class="form-group">
<label for="trans_description_{{ $locale }}">
<i class="ion ion-md-text mr-1"></i>
{{ __('incentive.description') }}
</label>
<textarea class="form-control summernote-small" id="trans_description_{{ $locale }}"
name="trans_description_{{ $locale }}" rows="6">{{ old('trans_description_' . $locale, $existingIncentive ? $existingIncentive->getTrans('description', $locale) : '') }}</textarea>
</div>
<div class="form-group mb-0">
<label for="trans_terms_{{ $locale }}">
<i class="ion ion-md-document mr-1"></i>
{{ __('incentive.terms') }}
</label>
<textarea class="form-control summernote-small" id="trans_terms_{{ $locale }}" name="trans_terms_{{ $locale }}"
rows="8">{{ old('trans_terms_' . $locale, $existingIncentive ? $existingIncentive->getTrans('terms', $locale) : '') }}</textarea>
</div>
</div>
</div>
@endif
@endforeach
<hr class="mb-3">