mivita/resources/views/admin/incentive/_form.blade.php
Kevin 3341c929eb Incentive (E1): "Nur fuer VIP sichtbar" und Ranglisten-Seite mit Teilnahme-Block oben
Haken vip_only am Incentive: aktives Incentive erscheint dann nur fuer
VIP-Konten in Sidenav, Dashboard, Teaser, Rangliste und Details, andere
Berater bekommen 404; das Tracking laeuft fuer alle weiter. Seeder setzt den
Haken fuer die Abstimmung der Recruiting Challenge.

Ranglisten-Seite: solange die Teilnahme nicht bestaetigt ist, steht der
Teilnahme-Block mit Praemien-Chips, Checkbox, Button und aufklappbaren
Bedingungen ganz oben, darunter Trennlinie, Titel, Untertitel, Bild,
Beschreibung und die Info-Kacheln. Ueberschriften vergroessert, Abo-Bloecke
nur wenn Abos zaehlen.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-22 11:11:33 +00:00

261 lines
13 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-group">
<div class="custom-control custom-checkbox">
<input type="hidden" name="vip_only" value="0">
<input type="checkbox" class="custom-control-input" id="vip_only" name="vip_only" value="1"
@if (old('vip_only', isset($incentive) ? (int) $incentive->vip_only : 0)) checked @endif>
<label class="custom-control-label" for="vip_only">{{ __('incentive.vip_only') }}</label>
</div>
<small class="form-text text-muted">{{ __('incentive.vip_only_help') }}</small>
</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>
{{-- ===== PRAEMIE / AUSZAHLUNG (Recruiting-Challenge) ===== --}}
<div class="card mb-4">
<div class="card-header">
<i class="ion ion-md-cash mr-1"></i>
<strong>{{ __('incentive.payout_section') }}</strong>
</div>
<div class="card-body">
<p class="text-muted small">{{ __('incentive.payout_section_help') }}</p>
<div class="form-row">
<div class="form-group col-md-3">
<label for="amount_per_partner">{{ __('incentive.amount_per_partner') }}</label>
<input type="number" step="0.01" min="0" class="form-control" id="amount_per_partner"
name="amount_per_partner"
value="{{ old('amount_per_partner', isset($incentive->amount_per_partner) ? number_format((float) $incentive->amount_per_partner, 2, '.', '') : '') }}">
<small class="form-text text-muted">{{ __('incentive.amount_per_partner_help') }}</small>
</div>
@for ($bonusRank = 1; $bonusRank <= \App\Models\Incentive::RANK_BONUS_SLOTS; $bonusRank++)
<div class="form-group col-md-3">
<label for="bonus_rank_{{ $bonusRank }}">{{ __('incentive.bonus_rank', ['n' => $bonusRank]) }}</label>
<input type="number" step="0.01" min="0" class="form-control" id="bonus_rank_{{ $bonusRank }}"
name="bonus_rank_{{ $bonusRank }}"
value="{{ old('bonus_rank_' . $bonusRank, isset($incentive) && $incentive->{'bonus_rank_' . $bonusRank} !== null ? number_format((float) $incentive->{'bonus_rank_' . $bonusRank}, 2, '.', '') : '') }}">
</div>
@endfor
</div>
<div class="custom-control custom-checkbox">
<input type="hidden" name="include_sales_points" value="0">
<input type="checkbox" class="custom-control-input" id="include_sales_points" name="include_sales_points"
value="1" @if (old('include_sales_points', isset($incentive) ? (int) $incentive->includesSalesPoints() : 1)) checked @endif>
<label class="custom-control-label" for="include_sales_points">{{ __('incentive.include_sales_points') }}</label>
</div>
<small class="form-text text-muted">{{ __('incentive.include_sales_points_help') }}</small>
</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">