This commit is contained in:
Martin Folkerts 2024-03-19 15:25:21 +01:00
parent 50aae2abc8
commit 7de3d6d527
22 changed files with 588 additions and 488 deletions

View file

@ -6,15 +6,16 @@
use App\Rules\DownloadDateRangeRule;
use Carbon\Carbon;
use Carbon\CarbonPeriod;
use Livewire\Attributes\Lazy;
use Livewire\Component;
use Livewire\WithPagination;
use Symfony\Component\Process\Process;
#[Lazy]
class DownloadManager extends Component
{
use WithPagination;
public $project;
public $formData;
@ -79,6 +80,11 @@ private function applySearch($query)
return $query;
}
public function placeholder()
{
return view('livewire.projects.download-manager-placeholder');
}
public function render()
{

View file

@ -4,9 +4,11 @@
use App\Models\Project;
use App\Models\ProjectMailing;
use Livewire\Attributes\Lazy;
use Livewire\Component;
use Livewire\WithPagination;
#[Lazy]
class MailingManager extends Component
{
use WithPagination;
@ -18,6 +20,8 @@ class MailingManager extends Component
];
public $search = '';
public $active_mailing = null;
public function mount(Project $project)
{
@ -52,13 +56,31 @@ private function resetFormData()
'recipients' => [],
];
}
private function applySearch($query)
{
if ($this->search) {
$query->where('subject', 'like', '%'.$this->search.'%');
}
return $query;
}
public function placeholder()
{
return view('livewire.projects.mailing-manager-placeholder');
}
public function render()
{
$query = $this->project
->mailings()
->orderBy('created_at', 'desc');
$query = $this->applySearch($query);
$mailings = $query->paginate(10, pageName: 'mailingPage');
return view('livewire.projects.mailing-manager', [
'mailings' => $this->project
->mailings()
->orderBy('created_at', 'desc')
->paginate(10, pageName: 'mailingPage'),
'mailings' => $mailings,
]);
}
}

View file

@ -4,9 +4,11 @@
use App\Jobs\ProjectMosiacGeneratorJob;
use App\Models\Project;
use Livewire\Attributes\Lazy;
use Livewire\Component;
use Livewire\WithPagination;
#[Lazy]
class MosaicManager extends Component
{
use WithPagination;
@ -25,8 +27,6 @@ public function mount(Project $project)
{
$this->path = $project->download_path;
}
public function saveMosaic()
{
$this->validate([
@ -82,6 +82,10 @@ public function update($property)
$this->resetPage('mosaicPage');
}
}
public function placeholder()
{
return view('livewire.projects.mosaic-manager-placeholder');
}
public function render()
{

View file

@ -6,9 +6,10 @@
use App\Models\Project;
use App\Models\ProjectReport;
use App\Rules\AllMosaicsPresentRule;
use Livewire\Attributes\Lazy;
use Livewire\Component;
use Livewire\WithPagination;
#[Lazy]
class ReportManager extends Component
{
use WithPagination;
@ -94,6 +95,11 @@ private function applySearch($query)
return $query;
}
public function placeholder()
{
return view('livewire.projects.report-manager-placeholder');
}
public function render()
{
$query = Project::find($this->project_id)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -5,7 +5,7 @@
"src": "resources/css/app.css"
},
"resources/js/alpine.js": {
"file": "assets/alpine-b920cb4b.js",
"file": "assets/alpine-306471eb.js",
"isDynamicEntry": true,
"src": "resources/js/alpine.js"
},
@ -13,7 +13,7 @@
"dynamicImports": [
"resources/js/alpine.js"
],
"file": "assets/app-fef3848d.js",
"file": "assets/app-3941bdf3.js",
"isEntry": true,
"src": "resources/js/app.js"
}

View file

@ -0,0 +1,58 @@
<div>
<div class="px-4 sm:px-6 lg:px-8">
<div class="sm:flex sm:flex-col sm:items-center">
<div class="w-full">
<h1 class="text-base font-semibold leading-6 text-gray-900">Downloads</h1>
<p class="mt-2 text-sm text-gray-700">
</p>
</div>
<div class="mt-4 sm:mt-0 sm:flex sm:justify-between w-full">
<x-search></x-search>
<x-button
class="block rounded-md bg-indigo-600 px-3 py-2 text-center text-sm font-semibold text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600">
Create Download
</x-button>
</div>
</div>
<div class="mt-8 flow-root">
<div class="overflow-x-auto sm:-mx-6 lg:-mx-8">
<div class="animate-pulse">
<div class="inline-block min-w-full py-2 align-middle">
<table class="min-w-full divide-y divide-gray-300">
<thead>
<tr>
<th scope="col"
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6 lg:pl-8">
Name
</th>
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">
Year-Week
</th>
<th scope="col"
class="px-3 py-3.5 text-right text-sm font-semibold text-gray-900 sm:pr-8 lg:pr-8">
Status
</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-200 bg-white">
@foreach (range(0, 5) as $i)
<tr>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm font-medium text-gray-900 sm:pl-6 lg:pl-8">
<div class="w-full bg-gray-200 rounded-lg">&nbsp;</div>
</td>
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">
<div class="w-full bg-gray-200 rounded-lg">&nbsp;</div>
</td>
<td class="relative whitespace-nowrap py-4 pl-3 pr-4 text-right text-sm font-medium sm:pr-6 lg:pr-8">
<div class="w-full bg-gray-200 rounded-lg">&nbsp;</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>

View file

@ -1,50 +0,0 @@
<div class="flex flex-col gap-8">
<div class="flex flex-col sm:grid grid-cols-8 gap-2">
<div class="relative text-sm text-gray-800 col-span-3">
<div class="absolute pl-2 left-0 top-0 bottom-0 flex items-center pointer-events-none text-gray-500">
<x-icon.magnifying-glass />
</div>
<input type="text" placeholder="Search email or order #" class="block w-full rounded-lg border-0 py-1.5 pl-10 text-gray-900 ring-1 ring-inset ring-gray-200 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6">
</div>
<div class="flex gap-2 justify-end col-span-5">
<div class="hidden sm:flex">
<button type="button" class="flex items-center gap-2 rounded-lg border px-3 py-1.5 bg-white font-medium text-sm text-gray-700 hover:bg-gray-200">
<x-icon.arrow-down-tray />
Export
</button>
</div>
</div>
</div>
<div class="overflow-x-auto w-full">
<div class="relative animate-pulse min-w-[49.5rem]">
<div class="p-3">
<div class="w-full bg-gray-100 rounded-lg">&nbsp;</div>
</div>
<table class="min-w-full table-fixed divide-y divide-gray-300 text-gray-800">
<tbody class="divide-y divide-gray-200 bg-white text-gray-700">
@foreach (range(0, 5) as $i)
<tr>
<td class="whitespace-nowrap p-3 text-sm">
<div class="w-full bg-gray-200 rounded-lg">&nbsp;</div>
</td>
<td class="whitespace-nowrap p-3 text-sm" colspan="2">
<div class="w-full bg-gray-200 rounded-lg">&nbsp;</div>
</td>
<td class="whitespace-nowrap p-3 text-sm" colspan="3">
<div class="w-full bg-gray-200 rounded-lg">&nbsp;</div>
</td>
<td class="whitespace-nowrap p-3 text-sm">
<div class="w-full bg-gray-200 rounded-lg">&nbsp;</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>

View file

@ -2,14 +2,14 @@
@if($project->hasPendingDownload())
wire:poll.1s=""
@endif
>
>
<div class="px-4 sm:px-6 lg:px-8">
<div class="sm:flex sm:flex-col sm:items-center">
<div class="w-full">
<h1 class="text-base font-semibold leading-6 text-gray-900">Downloads</h1>
<p class="mt-2 text-sm text-gray-700">
@if ($project->hasPendingDownload())
Pending downloads for this project: {{ $project->downloads()->statusPending()->count() }}
Pending downloads for this project: {{ $project->downloads()->statusPending()->count() }}
@endif
</p>
</div>
@ -22,46 +22,51 @@ class="rounded-md bg-indigo-600 px-3 py-2 text-center text-sm font-semibold text
</div>
</div>
<div class="mt-8 flow-root">
<div class="-mx-4 -my-2 overflow-x-auto sm:-mx-6 lg:-mx-8">
<div class="inline-block min-w-full py-2 align-middle">
<table class="min-w-full divide-y divide-gray-300">
<thead>
<tr>
<th scope="col"
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6 lg:pl-8">
Name
</th>
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">
Status
</th>
<th scope="col" class="relative py-3.5 pl-3 pr-4 sm:pr-6 lg:pr-8">
<span class="sr-only">Edit</span>
</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-200 bg-white">
@foreach($downloads as $download)
<div class="relative">
<div class="-mx-4 -my-2 overflow-x-auto sm:-mx-6 lg:-mx-8">
<div class="inline-block min-w-full py-2 align-middle">
<table class="min-w-full divide-y divide-gray-300">
<thead>
<tr>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm font-medium text-gray-900 sm:pl-6 lg:pl-8">{{ $download->name }}</td>
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">
{{ $download->path }}
</td>
<td class="relative whitespace-nowrap py-4 pl-3 pr-4 text-right text-sm font-medium sm:pr-6 lg:pr-8">
<x-badge :status="$download->status"></x-badge>
</td>
<th scope="col"
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6 lg:pl-8">
Name
</th>
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">
File
</th>
<th scope="col"
class="px-3 py-3.5 text-right pr-4 sm:pr-8 lg:pr-8 text-sm font-semibold text-gray-900">
Status
</th>
</tr>
@endforeach
</tbody>
</table>
</thead>
<tbody class="divide-y divide-gray-200 bg-white">
@foreach($downloads as $download)
<tr>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm font-medium text-gray-900 sm:pl-6 lg:pl-8">{{ $download->name }}</td>
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">
{{ $download->path }}
</td>
<td class="relative whitespace-nowrap py-4 pl-3 pr-4 text-right text-sm font-medium sm:pr-6 lg:pr-8">
<x-badge :status="$download->status"></x-badge>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<div class="pt-4 flex justify-between items-center">
<div class="text-gray-700 text-sm">
Results: {{ \Illuminate\Support\Number::format($downloads->total()) }}
</div>
<div class="pt-4 flex justify-between items-center">
<div class="text-gray-700 text-sm">
Results: {{ \Illuminate\Support\Number::format($downloads->total()) }}
</div>
{{ $downloads->links('livewire.pagination') }}
{{ $downloads->links('livewire.pagination') }}
</div>
</div>
<div wire:loading class="absolute inset-0 bg-white opacity-75"></div>
</div>
</div>
</div>

View file

@ -0,0 +1,68 @@
<div>
<div class="px-4 sm:px-6 lg:px-8">
<div class="sm:flex sm:flex-col sm:items-center">
<div class="w-full">
<h1 class="text-base font-semibold leading-6 text-gray-900">{{ __('Mailing') }}</h1>
<p class="mt-2 text-sm text-gray-700"></p>
</div>
<div class="mt-4 sm:mt-0 sm:flex sm:justify-between w-full">
<x-search></x-search>
</div>
</div>
<div class="mt-8 flow-root">
<div class="-mx-4 -my-2 overflow-x-auto sm:-mx-6 lg:-mx-8">
<div class="inline-block min-w-full py-2 align-middle mb-10">
<div class="relative">
<table class="min-w-full divide-y divide-gray-300">
<thead>
<tr>
<th scope="col"
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6 lg:pl-8">
Id
</th>
<th scope="col"
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6 lg:pl-8">@lang('Subject')</th>
<th scope="col"
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6 lg:pl-8">@lang('Status')</th>
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">#</th>
<th scope="col"
class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">@lang('Attachment')
</th>
<th scope="col" class="relative py-3.5 pl-3 pr-4 sm:pr-0">
<span class="sr-only">Edit</span>
</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-200 bg-white text-gray-700">
@foreach (range(0, 5) as $i)
<tr>
<td class="whitespace-nowrap p-3 text-sm">
<div class="w-full bg-gray-200 rounded-lg">&nbsp;</div>
</td>
<td class="whitespace-nowrap p-3 text-sm">
<div class="w-full bg-gray-200 rounded-lg">&nbsp;</div>
</td>
<td class="whitespace-nowrap p-3 text-sm">
<div class="w-full bg-gray-200 rounded-lg">&nbsp;</div>
</td>
<td class="whitespace-nowrap p-3 text-sm">
<div class="w-full bg-gray-200 rounded-lg">&nbsp;</div>
</td>
<td class="whitespace-nowrap p-3 text-sm">
<div class="w-full bg-gray-200 rounded-lg">&nbsp;</div>
</td>
<td class="relative whitespace-nowrap py-4 pl-3 pr-4 text-right text-sm font-medium sm:pr-0">
<div class="w-full bg-gray-200 rounded-lg">&nbsp;</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>

View file

@ -1,50 +0,0 @@
<div class="flex flex-col gap-8">
<div class="flex flex-col sm:grid grid-cols-8 gap-2">
<div class="relative text-sm text-gray-800 col-span-3">
<div class="absolute pl-2 left-0 top-0 bottom-0 flex items-center pointer-events-none text-gray-500">
<x-icon.magnifying-glass />
</div>
<input type="text" placeholder="Search email or order #" class="block w-full rounded-lg border-0 py-1.5 pl-10 text-gray-900 ring-1 ring-inset ring-gray-200 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6">
</div>
<div class="flex gap-2 justify-end col-span-5">
<div class="hidden sm:flex">
<button type="button" class="flex items-center gap-2 rounded-lg border px-3 py-1.5 bg-white font-medium text-sm text-gray-700 hover:bg-gray-200">
<x-icon.arrow-down-tray />
Export
</button>
</div>
</div>
</div>
<div class="overflow-x-auto w-full">
<div class="relative animate-pulse min-w-[49.5rem]">
<div class="p-3">
<div class="w-full bg-gray-100 rounded-lg">&nbsp;</div>
</div>
<table class="min-w-full table-fixed divide-y divide-gray-300 text-gray-800">
<tbody class="divide-y divide-gray-200 bg-white text-gray-700">
@foreach (range(0, 5) as $i)
<tr>
<td class="whitespace-nowrap p-3 text-sm">
<div class="w-full bg-gray-200 rounded-lg">&nbsp;</div>
</td>
<td class="whitespace-nowrap p-3 text-sm" colspan="2">
<div class="w-full bg-gray-200 rounded-lg">&nbsp;</div>
</td>
<td class="whitespace-nowrap p-3 text-sm" colspan="3">
<div class="w-full bg-gray-200 rounded-lg">&nbsp;</div>
</td>
<td class="whitespace-nowrap p-3 text-sm">
<div class="w-full bg-gray-200 rounded-lg">&nbsp;</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>

View file

@ -1,47 +1,60 @@
<div>
<div class="px-4 sm:px-6 lg:px-8">
<div class="sm:flex sm:flex-col sm:items-center">
<div class="w-full">
<h1 class="text-base font-semibold leading-6 text-gray-900">{{ __('Mailing') }}</h1>
<p class="mt-2 text-sm text-gray-700"></p>
</div>
<div class="mt-4 sm:mt-0 sm:flex sm:justify-between w-full">
<x-search></x-search>
</div>
</div>
<div class="mt-8 flow-root">
<div class="-mx-4 -my-2 overflow-x-auto sm:-mx-6 lg:-mx-8">
<div class="inline-block min-w-full py-2 align-middle mb-10">
<table class="min-w-full divide-y divide-gray-300">
<thead>
<tr>
<th scope="col"
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6 lg:pl-8">
Id
</th>
<th scope="col"
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6 lg:pl-8">@lang('Subject')</th>
<th scope="col"
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6 lg:pl-8">@lang('Status')</th>
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">#</th>
<th scope="col"
class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">@lang('Attachment')
</th>
<th scope="col" class="relative py-3.5 pl-3 pr-4 sm:pr-0">
<span class="sr-only">Edit</span>
</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-200">
@foreach($mailings as $mail)
<div class="relative">
<table class="min-w-full divide-y divide-gray-300">
<thead>
<tr>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm font-medium text-gray-900 sm:pl-6 lg:pl-8">{{ $mail->id }}</td>
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">{{ $mail->subject }}</td>
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">
<x-badge :status="$mail->status"></x-badge>
</td>
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">{{ $mail->recipients()->count() }}</td>
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">{{ $mail->attachments()->pluck('name')->join( ', ') }}</td>
<td class="relative whitespace-nowrap py-4 pl-3 pr-4 text-right text-sm font-medium sm:pr-0">
<button type="button" wire:click="showMailingDetailsModal({{ $mail->id }})"
class="text-indigo-600 hover:text-indigo-900">Show
</button>
</td>
<th scope="col"
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6 lg:pl-8">
Id
</th>
<th scope="col"
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6 lg:pl-8">@lang('Subject')</th>
<th scope="col"
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6 lg:pl-8">@lang('Status')</th>
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">#</th>
<th scope="col"
class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">@lang('Attachment')
</th>
<th scope="col" class="relative py-3.5 pl-3 pr-4 sm:pr-0">
<span class="sr-only">Edit</span>
</th>
</tr>
@endforeach
</tbody>
</table>
</thead>
<tbody class="divide-y divide-gray-200">
@foreach($mailings as $mail)
<tr>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm font-medium text-gray-900 sm:pl-6 lg:pl-8">{{ $mail->id }}</td>
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">{{ $mail->subject }}</td>
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">
<x-badge :status="$mail->status"></x-badge>
</td>
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">{{ $mail->recipients()->count() }}</td>
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">{{ $mail->attachments()->pluck('name')->join( ', ') }}</td>
<td class="relative whitespace-nowrap py-4 pl-3 pr-4 text-right text-sm font-medium sm:pr-0">
<button type="button" wire:click="showMailingDetailsModal({{ $mail->id }})"
class="text-indigo-600 hover:text-indigo-900">Show
</button>
</td>
</tr>
@endforeach
</tbody>
</table>
<div class="absolute inset-0 bg-white opacity-75" wire:loading></div>
</div>
</div>
<div class="pt-4 flex justify-between items-center">
<div class="text-gray-700 text-sm">
@ -52,7 +65,6 @@ class="text-indigo-600 hover:text-indigo-900">Show
</div>
<x-modal wire:model.live="mailingDetailsModal">
<x-form-modal submit="saveProject">
<x-slot name="title">

View file

@ -0,0 +1,58 @@
<div>
<div class="px-4 sm:px-6 lg:px-8">
<div class="sm:flex sm:flex-col sm:items-center">
<div class="w-full">
<h1 class="text-base font-semibold leading-6 text-gray-900">Mosaics</h1>
<p class="mt-2 text-sm text-gray-700">
</p>
</div>
<div class="mt-4 sm:mt-0 sm:flex sm:justify-between w-full">
<x-search></x-search>
<x-button
class="block rounded-md bg-indigo-600 px-3 py-2 text-center text-sm font-semibold text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600">
Create Mosaic
</x-button>
</div>
</div>
<div class="mt-8 flow-root">
<div class="overflow-x-auto sm:-mx-6 lg:-mx-8">
<div class="animate-pulse">
<div class="inline-block min-w-full py-2 align-middle">
<table class="min-w-full divide-y divide-gray-300">
<thead>
<tr>
<th scope="col"
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6 lg:pl-8">
Name
</th>
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">
Year-Week
</th>
<th scope="col"
class="px-3 py-3.5 text-right text-sm font-semibold text-gray-900 sm:pr-8 lg:pr-8">
Status
</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-200 bg-white">
@foreach (range(0, 5) as $i)
<tr>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm font-medium text-gray-900 sm:pl-6 lg:pl-8">
<div class="w-full bg-gray-200 rounded-lg">&nbsp;</div>
</td>
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">
<div class="w-full bg-gray-200 rounded-lg">&nbsp;</div>
</td>
<td class="relative whitespace-nowrap py-4 pl-3 pr-4 text-right text-sm font-medium sm:pr-6 lg:pr-8">
<div class="w-full bg-gray-200 rounded-lg">&nbsp;</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>

View file

@ -1,50 +0,0 @@
<div class="flex flex-col gap-8">
<div class="flex flex-col sm:grid grid-cols-8 gap-2">
<div class="relative text-sm text-gray-800 col-span-3">
<div class="absolute pl-2 left-0 top-0 bottom-0 flex items-center pointer-events-none text-gray-500">
<x-icon.magnifying-glass />
</div>
<input type="text" placeholder="Search email or order #" class="block w-full rounded-lg border-0 py-1.5 pl-10 text-gray-900 ring-1 ring-inset ring-gray-200 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6">
</div>
<div class="flex gap-2 justify-end col-span-5">
<div class="hidden sm:flex">
<button type="button" class="flex items-center gap-2 rounded-lg border px-3 py-1.5 bg-white font-medium text-sm text-gray-700 hover:bg-gray-200">
<x-icon.arrow-down-tray />
Export
</button>
</div>
</div>
</div>
<div class="overflow-x-auto w-full">
<div class="relative animate-pulse min-w-[49.5rem]">
<div class="p-3">
<div class="w-full bg-gray-100 rounded-lg">&nbsp;</div>
</div>
<table class="min-w-full table-fixed divide-y divide-gray-300 text-gray-800">
<tbody class="divide-y divide-gray-200 bg-white text-gray-700">
@foreach (range(0, 5) as $i)
<tr>
<td class="whitespace-nowrap p-3 text-sm">
<div class="w-full bg-gray-200 rounded-lg">&nbsp;</div>
</td>
<td class="whitespace-nowrap p-3 text-sm" colspan="2">
<div class="w-full bg-gray-200 rounded-lg">&nbsp;</div>
</td>
<td class="whitespace-nowrap p-3 text-sm" colspan="3">
<div class="w-full bg-gray-200 rounded-lg">&nbsp;</div>
</td>
<td class="whitespace-nowrap p-3 text-sm">
<div class="w-full bg-gray-200 rounded-lg">&nbsp;</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>

View file

@ -23,49 +23,47 @@ class="block rounded-md bg-indigo-600 px-3 py-2 text-center text-sm font-semibol
</div>
<div class="mt-8 flow-root">
<div class="-mx-4 -my-2 overflow-x-auto sm:-mx-6 lg:-mx-8">
<div class="inline-block min-w-full py-2 align-middle">
<table class="min-w-full divide-y divide-gray-300">
<thead>
<tr>
<th scope="col"
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6 lg:pl-8">
Name
</th>
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">
Year-Week
</th>
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">
Status
</th>
<th scope="col" class="relative py-3.5 pl-3 pr-4 sm:pr-6 lg:pr-8">
<span class="sr-only">Edit</span>
</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-200 bg-white">
@foreach($mosaics as $mosaic)
<div class="relative">
<div class="inline-block min-w-full py-2 align-middle">
<table class="min-w-full divide-y divide-gray-300">
<thead>
<tr>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm font-medium text-gray-900 sm:pl-6 lg:pl-8">{{ $mosaic->name }}</td>
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">
{{ $mosaic->year }}-{{ $mosaic->week}}
</td>
<td class="relative whitespace-nowrap py-4 pl-3 pr-4 text-left text-sm font-medium sm:pr-6 lg:pr-8">
<x-badge :status="$mosaic->status"></x-badge>
</td>
<td class="relative whitespace-nowrap py-4 pl-3 pr-4 text-right text-sm font-medium sm:pr-6 lg:pr-8">
</td>
<th scope="col"
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6 lg:pl-8">
Name
</th>
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">
Year-Week
</th>
<th scope="col"
class="px-3 py-3.5 text-right text-sm font-semibold text-gray-900 sm:pr-8 lg:pr-8">
Status
</th>
</tr>
@endforeach
</tbody>
</table>
</div>
<div class="pt-4 flex justify-between items-center">
<div class="text-gray-700 text-sm">
Results: {{ \Illuminate\Support\Number::format($mosaics->total()) }}
</thead>
<tbody class="divide-y divide-gray-200 bg-white">
@foreach($mosaics as $mosaic)
<tr>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm font-medium text-gray-900 sm:pl-6 lg:pl-8">{{ $mosaic->name }}</td>
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">
{{ $mosaic->year }}-{{ $mosaic->week}}
</td>
<td class="relative whitespace-nowrap py-4 pl-3 pr-4 text-right text-sm font-medium sm:pr-6 lg:pr-8">
<x-badge :status="$mosaic->status"></x-badge>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<div class="pt-4 flex justify-between items-center">
<div class="text-gray-700 text-sm">
Results: {{ \Illuminate\Support\Number::format($mosaics->total()) }}
</div>
{{ $mosaics->links('livewire.pagination') }}
{{ $mosaics->links('livewire.pagination') }}
</div>
<div class="absolute inset-0 bg-white opacity-75" wire:loading></div>
</div>
</div>
</div>

View file

@ -0,0 +1,63 @@
<div>
<div class="px-4 sm:px-6 lg:px-8">
<div class="sm:flex sm:flex-col sm:items-center">
<div class="w-full">
<h1 class="text-base font-semibold leading-6 text-gray-900">Reports</h1>
<p class="mt-2 text-sm text-gray-700">
</p>
</div>
<div class="mt-4 sm:mt-0 sm:flex sm:justify-between w-full">
<x-search></x-search>
<x-button
class="block rounded-md bg-indigo-600 px-3 py-2 text-center text-sm font-semibold text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600">
Create Report
</x-button>
</div>
</div>
<div class="mt-8 flow-root">
<div class="-mx-4 -my-2 overflow-x-auto sm:-mx-6 lg:-mx-8">
<div class="animate-pulse">
<div class="inline-block min-w-full py-2 align-middle">
<table class="min-w-full divide-y divide-gray-300">
<thead>
<tr>
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">
Created At
</th>
<th scope="col"
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6 lg:pl-8">
Name
</th>
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">
Status
</th>
<th scope="col" class="relative py-3.5 pl-3 pr-4 sm:pr-6 lg:pr-8">
<span class="sr-only">Edit</span>
</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-200 bg-white">
@foreach (range(0, 5) as $i)
<tr>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm font-medium text-gray-900 sm:pl-6 lg:pl-8">
<div class="w-full bg-gray-200 rounded-lg">&nbsp;</div>
</td>
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">
<div class="w-full bg-gray-200 rounded-lg">&nbsp;</div>
</td>
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">
<div class="w-full bg-gray-200 rounded-lg">&nbsp;</div>
</td>
<td class="relative whitespace-nowrap py-4 pl-3 pr-4 text-right text-sm font-medium sm:pr-6 lg:pr-8">
<div class="w-full bg-gray-200 rounded-lg">&nbsp;</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>

View file

@ -1,50 +0,0 @@
<div class="flex flex-col gap-8">
<div class="flex flex-col sm:grid grid-cols-8 gap-2">
<div class="relative text-sm text-gray-800 col-span-3">
<div class="absolute pl-2 left-0 top-0 bottom-0 flex items-center pointer-events-none text-gray-500">
<x-icon.magnifying-glass />
</div>
<input type="text" placeholder="Search email or order #" class="block w-full rounded-lg border-0 py-1.5 pl-10 text-gray-900 ring-1 ring-inset ring-gray-200 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6">
</div>
<div class="flex gap-2 justify-end col-span-5">
<div class="hidden sm:flex">
<button type="button" class="flex items-center gap-2 rounded-lg border px-3 py-1.5 bg-white font-medium text-sm text-gray-700 hover:bg-gray-200">
<x-icon.arrow-down-tray />
Export
</button>
</div>
</div>
</div>
<div class="overflow-x-auto w-full">
<div class="relative animate-pulse min-w-[49.5rem]">
<div class="p-3">
<div class="w-full bg-gray-100 rounded-lg">&nbsp;</div>
</div>
<table class="min-w-full table-fixed divide-y divide-gray-300 text-gray-800">
<tbody class="divide-y divide-gray-200 bg-white text-gray-700">
@foreach (range(0, 5) as $i)
<tr>
<td class="whitespace-nowrap p-3 text-sm">
<div class="w-full bg-gray-200 rounded-lg">&nbsp;</div>
</td>
<td class="whitespace-nowrap p-3 text-sm" colspan="2">
<div class="w-full bg-gray-200 rounded-lg">&nbsp;</div>
</td>
<td class="whitespace-nowrap p-3 text-sm" colspan="3">
<div class="w-full bg-gray-200 rounded-lg">&nbsp;</div>
</td>
<td class="whitespace-nowrap p-3 text-sm">
<div class="w-full bg-gray-200 rounded-lg">&nbsp;</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>

View file

@ -1,11 +1,11 @@
<div>
<div class="px-4 sm:px-6 lg:px-8">
<div class="sm:flex sm:items-center">
<div class="sm:flex-auto">
<div class="sm:flex sm:flex-col sm:items-center">
<div class="w-full">
<h1 class="text-base font-semibold leading-6 text-gray-900">Reports</h1>
<p class="mt-2 text-sm text-gray-700"></p>
</div>
<div class="mt-4 sm:ml-16 sm:mt-0 sm:flex-none">
<div class="mt-4 sm:mt-0 sm:flex sm:justify-between w-full">
<x-search></x-search>
<x-button wire:click="openCreateReportModal"
class="block rounded-md bg-indigo-600 px-3 py-2 text-center text-sm font-semibold text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600">
@ -15,41 +15,41 @@ class="block rounded-md bg-indigo-600 px-3 py-2 text-center text-sm font-semibol
</div>
<div class="mt-8 flow-root">
<div class="-mx-4 -my-2 overflow-x-auto sm:-mx-6 lg:-mx-8">
<div class="inline-block min-w-full py-2 align-middle mb-10">
<table class="min-w-full divide-y divide-gray-300">
<thead>
<tr>
<th scope="col"
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6 lg:pl-8">
Name
</th>
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">
Status
</th>
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">
Email
</th>
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">
Role
</th>
<th scope="col" class="relative py-3.5 pl-3 pr-4 sm:pr-6 lg:pr-8">
<span class="sr-only">Edit</span>
</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-200 bg-white">
@foreach($reports as $report)
<livewire:projects.report-row :$report :key="$report->id"/>
@endforeach
</tbody>
</table>
</div>
<div class="pt-4 flex justify-between items-center">
<div class="text-gray-700 text-sm">
Results: {{ \Illuminate\Support\Number::format($reports->total()) }}
<div class="relative">
<div class="inline-block min-w-full py-2 align-middle mb-10">
<table class="min-w-full divide-y divide-gray-300">
<thead>
<tr>
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">
Created At
</th>
<th scope="col"
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6 lg:pl-8">
Name
</th>
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">
Status
</th>
<th scope="col" class="relative py-3.5 pl-3 pr-4 sm:pr-6 lg:pr-8">
<span class="sr-only">Edit</span>
</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-200 bg-white">
@foreach($reports as $report)
<livewire:projects.report-row :$report :key="$report->id"/>
@endforeach
</tbody>
</table>
</div>
<div class="pt-4 flex justify-between items-center">
<div class="text-gray-700 text-sm">
Results: {{ \Illuminate\Support\Number::format($reports->total()) }}
</div>
{{ $reports->links('livewire.pagination') }}
{{ $reports->links('livewire.pagination') }}
</div>
<div class="absolute inset-0 bg-white opacity-75" wire:loading></div>
</div>
</div>
</div>

View file

@ -1,4 +1,8 @@
<tr>
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">
{{ $report->created_at->diffForHumans() }}
</td>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm font-medium text-gray-900 sm:pl-6 lg:pl-8">{{ $report->name }}</td>
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">
@if($report->status == \App\Enums\Status::Pending)
@ -7,10 +11,6 @@
<x-badge :status="$report->status"></x-badge>
@endif
</td>
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">
lindsay.walton@example.com
</td>
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">Member</td>
<td class="py-4 pl-3 pr-4 text-right text-sm font-medium sm:pr-6 lg:pr-8 flex justify-end">
<x-menu>
<x-menu.button>

View file

@ -16,17 +16,18 @@ class="inline-flex rounded-l-md border-t border-l border-b px-5 py-2.5"
data-tab-name="mosaics"
:class="$tab.isSelected ? 'border-gray-200 bg-white' : 'border-transparent'"
class="inline-flex rounded-l-md border-t border-l border-b px-5 py-2.5"
>{{ __('Mosaic') }}</button>
<button x-tabs:tab type="button"
data-tab-name="mailing"
:class="$tab.isSelected ? 'border-gray-200 bg-white' : 'border-transparent'"
class="inline-flex rounded-l-md border-t border-l border-b px-5 py-2.5"
>{{ __('Mailing') }}</button>
>{{ __('Mosaics') }}</button>
<button x-tabs:tab type="button"
data-tab-name="reports"
:class="$tab.isSelected ? 'border-gray-200 bg-white' : 'border-transparent'"
class="inline-flex rounded-l-md border-t border-l border-b px-5 py-2.5"
>{{ __('Reports') }}</button>
<button x-tabs:tab type="button"
data-tab-name="mailing"
:class="$tab.isSelected ? 'border-gray-200 bg-white' : 'border-transparent'"
class="inline-flex rounded-l-md border-t border-l border-b px-5 py-2.5"
>{{ __('Mailings') }}</button>
</div>
<div x-tabs:panels class="rounded-b-md border border-gray-200 bg-white w-full">
@ -36,13 +37,12 @@ class="inline-flex rounded-l-md border-t border-l border-b px-5 py-2.5"
<section x-tabs:panel class="p-8">
<livewire:projects.mosaic-manager :project="$project" />
</section>
<section x-tabs:panel class="p-8">
<livewire:projects.mailing-manager :project="$project" />
</section>
<section x-tabs:panel class="p-8">
<livewire:projects.report-manager :project="$project" />
</section>
<section x-tabs:panel class="p-8">
<livewire:projects.mailing-manager :project="$project" />
</section>
</div>
</div>
</x-app-layout>