feat: Phase 2 - page CRUD, subscriber management, user management
This commit is contained in:
87
resources/views/admin/subscribers/index.blade.php
Normal file
87
resources/views/admin/subscribers/index.blade.php
Normal file
@@ -0,0 +1,87 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title', __('Subscribers') . ' — ' . $page->title)
|
||||
|
||||
@section('mobile_title', __('Subscribers'))
|
||||
|
||||
@section('content')
|
||||
<div class="mx-auto max-w-7xl">
|
||||
<div class="mb-8">
|
||||
<a href="{{ route('admin.pages.index') }}" class="text-sm font-medium text-indigo-600 hover:text-indigo-500">← {{ __('Back to pages') }}</a>
|
||||
<h1 class="mt-4 text-2xl font-semibold text-slate-900">{{ __('Subscribers') }}</h1>
|
||||
<p class="mt-1 text-sm text-slate-600">{{ $page->title }}</p>
|
||||
</div>
|
||||
|
||||
<div class="mb-6 flex flex-col gap-4 sm:flex-row sm:items-end sm:justify-between">
|
||||
<form method="get" action="{{ route('admin.pages.subscribers.index', $page) }}" class="flex flex-1 flex-col gap-2 sm:max-w-md">
|
||||
<label for="search" class="text-sm font-medium text-slate-700">{{ __('Search by name or email') }}</label>
|
||||
<div class="flex gap-2">
|
||||
<input type="search" name="search" id="search" value="{{ request('search') }}"
|
||||
class="block w-full rounded-lg border-slate-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm" placeholder="{{ __('Search…') }}" />
|
||||
<button type="submit" class="rounded-lg bg-slate-800 px-4 py-2 text-sm font-semibold text-white hover:bg-slate-700">{{ __('Filter') }}</button>
|
||||
</div>
|
||||
@error('search')
|
||||
<p class="text-sm text-red-600">{{ $message }}</p>
|
||||
@enderror
|
||||
</form>
|
||||
<a href="{{ route('admin.pages.subscribers.export', $page) }}{{ request()->filled('search') ? '?'.http_build_query(['search' => request('search')]) : '' }}"
|
||||
class="inline-flex items-center justify-center rounded-lg border border-slate-300 bg-white px-4 py-2 text-sm font-semibold text-slate-700 shadow-sm hover:bg-slate-50">
|
||||
{{ __('Export CSV') }}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="overflow-hidden rounded-xl border border-slate-200 bg-white shadow-sm">
|
||||
<div class="overflow-x-auto">
|
||||
<table class="min-w-full divide-y divide-slate-200 text-left text-sm">
|
||||
<thead class="bg-slate-50">
|
||||
<tr>
|
||||
<th class="px-4 py-3 font-semibold text-slate-700">{{ __('First name') }}</th>
|
||||
<th class="px-4 py-3 font-semibold text-slate-700">{{ __('Last name') }}</th>
|
||||
<th class="px-4 py-3 font-semibold text-slate-700">{{ __('Email') }}</th>
|
||||
@if ($page->phone_enabled)
|
||||
<th class="px-4 py-3 font-semibold text-slate-700">{{ __('Phone') }}</th>
|
||||
@endif
|
||||
<th class="px-4 py-3 font-semibold text-slate-700">{{ __('Registered at') }}</th>
|
||||
<th class="px-4 py-3 font-semibold text-slate-700">{{ __('Mailwizz') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-slate-100">
|
||||
@forelse ($subscribers as $subscriber)
|
||||
<tr class="hover:bg-slate-50/80">
|
||||
<td class="px-4 py-3 text-slate-900">{{ $subscriber->first_name }}</td>
|
||||
<td class="px-4 py-3 text-slate-900">{{ $subscriber->last_name }}</td>
|
||||
<td class="px-4 py-3 text-slate-600">{{ $subscriber->email }}</td>
|
||||
@if ($page->phone_enabled)
|
||||
<td class="px-4 py-3 text-slate-600">{{ $subscriber->phone ?? '—' }}</td>
|
||||
@endif
|
||||
<td class="whitespace-nowrap px-4 py-3 text-slate-600">{{ $subscriber->created_at->timezone(config('app.timezone'))->format('Y-m-d H:i') }}</td>
|
||||
<td class="px-4 py-3">
|
||||
@if ($subscriber->synced_to_mailwizz)
|
||||
<span class="inline-flex h-8 w-8 items-center justify-center rounded-full bg-emerald-100 text-emerald-700" title="{{ __('Synced') }}">
|
||||
<svg class="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"/></svg>
|
||||
</span>
|
||||
@else
|
||||
<span class="inline-flex h-8 w-8 items-center justify-center rounded-full bg-slate-100 text-slate-500" title="{{ __('Not synced') }}">
|
||||
<svg class="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/></svg>
|
||||
</span>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="{{ $page->phone_enabled ? 6 : 5 }}" class="px-4 py-12 text-center text-slate-500">
|
||||
{{ __('No subscribers match your criteria.') }}
|
||||
</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@if ($subscribers->hasPages())
|
||||
<div class="border-t border-slate-200 px-4 py-3">
|
||||
{{ $subscribers->links() }}
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
Reference in New Issue
Block a user