Files
preregister/resources/views/admin/pages/_integration_badges.blade.php
bert.hausmans 89931b817d feat(admin): Weeztix setup wizard, integration status badges
- Summary view when Weeztix is configured; edits only via 3-step wizard
- Step 1: reuse or replace OAuth client ID/secret; callback URL shown
- Step 2: OAuth connect (resume wizard after callback when started from wizard)
- Step 3: coupon, prefix, usage; finishing exits wizard
- PreregistrationPage: mailwizz/weeztix integration status helpers
- Pages index: Integrations column with MW/WZ badges; edit page: status cards

Made-with: Cursor
2026-04-05 11:12:10 +02:00

56 lines
2.0 KiB
PHP

@php
$only = $only ?? null;
$integrationBadgeClass = $integrationBadgeClass ?? '';
if (! in_array($only, [null, 'mailwizz', 'weeztix'], true)) {
$only = null;
}
$mailwizz = $page->mailwizzIntegrationStatus();
$weeztix = $page->weeztixIntegrationStatus();
$mailwizzClasses = match ($mailwizz) {
'ready' => 'border-emerald-200 bg-emerald-50 text-emerald-900',
'partial' => 'border-amber-200 bg-amber-50 text-amber-950',
default => 'border-slate-200 bg-slate-50 text-slate-600',
};
$mailwizzLabel = match ($mailwizz) {
'ready' => __('Ready'),
'partial' => __('Incomplete'),
default => __('Off'),
};
$weeztixClasses = match ($weeztix) {
'ready' => 'border-emerald-200 bg-emerald-50 text-emerald-900',
'connected' => 'border-sky-200 bg-sky-50 text-sky-950',
'credentials' => 'border-amber-200 bg-amber-50 text-amber-950',
default => 'border-slate-200 bg-slate-50 text-slate-600',
};
$weeztixLabel = match ($weeztix) {
'ready' => __('Ready'),
'connected' => __('Connected'),
'credentials' => __('OAuth only'),
default => __('Off'),
};
$showMailwizz = $only === null || $only === 'mailwizz';
$showWeeztix = $only === null || $only === 'weeztix';
@endphp
<div class="flex flex-wrap items-center gap-1.5 {{ $integrationBadgeClass }}">
@if ($showMailwizz)
<span
class="inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium {{ $mailwizzClasses }}"
title="{{ __('Mailwizz: :state', ['state' => $mailwizzLabel]) }}"
>
{{ __('MW') }} · {{ $mailwizzLabel }}
</span>
@endif
@if ($showWeeztix)
<span
class="inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium {{ $weeztixClasses }}"
title="{{ __('Weeztix: :state', ['state' => $weeztixLabel]) }}"
>
{{ __('WZ') }} · {{ $weeztixLabel }}
</span>
@endif
</div>