@php use Illuminate\Support\Carbon; $wz = $page->weeztixConfig; $existing = $wz !== null ? [ 'coupon_guid' => $wz->coupon_guid, 'coupon_name' => $wz->coupon_name, 'code_prefix' => $wz->code_prefix, 'usage_count' => $wz->usage_count, ] : null; $credentialsEdit = ! $hasStoredCredentials || request()->query('credentials') === 'edit'; $oauthUrl = route('admin.pages.weeztix.oauth.redirect', ['page' => $page, 'wizard' => 1]); @endphp @extends('layouts.admin') @section('title', __('Weeztix') . ' — ' . $page->title) @section('mobile_title', __('Weeztix')) @section('content')
← {{ __('Terug naar pagina') }}

{{ __('Weeztix') }}

{{ __('Pagina:') }} {{ $page->title }}

@include('admin.pages._save_flash') @if ($errors->any()) @endif @if (! $showWizard && $wz !== null) {{-- Summary (read-only): change only via wizard --}} @if ($wz->is_connected && ($wz->company_guid === null || $wz->company_guid === ''))

{{ __('Bedrijf nog niet vastgelegd') }}

{{ __('Start de wizard en verbind opnieuw met Weeztix zodat het bedrijf automatisch wordt gekoppeld.') }}

@endif
{{ __('Instellingen wijzigen (wizard)') }}
@csrf @method('DELETE')

{{ __('Huidige configuratie') }}

{{ __('OAuth-gegevens zijn opgeslagen maar worden om veiligheidsredenen niet getoond.') }}

{{ __('Verbinding') }}
@if ($wz->is_connected) {{ __('Verbonden') }} @else {{ __('Niet verbonden') }} @endif
@if ($wz->is_connected && $wz->token_expires_at)
{{ __('Toegangstoken tot') }}
{{ $wz->token_expires_at->timezone(config('app.timezone'))->format('Y-m-d H:i') }}
@endif
{{ __('Callback-URL (in Weeztix-dashboard)') }}
{{ route('admin.weeztix.callback', absolute: true) }}
{{ __('Coupon') }}
{{ $wz->coupon_name ?: ($wz->coupon_guid ? $wz->coupon_guid : '—') }}
{{ __('Codevoorvoegsel') }}
{{ $wz->code_prefix ?? '—' }}
{{ __('Gebruik per code') }}
{{ (int) ($wz->usage_count ?? 1) }}
@else {{-- Wizard --}}
@if ($wz !== null) {{ __('Annuleren en terug naar overzicht') }} @endif
@foreach ([1 => __('OAuth'), 2 => __('Verbinden'), 3 => __('Coupon')] as $num => $label) @php $active = $wizardStep === $num; $done = $wizardStep > $num; @endphp {{ $num }} {{ $label }} @if ($num < 3) @endif @endforeach
@if ($wizardStep === 1)

{{ __('Stap 1: OAuth-client') }}

@if ($hasStoredCredentials && ! $credentialsEdit)

{{ __('Wil je Client ID, client secret of de callback-URI in Weeztix wijzigen? De callback-URL van deze applicatie is hieronder; die moet exact overeenkomen in het Weeztix-dashboard.') }}

{{ route('admin.weeztix.callback', absolute: true) }}

@else

{{ __('Vul de OAuth-client uit het Weeztix-dashboard in. Zet de redirect-URI exact op de onderstaande URL.') }}

{{ route('admin.weeztix.callback', absolute: true) }}

@csrf @method('PUT')
@if ($wz !== null)

{{ __('Laat velden leeg om opgeslagen waarden te behouden.') }}

@endif
@endif
@endif @if ($wizardStep === 2)

{{ __('Stap 2: Verbinden met Weeztix') }}

{{ __('Log in bij Weeztix en keur de toegang goed. Daarna ga je automatisch verder naar de coupon.') }}

{{ route('admin.weeztix.callback', absolute: true) }}

@if ($wz !== null && $wz->is_connected)
{{ __('Je bent al verbonden. Ga door naar de coupon.') }}
{{ __('Naar stap 3: coupon') }} @else {{ __('Verbind met Weeztix') }} @endif

{{ __('← Terug naar stap 1') }}

@endif @if ($wizardStep === 3)

{{ __('Stap 3: Coupon en codes') }}

{{ __('Kies een bestaande coupon in Weeztix en stel het voorvoegsel en aantal gebruiken per code in.') }}

@csrf @method('PUT')
{{ __('Terug naar stap 2') }}
@endif
@endif
@endsection