Compare commits
4 Commits
main
...
5656dc1f3a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5656dc1f3a | ||
|
|
1e7a35ad4f | ||
|
|
79f2f22e5d | ||
|
|
15c8d3ae7c |
@@ -88,21 +88,17 @@ class BrandContractController extends Controller
|
|||||||
{
|
{
|
||||||
$categoryId = $request->integer('category_id');
|
$categoryId = $request->integer('category_id');
|
||||||
$clientId = $request->integer('client_id');
|
$clientId = $request->integer('client_id');
|
||||||
|
$dateStr = $request->input('date');
|
||||||
|
|
||||||
if (! $categoryId) {
|
if (! $categoryId || empty($dateStr)) {
|
||||||
return response()->json(null);
|
return response()->json(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Collect the category and its parent chain (so blocking a parent also blocks children)
|
$date = $dateStr ? \Carbon\Carbon::parse($dateStr) : today();
|
||||||
$category = ClientCategory::find($categoryId);
|
|
||||||
$checkIds = [$categoryId];
|
|
||||||
if ($category?->parent_id) {
|
|
||||||
$checkIds[] = $category->parent_id;
|
|
||||||
}
|
|
||||||
|
|
||||||
$contract = BrandContract::with(['client', 'category'])
|
$contract = BrandContract::with(['client', 'category'])
|
||||||
->active()
|
->active($date)
|
||||||
->whereIn('category_id', $checkIds)
|
->where('category_id', $categoryId)
|
||||||
->first();
|
->first();
|
||||||
|
|
||||||
if (! $contract) {
|
if (! $contract) {
|
||||||
|
|||||||
@@ -46,6 +46,22 @@ class ClientCategoryController extends Controller
|
|||||||
return back()->with('success', '🏷️ Category added!');
|
return back()->with('success', '🏷️ Category added!');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function quickStore(Request $request): \Illuminate\Http\JsonResponse
|
||||||
|
{
|
||||||
|
$validated = $request->validate([
|
||||||
|
'name' => 'required|string|max:100',
|
||||||
|
]);
|
||||||
|
|
||||||
|
$validated['slug'] = \Illuminate\Support\Str::slug($validated['name']);
|
||||||
|
if (ClientCategory::where('slug', $validated['slug'])->exists()) {
|
||||||
|
$validated['slug'] .= '-' . substr(uniqid(), -4);
|
||||||
|
}
|
||||||
|
|
||||||
|
$category = ClientCategory::create($validated);
|
||||||
|
|
||||||
|
return response()->json(['id' => $category->id, 'name' => $category->name, 'icon' => '🏷️']);
|
||||||
|
}
|
||||||
|
|
||||||
public function update(Request $request, ClientCategory $category): RedirectResponse
|
public function update(Request $request, ClientCategory $category): RedirectResponse
|
||||||
{
|
{
|
||||||
$validated = $request->validate([
|
$validated = $request->validate([
|
||||||
|
|||||||
@@ -41,12 +41,20 @@ class EventController extends Controller
|
|||||||
$clients = Client::where('status', 'active')->orderBy('name')->get();
|
$clients = Client::where('status', 'active')->orderBy('name')->get();
|
||||||
$categoryTree = $this->categoryTree();
|
$categoryTree = $this->categoryTree();
|
||||||
|
|
||||||
|
$contracts = BrandContract::select('client_id', 'title')->get();
|
||||||
|
$contents = ContentBrief::select('client_id', 'title')->get();
|
||||||
|
|
||||||
|
foreach ($events as $e) {
|
||||||
|
$e->has_contract = $e->client_id && $contracts->contains(fn($c) => $c->client_id === $e->client_id && stripos($c->title, $e->title) !== false);
|
||||||
|
$e->has_content = $e->client_id && $contents->contains(fn($c) => $c->client_id === $e->client_id && stripos($c->title, $e->title) !== false);
|
||||||
|
}
|
||||||
|
|
||||||
// Format for FullCalendar
|
// Format for FullCalendar
|
||||||
$calendarEvents = $events->map(fn (Event $e) => [
|
$calendarEvents = $events->map(fn (Event $e) => [
|
||||||
'id' => $e->id,
|
'id' => $e->id,
|
||||||
'title' => ($e->is_priority ? '⭐ ' : '') . $e->title,
|
'title' => ($e->is_priority ? '⭐ ' : '') . $e->title,
|
||||||
'start' => $e->start_time->toIso8601String(),
|
'start' => $e->start_time->format('Y-m-d\TH:i:s'),
|
||||||
'end' => $e->end_time?->toIso8601String(),
|
'end' => $e->end_time?->format('Y-m-d\TH:i:s'),
|
||||||
'backgroundColor' => $e->color,
|
'backgroundColor' => $e->color,
|
||||||
'borderColor' => $e->color,
|
'borderColor' => $e->color,
|
||||||
'extendedProps' => [
|
'extendedProps' => [
|
||||||
@@ -54,6 +62,11 @@ class EventController extends Controller
|
|||||||
'client' => $e->client?->name,
|
'client' => $e->client?->name,
|
||||||
'type' => $e->event_type,
|
'type' => $e->event_type,
|
||||||
'priority' => $e->is_priority,
|
'priority' => $e->is_priority,
|
||||||
|
'location' => $e->location,
|
||||||
|
'description' => $e->description,
|
||||||
|
'notes' => $e->notes,
|
||||||
|
'has_contract' => $e->has_contract,
|
||||||
|
'has_content' => $e->has_content,
|
||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@@ -113,6 +126,7 @@ class EventController extends Controller
|
|||||||
'status' => ContentStatus::Drafting,
|
'status' => ContentStatus::Drafting,
|
||||||
'target_date' => $event->start_time->toDateString(),
|
'target_date' => $event->start_time->toDateString(),
|
||||||
'notes' => $event->notes,
|
'notes' => $event->notes,
|
||||||
|
'body' => $event->description,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -192,11 +206,19 @@ class EventController extends Controller
|
|||||||
|
|
||||||
public function apiList(): JsonResponse
|
public function apiList(): JsonResponse
|
||||||
{
|
{
|
||||||
$events = Event::with('client')->get()->map(fn (Event $e) => [
|
$eventsList = Event::with('client')->get();
|
||||||
|
$contracts = BrandContract::select('client_id', 'title')->get();
|
||||||
|
$contents = ContentBrief::select('client_id', 'title')->get();
|
||||||
|
|
||||||
|
$events = $eventsList->map(function (Event $e) use ($contracts, $contents) {
|
||||||
|
$hasContract = $e->client_id && $contracts->contains(fn($c) => $c->client_id === $e->client_id && stripos($c->title, $e->title) !== false);
|
||||||
|
$hasContent = $e->client_id && $contents->contains(fn($c) => $c->client_id === $e->client_id && stripos($c->title, $e->title) !== false);
|
||||||
|
|
||||||
|
return [
|
||||||
'id' => $e->id,
|
'id' => $e->id,
|
||||||
'title' => ($e->is_priority ? '⭐ ' : '') . $e->title,
|
'title' => ($e->is_priority ? '⭐ ' : '') . $e->title,
|
||||||
'start' => $e->start_time->toIso8601String(),
|
'start' => $e->start_time->format('Y-m-d\TH:i:s'),
|
||||||
'end' => $e->end_time?->toIso8601String(),
|
'end' => $e->end_time?->format('Y-m-d\TH:i:s'),
|
||||||
'backgroundColor' => $e->color,
|
'backgroundColor' => $e->color,
|
||||||
'borderColor' => $e->color,
|
'borderColor' => $e->color,
|
||||||
'allDay' => $e->is_all_day,
|
'allDay' => $e->is_all_day,
|
||||||
@@ -205,8 +227,14 @@ class EventController extends Controller
|
|||||||
'client' => $e->client?->name,
|
'client' => $e->client?->name,
|
||||||
'type' => $e->event_type,
|
'type' => $e->event_type,
|
||||||
'priority' => $e->is_priority,
|
'priority' => $e->is_priority,
|
||||||
|
'location' => $e->location,
|
||||||
|
'description' => $e->description,
|
||||||
|
'notes' => $e->notes,
|
||||||
|
'has_contract' => $hasContract,
|
||||||
|
'has_content' => $hasContent,
|
||||||
],
|
],
|
||||||
]);
|
];
|
||||||
|
});
|
||||||
|
|
||||||
return response()->json($events);
|
return response()->json($events);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,11 +34,12 @@ class BrandContract extends Model
|
|||||||
|
|
||||||
// ── Scopes ───────────────────────────────────────────────────
|
// ── Scopes ───────────────────────────────────────────────────
|
||||||
|
|
||||||
public function scopeActive($query)
|
public function scopeActive($query, $date = null)
|
||||||
{
|
{
|
||||||
|
$date = $date ?? today();
|
||||||
return $query->where('is_active', true)
|
return $query->where('is_active', true)
|
||||||
->where('start_date', '<=', today())
|
->where('start_date', '<=', $date)
|
||||||
->where('end_date', '>=', today());
|
->where('end_date', '>=', $date);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── Helpers ──────────────────────────────────────────────────
|
// ── Helpers ──────────────────────────────────────────────────
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ class RateCardProfile extends Model
|
|||||||
public static function getSingleton(): self
|
public static function getSingleton(): self
|
||||||
{
|
{
|
||||||
return static::firstOrCreate([], [
|
return static::firstOrCreate([], [
|
||||||
'owner_name' => config('app.name', 'KOL Manager'),
|
'owner_name' => config('app.name', 'Cathy Page'),
|
||||||
'bg_color' => '#FFF8F0',
|
'bg_color' => '#FFF8F0',
|
||||||
'accent_color' => '#FFB7C5',
|
'accent_color' => '#FFB7C5',
|
||||||
'text_color' => '#374151',
|
'text_color' => '#374151',
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ class EmailNotifier
|
|||||||
|
|
||||||
Mail::raw($combined, function ($mail) use ($toEmail, $setting): void {
|
Mail::raw($combined, function ($mail) use ($toEmail, $setting): void {
|
||||||
$mail->to($toEmail)
|
$mail->to($toEmail)
|
||||||
->subject("🐱 KOL Manager — {$setting->name} Notifications");
|
->subject("🐱 Cathy's App — {$setting->name} Notifications");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ class WahaNotifier
|
|||||||
{
|
{
|
||||||
$this->send(
|
$this->send(
|
||||||
$setting,
|
$setting,
|
||||||
"🐱 *KOL Manager — Test Notification*\n\nYour WhatsApp channel is configured correctly! 🎉"
|
"🐱 *Cathy's App — Test Notification*\n\nYour WhatsApp channel is configured correctly! 🎉"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "KOL-Manager",
|
"name": "app",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<label class="block text-xs font-semibold text-gray-600 mb-1">Name <span class="text-pink-400">*</span></label>
|
<label class="block text-xs font-semibold text-gray-600 mb-1">Name <span class="text-pink-400">*</span></label>
|
||||||
<input type="text" name="name" required maxlength="100"
|
<input type="text" name="name" required maxlength="100"
|
||||||
placeholder="e.g. Energy Drinks"
|
placeholder="e.g. Susu Formula"
|
||||||
class="input-soft" value="{{ old('name') }}">
|
class="input-soft" value="{{ old('name') }}">
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
@extends('layouts.app')
|
@extends('layouts.app')
|
||||||
|
|
||||||
@section('title', 'Clients')
|
@section('title', 'Clients')
|
||||||
@section('page-title', 'Clients / CRM 👥')
|
@section('page-title', 'Clients👥')
|
||||||
@section('page-subtitle', 'Manage your brand partners and contacts')
|
@section('page-subtitle', 'Manage your brand partners and contacts')
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
|
|
||||||
{{-- ── Toolbar + collapsible filter ───────────────────────── --}}
|
{{-- ── Toolbar + collapsible filter ───────────────────────── --}}
|
||||||
<div x-data="{ open: {{ request('category') || request('status') ? 'true' : 'false' }} }">
|
<div x-data="{ open: {{ request('category') || request('status') ? 'true' : 'false' }} }">
|
||||||
|
|
||||||
<div class="flex items-center justify-between gap-2 mb-3">
|
<div class="flex items-center justify-between gap-2 mb-3">
|
||||||
<div class="flex items-center gap-2">
|
<div class="flex items-center gap-2">
|
||||||
<a href="{{ route('clients.create') }}" class="btn-sakura text-sm">+ Add</a>
|
<a href="{{ route('clients.create') }}" class="btn-sakura text-sm">+ Add</a>
|
||||||
@if(request('category') || request('status'))
|
@if(request('category') || request('status'))
|
||||||
@@ -22,40 +22,39 @@
|
|||||||
<button @click="open = !open"
|
<button @click="open = !open"
|
||||||
class="flex items-center gap-1.5 text-xs px-3 py-2 rounded-full border transition-colors"
|
class="flex items-center gap-1.5 text-xs px-3 py-2 rounded-full border transition-colors"
|
||||||
:class="open ? 'border-pink-300 bg-pink-50 text-pink-600' : 'border-gray-200 text-gray-500 hover:bg-gray-50'">
|
:class="open ? 'border-pink-300 bg-pink-50 text-pink-600' : 'border-gray-200 text-gray-500 hover:bg-gray-50'">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="w-3.5 h-3.5" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
<svg xmlns="http://www.w3.org/2000/svg" class="w-3.5 h-3.5" fill="none" viewBox="0 0 24 24"
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" d="M3 4h18M7 10h10M11 16h2"/>
|
stroke="currentColor" stroke-width="2">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" d="M3 4h18M7 10h10M11 16h2" />
|
||||||
</svg>
|
</svg>
|
||||||
Filter
|
Filter
|
||||||
@if(request('category') || request('status'))
|
@if(request('category') || request('status'))
|
||||||
<span class="w-2 h-2 rounded-full bg-pink-400 inline-block ml-0.5"></span>
|
<span class="w-2 h-2 rounded-full bg-pink-400 inline-block ml-0.5"></span>
|
||||||
@endif
|
@endif
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{-- ── Filters panel (collapsible) ────────────────────────── --}}
|
{{-- ── Filters panel (collapsible) ────────────────────────── --}}
|
||||||
<div x-show="open" x-transition.duration.150ms>
|
<div x-show="open" x-transition.duration.150ms>
|
||||||
<form method="GET" action="{{ route('clients.index') }}" id="filter-form" class="cat-card p-3 mb-4">
|
<form method="GET" action="{{ route('clients.index') }}" id="filter-form" class="cat-card p-3 mb-4">
|
||||||
{{-- Row 1: search + dropdowns --}}
|
{{-- Row 1: search + dropdowns --}}
|
||||||
<div class="flex flex-col sm:flex-row sm:items-center gap-2">
|
<div class="flex flex-col sm:flex-row sm:items-center gap-2">
|
||||||
{{-- Search (fills remaining space on desktop) --}}
|
{{-- Search (fills remaining space on desktop) --}}
|
||||||
<div class="relative flex-1 min-w-0">
|
<div class="relative flex-1 min-w-0">
|
||||||
<span class="absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 text-sm pointer-events-none">🔍</span>
|
<span
|
||||||
|
class="absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 text-sm pointer-events-none">🔍</span>
|
||||||
<input type="text" placeholder="Filter by name…" class="input-soft pl-9 text-sm py-2 w-full"
|
<input type="text" placeholder="Filter by name…" class="input-soft pl-9 text-sm py-2 w-full"
|
||||||
oninput="filterClients(this.value)" id="search-input">
|
oninput="filterClients(this.value)" id="search-input">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{-- Category dropdown --}}
|
{{-- Category dropdown --}}
|
||||||
<select name="category" class="input-soft text-sm py-2 sm:w-48 shrink-0"
|
<select name="category" class="input-soft text-sm py-2 sm:w-48 shrink-0" onchange="this.form.submit()">
|
||||||
onchange="this.form.submit()">
|
|
||||||
<option value="">All Categories</option>
|
<option value="">All Categories</option>
|
||||||
@foreach($categories as $parent)
|
@foreach($categories as $parent)
|
||||||
<option value="{{ $parent->id }}"
|
<option value="{{ $parent->id }}" {{ request('category') == $parent->id ? 'selected' : '' }}>
|
||||||
{{ request('category') == $parent->id ? 'selected' : '' }}>
|
|
||||||
{{ $parent->icon }} {{ $parent->name }}
|
{{ $parent->icon }} {{ $parent->name }}
|
||||||
</option>
|
</option>
|
||||||
@foreach($parent->children as $child)
|
@foreach($parent->children as $child)
|
||||||
<option value="{{ $child->id }}"
|
<option value="{{ $child->id }}" {{ request('category') == $child->id ? 'selected' : '' }}>
|
||||||
{{ request('category') == $child->id ? 'selected' : '' }}>
|
|
||||||
↳ {{ $child->name }}
|
↳ {{ $child->name }}
|
||||||
</option>
|
</option>
|
||||||
@endforeach
|
@endforeach
|
||||||
@@ -63,8 +62,7 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
{{-- Status dropdown --}}
|
{{-- Status dropdown --}}
|
||||||
<select name="status" class="input-soft text-sm py-2 sm:w-36 shrink-0"
|
<select name="status" class="input-soft text-sm py-2 sm:w-36 shrink-0" onchange="this.form.submit()">
|
||||||
onchange="this.form.submit()">
|
|
||||||
<option value="">All Statuses</option>
|
<option value="">All Statuses</option>
|
||||||
@foreach($statuses as $s)
|
@foreach($statuses as $s)
|
||||||
<option value="{{ $s->value }}" {{ request('status') === $s->value ? 'selected' : '' }}>
|
<option value="{{ $s->value }}" {{ request('status') === $s->value ? 'selected' : '' }}>
|
||||||
@@ -74,12 +72,12 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>{{-- end x-data --}}
|
</div>{{-- end x-data --}}
|
||||||
|
|
||||||
{{-- ── Client grid ─────────────────────────────────────────── --}}
|
{{-- ── Client grid ─────────────────────────────────────────── --}}
|
||||||
<div class="grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-3 gap-4" id="clients-grid">
|
<div class="grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-3 gap-4" id="clients-grid">
|
||||||
@forelse($clients as $client)
|
@forelse($clients as $client)
|
||||||
<div class="cat-card p-4 flex flex-col gap-3 hover:shadow-md transition-shadow duration-200"
|
<div class="cat-card p-4 flex flex-col gap-3 hover:shadow-md transition-shadow duration-200"
|
||||||
data-name="{{ strtolower($client->name) }} {{ strtolower($client->company ?? '') }}">
|
data-name="{{ strtolower($client->name) }} {{ strtolower($client->company ?? '') }}">
|
||||||
@@ -87,8 +85,7 @@
|
|||||||
<div class="flex items-start gap-3">
|
<div class="flex items-start gap-3">
|
||||||
@if($client->avatar)
|
@if($client->avatar)
|
||||||
<div class="w-11 h-11 rounded-2xl overflow-hidden shrink-0 shadow-sm ring-2 ring-pink-100">
|
<div class="w-11 h-11 rounded-2xl overflow-hidden shrink-0 shadow-sm ring-2 ring-pink-100">
|
||||||
<img src="{{ \Illuminate\Support\Facades\Storage::url($client->avatar) }}"
|
<img src="{{ \Illuminate\Support\Facades\Storage::url($client->avatar) }}" alt="{{ $client->name }}"
|
||||||
alt="{{ $client->name }}"
|
|
||||||
class="w-full h-full object-cover">
|
class="w-full h-full object-cover">
|
||||||
</div>
|
</div>
|
||||||
@else
|
@else
|
||||||
@@ -108,7 +105,8 @@
|
|||||||
<div class="text-xs text-gray-400 truncate">{{ $client->company }}</div>
|
<div class="text-xs text-gray-400 truncate">{{ $client->company }}</div>
|
||||||
@endif
|
@endif
|
||||||
@if($client->category)
|
@if($client->category)
|
||||||
<div class="text-xs mt-0.5" style="color: {{ $client->category->color === '#FDFD96' ? '#8B8000' : $client->category->color }}">
|
<div class="text-xs mt-0.5"
|
||||||
|
style="color: {{ $client->category->color === '#FDFD96' ? '#8B8000' : $client->category->color }}">
|
||||||
{{ $client->category->icon }} {{ $client->category->name }}
|
{{ $client->category->icon }} {{ $client->category->name }}
|
||||||
@if($client->category->parent)
|
@if($client->category->parent)
|
||||||
<span class="text-gray-300 mx-0.5">·</span>
|
<span class="text-gray-300 mx-0.5">·</span>
|
||||||
@@ -124,10 +122,12 @@
|
|||||||
<span class="text-xs bg-pink-50 text-pink-600 px-2 py-0.5 rounded-full">📸 {{ $client->ig_handle }}</span>
|
<span class="text-xs bg-pink-50 text-pink-600 px-2 py-0.5 rounded-full">📸 {{ $client->ig_handle }}</span>
|
||||||
@endif
|
@endif
|
||||||
@if($client->tiktok_handle)
|
@if($client->tiktok_handle)
|
||||||
<span class="text-xs bg-purple-50 text-purple-600 px-2 py-0.5 rounded-full">🎵 {{ $client->tiktok_handle }}</span>
|
<span class="text-xs bg-purple-50 text-purple-600 px-2 py-0.5 rounded-full">🎵
|
||||||
|
{{ $client->tiktok_handle }}</span>
|
||||||
@endif
|
@endif
|
||||||
@if($client->youtube_handle)
|
@if($client->youtube_handle)
|
||||||
<span class="text-xs bg-red-50 text-red-600 px-2 py-0.5 rounded-full">▶️ {{ $client->youtube_handle }}</span>
|
<span class="text-xs bg-red-50 text-red-600 px-2 py-0.5 rounded-full">▶️
|
||||||
|
{{ $client->youtube_handle }}</span>
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -139,8 +139,10 @@
|
|||||||
|
|
||||||
@if($client->email || $client->city)
|
@if($client->email || $client->city)
|
||||||
<div class="text-xs text-gray-400 space-y-0.5">
|
<div class="text-xs text-gray-400 space-y-0.5">
|
||||||
@if($client->email) <div class="truncate">✉️ {{ $client->email }}</div> @endif
|
@if($client->email)
|
||||||
@if($client->city) <div>📍 {{ $client->city }}{{ $client->country ? ', '.$client->country : '' }}</div> @endif
|
<div class="truncate">✉️ {{ $client->email }}</div> @endif
|
||||||
|
@if($client->city)
|
||||||
|
<div>📍 {{ $client->city }}{{ $client->country ? ', ' . $client->country : '' }}</div> @endif
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@@ -171,17 +173,17 @@
|
|||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
@endforelse
|
@endforelse
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{ $clients->links() }}
|
{{ $clients->links() }}
|
||||||
|
|
||||||
@push('scripts')
|
@push('scripts')
|
||||||
<script>
|
<script>
|
||||||
function filterClients(query) {
|
function filterClients(query) {
|
||||||
document.querySelectorAll('#clients-grid > div[data-name]').forEach(card => {
|
document.querySelectorAll('#clients-grid > div[data-name]').forEach(card => {
|
||||||
card.style.display = card.dataset.name.includes(query.toLowerCase()) ? '' : 'none';
|
card.style.display = card.dataset.name.includes(query.toLowerCase()) ? '' : 'none';
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@endpush
|
@endpush
|
||||||
@endsection
|
@endsection
|
||||||
@@ -62,7 +62,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<label class="block text-sm font-semibold text-gray-700 mb-1">Target Date</label>
|
<label class="block text-sm font-semibold text-gray-700 mb-1">Target Date</label>
|
||||||
<input type="date" name="target_date" value="{{ old('target_date') }}" class="input-soft">
|
<input type="date" name="target_date" value="{{ old('target_date') }}" class="input-soft" @change="checkContract()">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -116,7 +116,8 @@
|
|||||||
|
|
||||||
<div class="flex flex-col sm:flex-row gap-3 pt-1">
|
<div class="flex flex-col sm:flex-row gap-3 pt-1">
|
||||||
<button type="submit" class="btn-sakura flex-1 py-3"
|
<button type="submit" class="btn-sakura flex-1 py-3"
|
||||||
:class="{ 'opacity-50 cursor-not-allowed': contractWarning }">🎬 Create Brief</button>
|
:class="{ 'opacity-50 cursor-not-allowed': contractWarning }"
|
||||||
|
:disabled="contractWarning">🎬 Create Brief</button>
|
||||||
<a href="{{ route('content.index') }}"
|
<a href="{{ route('content.index') }}"
|
||||||
class="flex-1 py-3 text-center rounded-full border border-pink-200 text-gray-600 hover:bg-pink-50 font-semibold text-sm">
|
class="flex-1 py-3 text-center rounded-full border border-pink-200 text-gray-600 hover:bg-pink-50 font-semibold text-sm">
|
||||||
Cancel
|
Cancel
|
||||||
@@ -135,16 +136,35 @@ function contractCheck(checkUrl) {
|
|||||||
contractMessage: '',
|
contractMessage: '',
|
||||||
async checkContract() {
|
async checkContract() {
|
||||||
if (!this.categoryId) { this.contractWarning = false; return; }
|
if (!this.categoryId) { this.contractWarning = false; return; }
|
||||||
const params = new URLSearchParams({ category_id: this.categoryId, client_id: this.clientId || '' });
|
let dateVal = '';
|
||||||
|
const targetDateEl = document.querySelector('input[name="target_date"]');
|
||||||
|
if (targetDateEl && targetDateEl.value) {
|
||||||
|
dateVal = targetDateEl.value;
|
||||||
|
}
|
||||||
|
if (!dateVal) {
|
||||||
|
this.contractWarning = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const params = new URLSearchParams({
|
||||||
|
category_id: this.categoryId,
|
||||||
|
client_id: this.clientId || '',
|
||||||
|
date: dateVal
|
||||||
|
});
|
||||||
|
try {
|
||||||
const res = await fetch(checkUrl + '?' + params);
|
const res = await fetch(checkUrl + '?' + params);
|
||||||
|
if (!res.ok) throw new Error('Network error');
|
||||||
const data = await res.json();
|
const data = await res.json();
|
||||||
if (data) {
|
if (data && data.title) {
|
||||||
this.contractWarning = true;
|
this.contractWarning = true;
|
||||||
this.contractMessage = `"${data.title}" — ${data.client_name} holds exclusive rights in the ${data.category} category until ${data.end_date} (${data.days_left} days left).`;
|
this.contractMessage = `"${data.title}" — ${data.client_name} holds exclusive rights in the ${data.category} category until ${data.end_date} (${data.days_left} days left).`;
|
||||||
} else {
|
} else {
|
||||||
this.contractWarning = false;
|
this.contractWarning = false;
|
||||||
this.contractMessage = '';
|
this.contractMessage = '';
|
||||||
}
|
}
|
||||||
|
} catch (e) {
|
||||||
|
this.contractWarning = false;
|
||||||
|
this.contractMessage = '';
|
||||||
|
}
|
||||||
},
|
},
|
||||||
submitIfClear(form) {
|
submitIfClear(form) {
|
||||||
if (this.contractWarning) {
|
if (this.contractWarning) {
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<label class="block text-xs font-semibold text-gray-600 mb-1">Contract Title <span class="text-pink-400">*</span></label>
|
<label class="block text-xs font-semibold text-gray-600 mb-1">Contract Title <span class="text-pink-400">*</span></label>
|
||||||
<input type="text" name="title" required maxlength="255"
|
<input type="text" name="title" required maxlength="255"
|
||||||
placeholder="e.g. Exclusive – Energy Drinks 2025"
|
placeholder="e.g. Exclusive – Susu Formula 2026"
|
||||||
class="input-soft" value="{{ old('title') }}">
|
class="input-soft" value="{{ old('title') }}">
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@@ -6,8 +6,8 @@
|
|||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
|
|
||||||
{{-- ── Today's Schedule (TOP) ───────────────────────────────── --}}
|
{{-- ── Today's Schedule (TOP) ───────────────────────────────── --}}
|
||||||
<div class="cat-card p-4 lg:p-6 mb-4">
|
<div class="cat-card p-4 lg:p-6 mb-4">
|
||||||
<div class="flex items-center justify-between mb-4">
|
<div class="flex items-center justify-between mb-4">
|
||||||
<h2 class="text-sm lg:text-base font-bold text-gray-700 flex items-center gap-2">
|
<h2 class="text-sm lg:text-base font-bold text-gray-700 flex items-center gap-2">
|
||||||
<span>📅</span> Today's Schedule
|
<span>📅</span> Today's Schedule
|
||||||
@@ -23,7 +23,8 @@
|
|||||||
@if($activity['priority'])<span class="text-amber-400 text-xs">⭐</span>@endif
|
@if($activity['priority'])<span class="text-amber-400 text-xs">⭐</span>@endif
|
||||||
<span class="text-base shrink-0">{{ $activity['icon'] }}</span>
|
<span class="text-base shrink-0">{{ $activity['icon'] }}</span>
|
||||||
<span class="font-semibold text-gray-800 text-sm truncate">{{ $activity['title'] }}</span>
|
<span class="font-semibold text-gray-800 text-sm truncate">{{ $activity['title'] }}</span>
|
||||||
<span class="text-xs px-2 py-0.5 rounded-full bg-pink-50 text-pink-600 shrink-0 capitalize">{{ $activity['label'] }}</span>
|
<span
|
||||||
|
class="text-xs px-2 py-0.5 rounded-full bg-pink-50 text-pink-600 shrink-0 capitalize">{{ $activity['label'] }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-xs text-gray-500 mt-0.5">{{ $activity['subtitle'] }}</div>
|
<div class="text-xs text-gray-500 mt-0.5">{{ $activity['subtitle'] }}</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -42,10 +43,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endforelse
|
@endforelse
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{-- ── Stat Pills (BELOW schedule) ─────────────────────────── --}}
|
{{-- ── Stat Pills (BELOW schedule) ─────────────────────────── --}}
|
||||||
<div class="grid grid-cols-2 sm:grid-cols-4 gap-3 mb-4">
|
<div class="grid grid-cols-2 sm:grid-cols-4 gap-3 mb-4">
|
||||||
<a href="{{ route('clients.index') }}" class="stat-pill hover:shadow-md transition-shadow">
|
<a href="{{ route('clients.index') }}" class="stat-pill hover:shadow-md transition-shadow">
|
||||||
<div class="text-2xl lg:text-3xl font-extrabold text-pink-500">{{ $stats['total_clients'] }}</div>
|
<div class="text-2xl lg:text-3xl font-extrabold text-pink-500">{{ $stats['total_clients'] }}</div>
|
||||||
<div class="text-xs lg:text-sm font-semibold text-gray-600">Total Clients</div>
|
<div class="text-xs lg:text-sm font-semibold text-gray-600">Total Clients</div>
|
||||||
@@ -68,10 +69,10 @@
|
|||||||
<div class="text-xs lg:text-sm font-semibold text-gray-600">Revenue (Paid)</div>
|
<div class="text-xs lg:text-sm font-semibold text-gray-600">Revenue (Paid)</div>
|
||||||
<div class="text-xs text-gray-400">All time</div>
|
<div class="text-xs text-gray-400">All time</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{-- ── Secondary Stats ──────────────────────────────────────── --}}
|
{{-- ── Secondary Stats ──────────────────────────────────────── --}}
|
||||||
<div class="grid grid-cols-3 gap-3 mb-4">
|
<div class="grid grid-cols-3 gap-3 mb-4">
|
||||||
<a href="{{ route('client-categories.index') }}" class="stat-pill hover:shadow-md transition-shadow">
|
<a href="{{ route('client-categories.index') }}" class="stat-pill hover:shadow-md transition-shadow">
|
||||||
<div class="text-2xl font-extrabold text-indigo-500">{{ $stats['total_categories'] }}</div>
|
<div class="text-2xl font-extrabold text-indigo-500">{{ $stats['total_categories'] }}</div>
|
||||||
<div class="text-xs font-semibold text-gray-600">Categories</div>
|
<div class="text-xs font-semibold text-gray-600">Categories</div>
|
||||||
@@ -87,11 +88,11 @@
|
|||||||
<div class="text-xs font-semibold text-gray-600">Files Saved</div>
|
<div class="text-xs font-semibold text-gray-600">Files Saved</div>
|
||||||
<div class="text-xs text-gray-400">In file manager</div>
|
<div class="text-xs text-gray-400">In file manager</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{-- ── Bottom Row ───────────────────────────────────────────── --}}
|
|
||||||
<div class="grid grid-cols-1 lg:grid-cols-3 gap-4">
|
|
||||||
|
|
||||||
|
{{-- ── Bottom Row ───────────────────────────────────────────── --}}
|
||||||
|
<div class="grid grid-cols-1 lg:grid-cols-3 gap-4">
|
||||||
|
<!--
|
||||||
{{-- Social Stats --}}
|
{{-- Social Stats --}}
|
||||||
<div class="cat-card p-4 lg:p-5">
|
<div class="cat-card p-4 lg:p-5">
|
||||||
<h2 class="text-sm font-bold text-gray-700 flex items-center gap-2 mb-3">
|
<h2 class="text-sm font-bold text-gray-700 flex items-center gap-2 mb-3">
|
||||||
@@ -118,7 +119,7 @@
|
|||||||
</p>
|
</p>
|
||||||
@endforelse
|
@endforelse
|
||||||
</div>
|
</div>
|
||||||
|
-->
|
||||||
{{-- Recent Invoices --}}
|
{{-- Recent Invoices --}}
|
||||||
<div class="cat-card p-4 lg:p-5">
|
<div class="cat-card p-4 lg:p-5">
|
||||||
<div class="flex items-center justify-between mb-3">
|
<div class="flex items-center justify-between mb-3">
|
||||||
@@ -153,6 +154,6 @@
|
|||||||
</div>
|
</div>
|
||||||
<a href="{{ route('content.create') }}" class="btn-sakura text-xs w-full text-center mt-2">+ New Brief</a>
|
<a href="{{ route('content.create') }}" class="btn-sakura text-xs w-full text-center mt-2">+ New Brief</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@endsection
|
@endsection
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<meta name="theme-color" content="#FFB7C5">
|
<meta name="theme-color" content="#FFB7C5">
|
||||||
<title>KOL Manager — Login</title>
|
<title>Cathy's App - Login</title>
|
||||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800&display=swap" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800&display=swap" rel="stylesheet">
|
||||||
@vite(['resources/css/app.css', 'resources/js/app.js'])
|
@vite(['resources/css/app.css', 'resources/js/app.js'])
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
{{-- Logo / header --}}
|
{{-- Logo / header --}}
|
||||||
<div class="text-center mb-8 select-none">
|
<div class="text-center mb-8 select-none">
|
||||||
<div class="text-7xl mb-3 inline-block animate-bounce" style="animation-duration:2s">🐱</div>
|
<div class="text-7xl mb-3 inline-block animate-bounce" style="animation-duration:2s">🐱</div>
|
||||||
<h1 class="text-2xl font-extrabold text-pink-500 leading-tight">KOL Manager</h1>
|
<h1 class="text-2xl font-extrabold text-pink-500 leading-tight">Cathy's App</h1>
|
||||||
<p class="text-sm text-gray-400 mt-1">Your Purr-fect Assistant</p>
|
<p class="text-sm text-gray-400 mt-1">Your Purr-fect Assistant</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
@php
|
@php
|
||||||
@@ -9,73 +10,230 @@
|
|||||||
$g = hexdec(substr($hex, 2, 2));
|
$g = hexdec(substr($hex, 2, 2));
|
||||||
$b = hexdec(substr($hex, 4, 2));
|
$b = hexdec(substr($hex, 4, 2));
|
||||||
// 92% white + 8% accent → very light tint
|
// 92% white + 8% accent → very light tint
|
||||||
$tint = sprintf('#%02X%02X%02X',
|
$tint = sprintf(
|
||||||
(int)(255 * 0.92 + $r * 0.08),
|
'#%02X%02X%02X',
|
||||||
(int)(255 * 0.92 + $g * 0.08),
|
(int) (255 * 0.92 + $r * 0.08),
|
||||||
(int)(255 * 0.92 + $b * 0.08)
|
(int) (255 * 0.92 + $g * 0.08),
|
||||||
|
(int) (255 * 0.92 + $b * 0.08)
|
||||||
);
|
);
|
||||||
// 80% white + 20% accent → medium-light tint (for borders)
|
// 80% white + 20% accent → medium-light tint (for borders)
|
||||||
$tintMid = sprintf('#%02X%02X%02X',
|
$tintMid = sprintf(
|
||||||
(int)(255 * 0.80 + $r * 0.20),
|
'#%02X%02X%02X',
|
||||||
(int)(255 * 0.80 + $g * 0.20),
|
(int) (255 * 0.80 + $r * 0.20),
|
||||||
(int)(255 * 0.80 + $b * 0.20)
|
(int) (255 * 0.80 + $g * 0.20),
|
||||||
|
(int) (255 * 0.80 + $b * 0.20)
|
||||||
);
|
);
|
||||||
@endphp
|
@endphp
|
||||||
<style>
|
<style>
|
||||||
* { margin: 0; padding: 0; box-sizing: border-box; }
|
* {
|
||||||
body { font-family: 'Helvetica', Arial, sans-serif; color: #374151; font-size: 13px; padding: 40px; }
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
font-family: 'Helvetica', Arial, sans-serif;
|
||||||
|
color: #374151;
|
||||||
|
font-size: 13px;
|
||||||
|
padding: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
/* ── Header ───────────────────────────────── */
|
/* ── Header ───────────────────────────────── */
|
||||||
.header-table { width: 100%; margin-bottom: 36px; }
|
.header-table {
|
||||||
.logo-name { font-size: 22px; font-weight: 900; color: {{ $accent }}; }
|
width: 100%;
|
||||||
.logo-sub { font-size: 11px; color: #9CA3AF; margin-top: 3px; }
|
margin-bottom: 36px;
|
||||||
.inv-number { font-size: 22px; font-weight: 700; color: #1F2937; }
|
}
|
||||||
|
|
||||||
|
.logo-name {
|
||||||
|
font-size: 22px;
|
||||||
|
font-weight: 900;
|
||||||
|
color:
|
||||||
|
{{ $accent }}
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
.logo-sub {
|
||||||
|
font-size: 11px;
|
||||||
|
color: #9CA3AF;
|
||||||
|
margin-top: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.inv-number {
|
||||||
|
font-size: 22px;
|
||||||
|
font-weight: 700;
|
||||||
|
color: #1F2937;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* ── Billing grid ─────────────────────────── */
|
/* ── Billing grid ─────────────────────────── */
|
||||||
.billing-table { width: 100%; margin-bottom: 28px; }
|
.billing-table {
|
||||||
.section-title { font-size: 10px; font-weight: 700; color: #9CA3AF;
|
width: 100%;
|
||||||
text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
|
margin-bottom: 28px;
|
||||||
.billing-name { font-weight: 700; font-size: 15px; color: #111827; }
|
}
|
||||||
.billing-detail{ font-size: 12px; color: #6B7280; margin-top: 2px; }
|
|
||||||
.detail-table { font-size: 12px; width: auto; float: right; }
|
.section-title {
|
||||||
.detail-table td { padding: 3px 0; }
|
font-size: 10px;
|
||||||
.detail-table .lbl { color: #9CA3AF; padding-right: 16px; white-space: nowrap; }
|
font-weight: 700;
|
||||||
.detail-table .val { font-weight: 600; text-align: right; white-space: nowrap; }
|
color: #9CA3AF;
|
||||||
|
text-transform: uppercase;
|
||||||
|
letter-spacing: 1px;
|
||||||
|
margin-bottom: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.billing-name {
|
||||||
|
font-weight: 700;
|
||||||
|
font-size: 15px;
|
||||||
|
color: #111827;
|
||||||
|
}
|
||||||
|
|
||||||
|
.billing-detail {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #6B7280;
|
||||||
|
margin-top: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail-table {
|
||||||
|
font-size: 12px;
|
||||||
|
width: auto;
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail-table td {
|
||||||
|
padding: 3px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail-table .lbl {
|
||||||
|
color: #9CA3AF;
|
||||||
|
padding-right: 16px;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail-table .val {
|
||||||
|
font-weight: 600;
|
||||||
|
text-align: right;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
/* ── Line items ───────────────────────────── */
|
/* ── Line items ───────────────────────────── */
|
||||||
table.items { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
|
table.items {
|
||||||
table.items thead td { background: {{ $tint }}; padding: 10px 12px;
|
width: 100%;
|
||||||
font-size: 10px; font-weight: 700; color: #9CA3AF; text-transform: uppercase; }
|
border-collapse: collapse;
|
||||||
table.items tbody td { padding: 10px 12px; border-bottom: 1px solid {{ $tintMid }}; font-size: 12px; }
|
margin-bottom: 20px;
|
||||||
.td-right { text-align: right; }
|
}
|
||||||
.td-center { text-align: center; }
|
|
||||||
|
table.items thead td {
|
||||||
|
background:
|
||||||
|
{{ $tint }}
|
||||||
|
;
|
||||||
|
padding: 10px 12px;
|
||||||
|
font-size: 10px;
|
||||||
|
font-weight: 700;
|
||||||
|
color: #9CA3AF;
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.items tbody td {
|
||||||
|
padding: 10px 12px;
|
||||||
|
border-bottom: 1px solid
|
||||||
|
{{ $tintMid }}
|
||||||
|
;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.td-right {
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.td-center {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
/* ── Totals ───────────────────────────────── */
|
/* ── Totals ───────────────────────────────── */
|
||||||
.totals-wrap { width: 100%; margin-bottom: 24px; }
|
.totals-wrap {
|
||||||
.totals-inner { width: 260px; float: right; }
|
width: 100%;
|
||||||
.totals-inner table { width: 100%; font-size: 12px; border-collapse: collapse; }
|
margin-bottom: 24px;
|
||||||
.totals-inner table td { padding: 4px 0; }
|
}
|
||||||
.totals-inner table td.amount { text-align: right; font-weight: 600; }
|
|
||||||
.totals-total td { border-top: 2px solid {{ $accent }};
|
.totals-inner {
|
||||||
padding-top: 8px !important; margin-top: 6px;
|
width: 260px;
|
||||||
font-size: 15px; font-weight: 800; color: {{ $accent }}; }
|
float: right;
|
||||||
.clearfix::after { content: ""; display: table; clear: both; }
|
}
|
||||||
|
|
||||||
|
.totals-inner table {
|
||||||
|
width: 100%;
|
||||||
|
font-size: 12px;
|
||||||
|
border-collapse: collapse;
|
||||||
|
}
|
||||||
|
|
||||||
|
.totals-inner table td {
|
||||||
|
padding: 4px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.totals-inner table td.amount {
|
||||||
|
text-align: right;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.totals-total td {
|
||||||
|
border-top: 2px solid
|
||||||
|
{{ $accent }}
|
||||||
|
;
|
||||||
|
padding-top: 8px !important;
|
||||||
|
margin-top: 6px;
|
||||||
|
font-size: 15px;
|
||||||
|
font-weight: 800;
|
||||||
|
color:
|
||||||
|
{{ $accent }}
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
.clearfix::after {
|
||||||
|
content: "";
|
||||||
|
display: table;
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
|
||||||
/* ── Payment info ─────────────────────────── */
|
/* ── Payment info ─────────────────────────── */
|
||||||
.bank-box { background: {{ $tint }}; border-radius: 10px;
|
.bank-box {
|
||||||
padding: 14px 16px; margin-bottom: 16px; }
|
background:
|
||||||
.bank-title { font-weight: 700; font-size: 12px; color: #374151; margin-bottom: 4px; }
|
{{ $tint }}
|
||||||
.bank-detail { font-size: 12px; color: #6B7280; }
|
;
|
||||||
|
border-radius: 10px;
|
||||||
|
padding: 14px 16px;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
.notes { font-size: 11px; color: #9CA3AF; font-style: italic; }
|
.bank-title {
|
||||||
.footer { margin-top: 40px; text-align: center; font-size: 11px; color: #D1D5DB; }
|
font-weight: 700;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #374151;
|
||||||
|
margin-bottom: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bank-detail {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #6B7280;
|
||||||
|
}
|
||||||
|
|
||||||
|
.notes {
|
||||||
|
font-size: 11px;
|
||||||
|
color: #9CA3AF;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer {
|
||||||
|
margin-top: 40px;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 11px;
|
||||||
|
color: #D1D5DB;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
{{-- ── Header ─────────────────────────────────────────────────── --}}
|
{{-- ── Header ─────────────────────────────────────────────────── --}}
|
||||||
<table class="header-table" cellpadding="0" cellspacing="0">
|
<table class="header-table" cellpadding="0" cellspacing="0">
|
||||||
<tr>
|
<tr>
|
||||||
<td style="vertical-align:middle;">
|
<td style="vertical-align:middle;">
|
||||||
<table cellpadding="0" cellspacing="0">
|
<table cellpadding="0" cellspacing="0">
|
||||||
@@ -83,12 +241,14 @@
|
|||||||
@if($invoiceSettings->header_logo && file_exists(storage_path('app/public/' . $invoiceSettings->header_logo)))
|
@if($invoiceSettings->header_logo && file_exists(storage_path('app/public/' . $invoiceSettings->header_logo)))
|
||||||
<td style="vertical-align:middle; padding-right:12px; width:64px;">
|
<td style="vertical-align:middle; padding-right:12px; width:64px;">
|
||||||
<img src="{{ storage_path('app/public/' . $invoiceSettings->header_logo) }}"
|
<img src="{{ storage_path('app/public/' . $invoiceSettings->header_logo) }}"
|
||||||
style="width:52px; height:52px; object-fit:cover; border-radius:12px; display:block;" alt="Logo">
|
style="width:52px; height:52px; object-fit:cover; border-radius:12px; display:block;"
|
||||||
|
alt="Logo">
|
||||||
</td>
|
</td>
|
||||||
@endif
|
@endif
|
||||||
<td style="vertical-align:middle;">
|
<td style="vertical-align:middle;">
|
||||||
<div class="logo-name">{{ $invoiceSettings->header_name ?: 'KOL Manager' }}</div>
|
<div class="logo-name">{{ $invoiceSettings->header_name ?: 'Cathy' }}</div>
|
||||||
<div class="logo-sub">{{ $invoiceSettings->header_title ?: 'Personal Talent Assistant' }}</div>
|
<div class="logo-sub">{{ $invoiceSettings->header_title ?: 'Personal Talent Assistant' }}
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@@ -97,18 +257,21 @@
|
|||||||
<div class="inv-number">{{ $invoice->invoice_number }}</div>
|
<div class="inv-number">{{ $invoice->invoice_number }}</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
{{-- ── Billing Info ─────────────────────────────────────────────── --}}
|
{{-- ── Billing Info ─────────────────────────────────────────────── --}}
|
||||||
<table class="billing-table" cellpadding="0" cellspacing="0">
|
<table class="billing-table" cellpadding="0" cellspacing="0">
|
||||||
<tr>
|
<tr>
|
||||||
<td style="width:50%; vertical-align:top; padding-right:24px;">
|
<td style="width:50%; vertical-align:top; padding-right:24px;">
|
||||||
<div class="section-title">Bill To</div>
|
<div class="section-title">Bill To</div>
|
||||||
@if($invoice->client)
|
@if($invoice->client)
|
||||||
<div class="billing-name">{{ $invoice->client->name }}</div>
|
<div class="billing-name">{{ $invoice->client->name }}</div>
|
||||||
@if($invoice->client->company) <div class="billing-detail">{{ $invoice->client->company }}</div> @endif
|
@if($invoice->client->company)
|
||||||
@if($invoice->client->email) <div class="billing-detail">{{ $invoice->client->email }}</div> @endif
|
<div class="billing-detail">{{ $invoice->client->company }}</div> @endif
|
||||||
@if($invoice->client->full_address) <div class="billing-detail">{{ $invoice->client->full_address }}</div> @endif
|
@if($invoice->client->email)
|
||||||
|
<div class="billing-detail">{{ $invoice->client->email }}</div> @endif
|
||||||
|
@if($invoice->client->full_address)
|
||||||
|
<div class="billing-detail">{{ $invoice->client->full_address }}</div> @endif
|
||||||
@else
|
@else
|
||||||
<div class="billing-detail">—</div>
|
<div class="billing-detail">—</div>
|
||||||
@endif
|
@endif
|
||||||
@@ -116,18 +279,27 @@
|
|||||||
<td style="width:50%; vertical-align:top; text-align:right;">
|
<td style="width:50%; vertical-align:top; text-align:right;">
|
||||||
<div class="section-title">Invoice Details</div>
|
<div class="section-title">Invoice Details</div>
|
||||||
<table class="detail-table" cellpadding="0" cellspacing="0">
|
<table class="detail-table" cellpadding="0" cellspacing="0">
|
||||||
<tr><td class="lbl">Issue Date</td><td class="val">{{ $invoice->issue_date->format('d M Y') }}</td></tr>
|
<tr>
|
||||||
<tr><td class="lbl">Due Date</td><td class="val">{{ $invoice->due_date->format('d M Y') }}</td></tr>
|
<td class="lbl">Issue Date</td>
|
||||||
|
<td class="val">{{ $invoice->issue_date->format('d M Y') }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="lbl">Due Date</td>
|
||||||
|
<td class="val">{{ $invoice->due_date->format('d M Y') }}</td>
|
||||||
|
</tr>
|
||||||
@if($invoice->paid_date)
|
@if($invoice->paid_date)
|
||||||
<tr><td class="lbl">Paid Date</td><td class="val">{{ $invoice->paid_date->format('d M Y') }}</td></tr>
|
<tr>
|
||||||
|
<td class="lbl">Paid Date</td>
|
||||||
|
<td class="val">{{ $invoice->paid_date->format('d M Y') }}</td>
|
||||||
|
</tr>
|
||||||
@endif
|
@endif
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
{{-- ── Line Items ───────────────────────────────────────────────── --}}
|
{{-- ── Line Items ───────────────────────────────────────────────── --}}
|
||||||
<table class="items" cellpadding="0" cellspacing="0">
|
<table class="items" cellpadding="0" cellspacing="0">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<td style="width:50%;">Description</td>
|
<td style="width:50%;">Description</td>
|
||||||
@@ -142,7 +314,8 @@
|
|||||||
<td>
|
<td>
|
||||||
{{ $item->description }}
|
{{ $item->description }}
|
||||||
@if(!$item->is_taxable)
|
@if(!$item->is_taxable)
|
||||||
<span style="margin-left:6px; font-size:10px; background:#F3F4F6; color:#6B7280; padding:2px 8px; border-radius:10px; font-weight:600;">Non-Taxable</span>
|
<span
|
||||||
|
style="margin-left:6px; font-size:10px; background:#F3F4F6; color:#6B7280; padding:2px 8px; border-radius:10px; font-weight:600;">Non-Taxable</span>
|
||||||
@endif
|
@endif
|
||||||
</td>
|
</td>
|
||||||
<td class="td-center">{{ $item->quantity }}</td>
|
<td class="td-center">{{ $item->quantity }}</td>
|
||||||
@@ -151,10 +324,10 @@
|
|||||||
</tr>
|
</tr>
|
||||||
@endforeach
|
@endforeach
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
{{-- ── Totals ───────────────────────────────────────────────────── --}}
|
{{-- ── Totals ───────────────────────────────────────────────────── --}}
|
||||||
<div class="totals-wrap clearfix">
|
<div class="totals-wrap clearfix">
|
||||||
<div class="totals-inner">
|
<div class="totals-inner">
|
||||||
<table cellpadding="0" cellspacing="0">
|
<table cellpadding="0" cellspacing="0">
|
||||||
<tr>
|
<tr>
|
||||||
@@ -164,7 +337,8 @@
|
|||||||
@if($invoice->tax_rate > 0)
|
@if($invoice->tax_rate > 0)
|
||||||
<tr>
|
<tr>
|
||||||
<td style="color:#D97706;">Tax ({{ $invoice->tax_rate }}% — paid by client)</td>
|
<td style="color:#D97706;">Tax ({{ $invoice->tax_rate }}% — paid by client)</td>
|
||||||
<td class="amount" style="color:#D97706;">Rp {{ number_format($invoice->tax_amount, 0, ',', '.') }}</td>
|
<td class="amount" style="color:#D97706;">Rp {{ number_format($invoice->tax_amount, 0, ',', '.') }}
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@endif
|
@endif
|
||||||
<tr class="totals-total">
|
<tr class="totals-total">
|
||||||
@@ -173,25 +347,26 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{-- ── Payment Info ──────────────────────────────────────────────── --}}
|
{{-- ── Payment Info ──────────────────────────────────────────────── --}}
|
||||||
@if($invoice->bank_name)
|
@if($invoice->bank_name)
|
||||||
<div class="bank-box">
|
<div class="bank-box">
|
||||||
<div class="bank-title">Payment Information</div>
|
<div class="bank-title">Payment Information</div>
|
||||||
<div class="bank-detail">
|
<div class="bank-detail">
|
||||||
{{ $invoice->bank_name }}
|
{{ $invoice->bank_name }}
|
||||||
@if($invoice->branch_name) · {{ $invoice->branch_name }} @endif
|
@if($invoice->branch_name) · {{ $invoice->branch_name }} @endif
|
||||||
· {{ $invoice->bank_account }} · a/n {{ $invoice->bank_holder }}
|
· {{ $invoice->bank_account }} · a/n {{ $invoice->bank_holder }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@if($invoice->notes)
|
@if($invoice->notes)
|
||||||
<div class="notes">{{ $invoice->notes }}</div>
|
<div class="notes">{{ $invoice->notes }}</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
<div class="footer">Generated by KOL Manager · Thank you for the collaboration!</div>
|
<div class="footer">Thank you for the collaboration!</div>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<div class="text-xl font-extrabold"
|
<div class="text-xl font-extrabold"
|
||||||
style="color:{{ $invoiceSettings->accent_color ?? '#FFB7C5' }}">
|
style="color:{{ $invoiceSettings->accent_color ?? '#FFB7C5' }}">
|
||||||
{{ $invoiceSettings->header_name ?: '🐱 KOL Manager' }}
|
{{ $invoiceSettings->header_name ?: '🐱 Cathy' }}
|
||||||
</div>
|
</div>
|
||||||
<div class="text-sm text-gray-400 mt-0.5">
|
<div class="text-sm text-gray-400 mt-0.5">
|
||||||
{{ $invoiceSettings->header_title ?: 'Personal Talent Assistant' }}
|
{{ $invoiceSettings->header_title ?: 'Personal Talent Assistant' }}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en" data-theme="light">
|
<html lang="en" data-theme="light">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
|
||||||
@@ -15,122 +16,103 @@
|
|||||||
<link href="https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800&display=swap" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800&display=swap" rel="stylesheet">
|
||||||
@vite(['resources/css/app.css', 'resources/js/app.js'])
|
@vite(['resources/css/app.css', 'resources/js/app.js'])
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="bg-cream font-sans antialiased" x-data="appShell()">
|
<body class="bg-cream font-sans antialiased" x-data="appShell()">
|
||||||
|
|
||||||
{{-- ── Backdrop (mobile only) ─────────────────────────────────── --}}
|
{{-- ── Backdrop (mobile only) ─────────────────────────────────── --}}
|
||||||
<div
|
<div x-show="sidebarOpen" x-transition:enter="transition-opacity duration-300" x-transition:enter-start="opacity-0"
|
||||||
x-show="sidebarOpen"
|
x-transition:enter-end="opacity-100" x-transition:leave="transition-opacity duration-300"
|
||||||
x-transition:enter="transition-opacity duration-300"
|
x-transition:leave-start="opacity-100" x-transition:leave-end="opacity-0" @click="sidebarOpen = false"
|
||||||
x-transition:enter-start="opacity-0"
|
class="fixed inset-0 z-30 bg-black/40 lg:hidden" style="display:none"></div>
|
||||||
x-transition:enter-end="opacity-100"
|
|
||||||
x-transition:leave="transition-opacity duration-300"
|
|
||||||
x-transition:leave-start="opacity-100"
|
|
||||||
x-transition:leave-end="opacity-0"
|
|
||||||
@click="sidebarOpen = false"
|
|
||||||
class="fixed inset-0 z-30 bg-black/40 lg:hidden"
|
|
||||||
style="display:none"
|
|
||||||
></div>
|
|
||||||
|
|
||||||
{{-- ── Sidebar ─────────────────────────────────────────────────── --}}
|
{{-- ── Sidebar ─────────────────────────────────────────────────── --}}
|
||||||
<aside
|
<aside :class="sidebarOpen ? 'translate-x-0' : '-translate-x-full'" class="fixed inset-y-0 left-0 z-40 w-64 bg-white border-r border-pink-100 shadow-lg
|
||||||
:class="sidebarOpen ? 'translate-x-0' : '-translate-x-full'"
|
|
||||||
class="fixed inset-y-0 left-0 z-40 w-64 bg-white border-r border-pink-100 shadow-lg
|
|
||||||
flex flex-col py-6 px-4
|
flex flex-col py-6 px-4
|
||||||
transition-transform duration-300 ease-in-out
|
transition-transform duration-300 ease-in-out
|
||||||
lg:translate-x-0"
|
lg:translate-x-0">
|
||||||
>
|
|
||||||
{{-- Logo --}}
|
{{-- Logo --}}
|
||||||
<div class="flex items-center justify-between gap-3 mb-8 px-2">
|
<div class="flex items-center justify-between gap-3 mb-8 px-2">
|
||||||
<a href="{{ route('dashboard') }}" @click="sidebarOpen = false"
|
<a href="{{ route('dashboard') }}" @click="sidebarOpen = false"
|
||||||
class="flex items-center gap-3 group focus:outline-none">
|
class="flex items-center gap-3 group focus:outline-none">
|
||||||
<span class="text-3xl transition-transform duration-200 group-hover:scale-110 group-active:scale-95 select-none">🐱</span>
|
<span
|
||||||
|
class="text-3xl transition-transform duration-200 group-hover:scale-110 group-active:scale-95 select-none">🐱</span>
|
||||||
<div class="text-left">
|
<div class="text-left">
|
||||||
<div class="text-lg font-extrabold text-pink-500 leading-tight">KOL Manager</div>
|
<div class="text-lg font-extrabold text-pink-500 leading-tight">Cathy's App</div>
|
||||||
<div class="text-xs text-gray-400">Your Purr-fect Assistant</div>
|
<div class="text-xs text-gray-400">Your Purr-fect Assistant</div>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
<button @click="sidebarOpen = false" class="lg:hidden text-gray-400 hover:text-pink-500 text-xl leading-none" aria-label="Close">✕</button>
|
<button @click="sidebarOpen = false"
|
||||||
|
class="lg:hidden text-gray-400 hover:text-pink-500 text-xl leading-none" aria-label="Close">✕</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{-- Nav --}}
|
{{-- Nav --}}
|
||||||
<nav class="flex flex-col gap-1 flex-1 overflow-y-auto">
|
<nav class="flex flex-col gap-1 flex-1 overflow-y-auto">
|
||||||
<a href="{{ route('dashboard') }}"
|
<a href="{{ route('dashboard') }}" @click="sidebarOpen = false"
|
||||||
@click="sidebarOpen = false"
|
|
||||||
class="nav-item {{ request()->routeIs('dashboard') ? 'active' : '' }}">
|
class="nav-item {{ request()->routeIs('dashboard') ? 'active' : '' }}">
|
||||||
<span class="text-lg shrink-0">🏠</span> Dashboard
|
<span class="text-lg shrink-0">🏠</span> Dashboard
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<div class="text-xs font-bold text-gray-400 uppercase tracking-wider mt-4 mb-1 px-2">Manage</div>
|
<div class="text-xs font-bold text-gray-400 uppercase tracking-wider mt-4 mb-1 px-2">Manage</div>
|
||||||
|
|
||||||
<a href="{{ route('schedule.index') }}"
|
<a href="{{ route('schedule.index') }}" @click="sidebarOpen = false"
|
||||||
@click="sidebarOpen = false"
|
|
||||||
class="nav-item {{ request()->routeIs('schedule.*') ? 'active' : '' }}">
|
class="nav-item {{ request()->routeIs('schedule.*') ? 'active' : '' }}">
|
||||||
<span class="text-lg shrink-0">📅</span>
|
<span class="text-lg shrink-0">📅</span>
|
||||||
<span class="flex-1">Schedule</span>
|
<span class="flex-1">Schedule</span>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<a href="{{ route('clients.index') }}"
|
<a href="{{ route('clients.index') }}" @click="sidebarOpen = false"
|
||||||
@click="sidebarOpen = false"
|
|
||||||
class="nav-item {{ request()->routeIs('clients.*') ? 'active' : '' }}">
|
class="nav-item {{ request()->routeIs('clients.*') ? 'active' : '' }}">
|
||||||
<span class="text-lg shrink-0">👥</span> Clients / CRM
|
<span class="text-lg shrink-0">👥</span> Clients
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<a href="{{ route('client-categories.index') }}"
|
<a href="{{ route('client-categories.index') }}" @click="sidebarOpen = false"
|
||||||
@click="sidebarOpen = false"
|
|
||||||
class="nav-item {{ request()->routeIs('client-categories.*') ? 'active' : '' }}">
|
class="nav-item {{ request()->routeIs('client-categories.*') ? 'active' : '' }}">
|
||||||
<span class="text-lg shrink-0">🏷️</span> Categories
|
<span class="text-lg shrink-0">🏷️</span> Categories
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<a href="{{ route('contracts.index') }}"
|
<a href="{{ route('contracts.index') }}" @click="sidebarOpen = false"
|
||||||
@click="sidebarOpen = false"
|
|
||||||
class="nav-item {{ request()->routeIs('contracts.*') ? 'active' : '' }}">
|
class="nav-item {{ request()->routeIs('contracts.*') ? 'active' : '' }}">
|
||||||
<span class="text-lg shrink-0">📋</span> Brand Contracts
|
<span class="text-lg shrink-0">📋</span> Brand Contracts
|
||||||
</a>
|
</a>
|
||||||
|
<!--
|
||||||
<a href="{{ route('social-hub.index') }}"
|
<a href="{{ route('social-hub.index') }}"
|
||||||
@click="sidebarOpen = false"
|
@click="sidebarOpen = false"
|
||||||
class="nav-item {{ request()->routeIs('social-hub.*') ? 'active' : '' }}">
|
class="nav-item {{ request()->routeIs('social-hub.*') ? 'active' : '' }}">
|
||||||
<span class="text-lg shrink-0">📱</span> Social Hub
|
<span class="text-lg shrink-0">📱</span> Social Hub
|
||||||
</a>
|
</a>
|
||||||
|
-->
|
||||||
<div class="text-xs font-bold text-gray-400 uppercase tracking-wider mt-4 mb-1 px-2">Finance</div>
|
<div class="text-xs font-bold text-gray-400 uppercase tracking-wider mt-4 mb-1 px-2">Finance</div>
|
||||||
|
|
||||||
<a href="{{ route('invoices.index') }}"
|
<a href="{{ route('invoices.index') }}" @click="sidebarOpen = false"
|
||||||
@click="sidebarOpen = false"
|
|
||||||
class="nav-item {{ request()->routeIs('invoices.*') ? 'active' : '' }}">
|
class="nav-item {{ request()->routeIs('invoices.*') ? 'active' : '' }}">
|
||||||
<span class="text-lg shrink-0">🧾</span> Invoices
|
<span class="text-lg shrink-0">🧾</span> Invoices
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<a href="{{ route('rate-cards.index') }}"
|
<a href="{{ route('rate-cards.index') }}" @click="sidebarOpen = false"
|
||||||
@click="sidebarOpen = false"
|
|
||||||
class="nav-item {{ request()->routeIs('rate-cards.*') ? 'active' : '' }}">
|
class="nav-item {{ request()->routeIs('rate-cards.*') ? 'active' : '' }}">
|
||||||
<span class="text-lg shrink-0">💰</span> Rate Cards
|
<span class="text-lg shrink-0">💰</span> Rate Cards
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<div class="text-xs font-bold text-gray-400 uppercase tracking-wider mt-4 mb-1 px-2">Content</div>
|
<div class="text-xs font-bold text-gray-400 uppercase tracking-wider mt-4 mb-1 px-2">Content</div>
|
||||||
|
|
||||||
<a href="{{ route('content.index') }}"
|
<a href="{{ route('content.index') }}" @click="sidebarOpen = false"
|
||||||
@click="sidebarOpen = false"
|
|
||||||
class="nav-item {{ request()->routeIs('content.*') ? 'active' : '' }}">
|
class="nav-item {{ request()->routeIs('content.*') ? 'active' : '' }}">
|
||||||
<span class="text-lg shrink-0">🎬</span> Content Board
|
<span class="text-lg shrink-0">🎬</span> Content Board
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<a href="{{ route('files.index') }}"
|
<a href="{{ route('files.index') }}" @click="sidebarOpen = false"
|
||||||
@click="sidebarOpen = false"
|
|
||||||
class="nav-item {{ request()->routeIs('files.*') ? 'active' : '' }}">
|
class="nav-item {{ request()->routeIs('files.*') ? 'active' : '' }}">
|
||||||
<span class="text-lg shrink-0">📁</span> Files
|
<span class="text-lg shrink-0">📁</span> Files
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<a href="{{ route('notes.index') }}"
|
<a href="{{ route('notes.index') }}" @click="sidebarOpen = false"
|
||||||
@click="sidebarOpen = false"
|
|
||||||
class="nav-item {{ request()->routeIs('notes.*') ? 'active' : '' }}">
|
class="nav-item {{ request()->routeIs('notes.*') ? 'active' : '' }}">
|
||||||
<span class="text-lg shrink-0">📝</span> Notes
|
<span class="text-lg shrink-0">📝</span> Notes
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<div class="text-xs font-bold text-gray-400 uppercase tracking-wider mt-4 mb-1 px-2">Settings</div>
|
<div class="text-xs font-bold text-gray-400 uppercase tracking-wider mt-4 mb-1 px-2">Settings</div>
|
||||||
|
|
||||||
<a href="{{ route('settings.notifications') }}"
|
<a href="{{ route('settings.notifications') }}" @click="sidebarOpen = false"
|
||||||
@click="sidebarOpen = false"
|
|
||||||
class="nav-item {{ request()->routeIs('settings.*') ? 'active' : '' }}">
|
class="nav-item {{ request()->routeIs('settings.*') ? 'active' : '' }}">
|
||||||
<span class="text-lg shrink-0">🔔</span> Notifications
|
<span class="text-lg shrink-0">🔔</span> Notifications
|
||||||
</a>
|
</a>
|
||||||
@@ -144,56 +126,50 @@
|
|||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
</nav>
|
</nav>
|
||||||
</aside>
|
</aside>
|
||||||
|
|
||||||
{{-- ── Main wrapper ─────────────────────────────────────────────── --}}
|
{{-- ── Main wrapper ─────────────────────────────────────────────── --}}
|
||||||
<div class="min-h-screen flex flex-col lg:ml-64">
|
<div class="min-h-screen flex flex-col lg:ml-64">
|
||||||
|
|
||||||
<div class="flex-1 flex flex-col min-w-0">
|
<div class="flex-1 flex flex-col min-w-0">
|
||||||
|
|
||||||
{{-- ── Topbar ───────────────────────────────────────────── --}}
|
{{-- ── Topbar ───────────────────────────────────────────── --}}
|
||||||
<header class="sticky top-0 z-20 bg-white border-b border-pink-100 px-4 lg:px-8 py-3 lg:py-4 flex items-center gap-3 shadow-sm">
|
<header
|
||||||
|
class="sticky top-0 z-20 bg-white border-b border-pink-100 px-4 lg:px-8 py-3 lg:py-4 flex items-center gap-3 shadow-sm">
|
||||||
|
|
||||||
{{-- Hamburger (mobile) --}}
|
{{-- Hamburger (mobile) --}}
|
||||||
<button
|
<button @click="sidebarOpen = true"
|
||||||
@click="sidebarOpen = true"
|
|
||||||
class="lg:hidden text-2xl transition-transform duration-150 active:scale-90 focus:outline-none select-none"
|
class="lg:hidden text-2xl transition-transform duration-150 active:scale-90 focus:outline-none select-none"
|
||||||
aria-label="Open menu"
|
aria-label="Open menu">🐱</button>
|
||||||
>🐱</button>
|
|
||||||
|
|
||||||
{{-- Page title (hidden when search open) --}}
|
{{-- Page title (hidden when search open) --}}
|
||||||
<div class="flex-1 min-w-0" x-show="!searchOpen" x-transition>
|
<div class="flex-1 min-w-0" x-show="!searchOpen" x-transition>
|
||||||
<h1 class="text-base lg:text-xl font-bold text-gray-800 truncate">@yield('page-title', 'Dashboard')</h1>
|
<h1 class="text-base lg:text-xl font-bold text-gray-800 truncate">@yield('page-title', 'Dashboard')
|
||||||
<p class="text-xs lg:text-sm text-gray-400 hidden sm:block">@yield('page-subtitle', today()->format('l, d F Y'))</p>
|
</h1>
|
||||||
|
<p class="text-xs lg:text-sm text-gray-400 hidden sm:block">
|
||||||
|
@yield('page-subtitle', today()->format('l, d F Y'))</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{-- ── Global Search bar ─────────────────────────── --}}
|
{{-- ── Global Search bar ─────────────────────────── --}}
|
||||||
<div class="flex-1 min-w-0" x-show="searchOpen" x-transition style="display:none">
|
<div class="flex-1 min-w-0" x-show="searchOpen" x-transition style="display:none">
|
||||||
<div class="relative">
|
<div class="relative">
|
||||||
<span class="absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 text-sm pointer-events-none">🔍</span>
|
<span
|
||||||
<input
|
class="absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 text-sm pointer-events-none"></span>
|
||||||
id="global-search-input"
|
<input id="global-search-input" type="text" placeholder="Search clients, events, invoices…"
|
||||||
type="text"
|
class="input-soft pl-9 pr-4 py-2 text-sm w-full" x-model="searchQuery"
|
||||||
placeholder="Search clients, events, invoices…"
|
@input.debounce.300ms="doSearch()" @keydown.escape="closeSearch()" x-ref="searchInput">
|
||||||
class="input-soft pl-9 pr-4 py-2 text-sm w-full"
|
|
||||||
x-model="searchQuery"
|
|
||||||
@input.debounce.300ms="doSearch()"
|
|
||||||
@keydown.escape="closeSearch()"
|
|
||||||
x-ref="searchInput"
|
|
||||||
>
|
|
||||||
{{-- Search results dropdown --}}
|
{{-- Search results dropdown --}}
|
||||||
<div
|
<div x-show="searchResults.length > 0 || (searchQuery.length >= 2 && !searchLoading)"
|
||||||
x-show="searchResults.length > 0 || (searchQuery.length >= 2 && !searchLoading)"
|
|
||||||
class="absolute top-full left-0 right-0 mt-2 bg-white rounded-2xl shadow-xl border border-pink-100 z-50 max-h-80 overflow-y-auto"
|
class="absolute top-full left-0 right-0 mt-2 bg-white rounded-2xl shadow-xl border border-pink-100 z-50 max-h-80 overflow-y-auto"
|
||||||
@click.outside="searchResults = []"
|
@click.outside="searchResults = []">
|
||||||
>
|
|
||||||
<template x-if="searchLoading">
|
<template x-if="searchLoading">
|
||||||
<div class="px-4 py-3 text-sm text-gray-400 flex items-center gap-2">
|
<div class="px-4 py-3 text-sm text-gray-400 flex items-center gap-2">
|
||||||
<span class="animate-spin">🐾</span> Searching…
|
<span class="animate-spin">🐾</span> Searching…
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template x-if="!searchLoading && searchResults.length === 0 && searchQuery.length >= 2">
|
<template x-if="!searchLoading && searchResults.length === 0 && searchQuery.length >= 2">
|
||||||
<div class="px-4 py-3 text-sm text-gray-400">No results for "<span x-text="searchQuery"></span>"</div>
|
<div class="px-4 py-3 text-sm text-gray-400">No results for "<span
|
||||||
|
x-text="searchQuery"></span>"</div>
|
||||||
</template>
|
</template>
|
||||||
<template x-for="group in searchResults" :key="group.type">
|
<template x-for="group in searchResults" :key="group.type">
|
||||||
<div>
|
<div>
|
||||||
@@ -205,8 +181,10 @@
|
|||||||
@click="closeSearch()">
|
@click="closeSearch()">
|
||||||
<span class="text-lg shrink-0" x-text="item.icon"></span>
|
<span class="text-lg shrink-0" x-text="item.icon"></span>
|
||||||
<div class="min-w-0">
|
<div class="min-w-0">
|
||||||
<div class="text-sm font-semibold text-gray-700 truncate" x-text="item.title"></div>
|
<div class="text-sm font-semibold text-gray-700 truncate"
|
||||||
<div class="text-xs text-gray-400 truncate" x-text="item.subtitle"></div>
|
x-text="item.title"></div>
|
||||||
|
<div class="text-xs text-gray-400 truncate" x-text="item.subtitle">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</template>
|
</template>
|
||||||
@@ -226,20 +204,19 @@
|
|||||||
{{-- Right actions --}}
|
{{-- Right actions --}}
|
||||||
<div class="flex items-center gap-2 shrink-0">
|
<div class="flex items-center gap-2 shrink-0">
|
||||||
{{-- Search toggle --}}
|
{{-- Search toggle --}}
|
||||||
<button
|
<button @click="toggleSearch()"
|
||||||
@click="toggleSearch()"
|
|
||||||
class="w-8 h-8 lg:w-9 lg:h-9 rounded-full flex items-center justify-center hover:bg-pink-50 transition-colors text-gray-500 hover:text-pink-500"
|
class="w-8 h-8 lg:w-9 lg:h-9 rounded-full flex items-center justify-center hover:bg-pink-50 transition-colors text-gray-500 hover:text-pink-500"
|
||||||
:title="searchOpen ? 'Close search' : 'Search'"
|
:title="searchOpen ? 'Close search' : 'Search'" aria-label="Toggle search">
|
||||||
aria-label="Toggle search"
|
|
||||||
>
|
|
||||||
<span x-text="searchOpen ? '✕' : '🔍'" class="text-sm lg:text-base"></span>
|
<span x-text="searchOpen ? '✕' : '🔍'" class="text-sm lg:text-base"></span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
<!--
|
||||||
{{-- Avatar --}}
|
{{-- Avatar --}}
|
||||||
<div class="w-8 h-8 lg:w-9 lg:h-9 rounded-full flex items-center justify-center text-white font-bold text-xs lg:text-sm shadow-sm"
|
<div class="w-8 h-8 lg:w-9 lg:h-9 rounded-full flex items-center justify-center text-white font-bold text-xs lg:text-sm shadow-sm"
|
||||||
style="background: linear-gradient(135deg, #FFB7C5, #E8D5F5);">
|
style="background: linear-gradient(135deg, #FFB7C5, #E8D5F5);">
|
||||||
FUN
|
FUN
|
||||||
</div>
|
</div>
|
||||||
|
-->
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
@@ -265,12 +242,12 @@
|
|||||||
@yield('content')
|
@yield('content')
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@stack('scripts')
|
@stack('scripts')
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
function appShell() {
|
function appShell() {
|
||||||
return {
|
return {
|
||||||
sidebarOpen: false,
|
sidebarOpen: false,
|
||||||
searchOpen: false,
|
searchOpen: false,
|
||||||
@@ -307,7 +284,8 @@ function appShell() {
|
|||||||
this.searchLoading = false;
|
this.searchLoading = false;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
@@ -17,8 +17,8 @@
|
|||||||
|
|
||||||
{{-- Search --}}
|
{{-- Search --}}
|
||||||
<div class="relative flex-1 max-w-xs">
|
<div class="relative flex-1 max-w-xs">
|
||||||
<span class="absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 text-sm pointer-events-none">🔍</span>
|
<span class="absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 text-sm pointer-events-none"></span>
|
||||||
<input type="text" x-model="searchQuery" placeholder="Search notes…"
|
<input type="text" x-model="searchQuery" placeholder="🔍Search notes…"
|
||||||
class="input-soft pl-9 text-sm py-2 w-full">
|
class="input-soft pl-9 text-sm py-2 w-full">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -52,19 +52,19 @@
|
|||||||
<div>
|
<div>
|
||||||
<label class="block text-xs font-semibold text-gray-600 mb-1">Instagram Handle</label>
|
<label class="block text-xs font-semibold text-gray-600 mb-1">Instagram Handle</label>
|
||||||
<div class="relative">
|
<div class="relative">
|
||||||
<span class="absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 text-sm pointer-events-none">@</span>
|
<span class="absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 text-sm pointer-events-none"></span>
|
||||||
<input type="text" name="ig_handle"
|
<input type="text" name="ig_handle"
|
||||||
value="{{ old('ig_handle', $profile->ig_handle) }}"
|
value="{{ old('ig_handle', $profile->ig_handle) }}"
|
||||||
class="input-soft pl-7" placeholder="yourhandle">
|
class="input-soft pl-7" placeholder="@yourhandle">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<label class="block text-xs font-semibold text-gray-600 mb-1">TikTok Handle</label>
|
<label class="block text-xs font-semibold text-gray-600 mb-1">TikTok Handle</label>
|
||||||
<div class="relative">
|
<div class="relative">
|
||||||
<span class="absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 text-sm pointer-events-none">@</span>
|
<span class="absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 text-sm pointer-events-none"></span>
|
||||||
<input type="text" name="tiktok_handle"
|
<input type="text" name="tiktok_handle"
|
||||||
value="{{ old('tiktok_handle', $profile->tiktok_handle) }}"
|
value="{{ old('tiktok_handle', $profile->tiktok_handle) }}"
|
||||||
class="input-soft pl-7" placeholder="yourhandle">
|
class="input-soft pl-7" placeholder="@yourhandle">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="sm:col-span-2">
|
<div class="sm:col-span-2">
|
||||||
|
|||||||
@@ -1,50 +1,222 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Rate Card — {{ $profile->owner_name }}</title>
|
<title>Rate Card — {{ $profile->owner_name }}</title>
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap" rel="stylesheet">
|
||||||
<style>
|
<style>
|
||||||
* { box-sizing: border-box; margin: 0; padding: 0; }
|
* {
|
||||||
body { font-family: 'Nunito', sans-serif; background: {{ $profile->bg_color }}; color: {{ $profile->text_color }}; padding: 40px 20px; }
|
box-sizing: border-box;
|
||||||
.container { max-width: 820px; margin: 0 auto; }
|
margin: 0;
|
||||||
.header { text-align: center; margin-bottom: 48px; }
|
padding: 0;
|
||||||
.logo-img { max-height: 100px; max-width: 200px; margin: 0 auto 16px; display: block; border-radius: 16px; }
|
}
|
||||||
.title { font-size: 32px; font-weight: 900; color: {{ $profile->accent_color }}; }
|
|
||||||
.tagline { color: #9CA3AF; margin-top: 6px; font-size: 14px; }
|
body {
|
||||||
.contacts { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px 20px; margin-top: 16px; }
|
font-family: 'Nunito', sans-serif;
|
||||||
|
background:
|
||||||
|
{{ $profile->bg_color }}
|
||||||
|
;
|
||||||
|
color:
|
||||||
|
{{ $profile->text_color }}
|
||||||
|
;
|
||||||
|
padding: 40px 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
max-width: 820px;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header {
|
||||||
|
text-align: center;
|
||||||
|
margin-bottom: 48px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.logo-img {
|
||||||
|
max-height: 100px;
|
||||||
|
max-width: 200px;
|
||||||
|
margin: 0 auto 16px;
|
||||||
|
display: block;
|
||||||
|
border-radius: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
font-size: 32px;
|
||||||
|
font-weight: 900;
|
||||||
|
color:
|
||||||
|
{{ $profile->accent_color }}
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tagline {
|
||||||
|
color: #9CA3AF;
|
||||||
|
margin-top: 6px;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.contacts {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 12px 20px;
|
||||||
|
margin-top: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
.contact-pill {
|
.contact-pill {
|
||||||
display: inline-flex; align-items: center; gap-6px;
|
display: inline-flex;
|
||||||
background: white; border: 1px solid {{ $profile->accent_color }}44;
|
align-items: center;
|
||||||
border-radius: 99px; padding: 6px 14px; font-size: 12px; color: {{ $profile->text_color }};
|
gap-6px;
|
||||||
text-decoration: none; transition: background 0.2s;
|
background: white;
|
||||||
|
border: 1px solid
|
||||||
|
{{ $profile->accent_color }}
|
||||||
|
44;
|
||||||
|
border-radius: 99px;
|
||||||
|
padding: 6px 14px;
|
||||||
|
font-size: 12px;
|
||||||
|
color:
|
||||||
|
{{ $profile->text_color }}
|
||||||
|
;
|
||||||
|
text-decoration: none;
|
||||||
|
transition: background 0.2s;
|
||||||
}
|
}
|
||||||
.contact-pill:hover { background: {{ $profile->accent_color }}18; }
|
|
||||||
.platform-section { margin-bottom: 32px; }
|
.contact-pill:hover {
|
||||||
.platform-title { font-size: 18px; font-weight: 800; color: {{ $profile->text_color }}; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
|
background:
|
||||||
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
|
{{ $profile->accent_color }}
|
||||||
.card { background: white; border-radius: 24px; padding: 20px; border: 1px solid {{ $profile->accent_color }}33; box-shadow: 0 2px 8px {{ $profile->accent_color }}22; }
|
18;
|
||||||
.service { font-weight: 700; color: #1F2937; margin-bottom: 6px; }
|
}
|
||||||
.type { display: inline-block; background: {{ $profile->accent_color }}18; color: {{ $profile->accent_color }}; font-size: 11px; font-weight: 600; padding: 2px 10px; border-radius: 20px; margin-bottom: 8px; }
|
|
||||||
.desc { font-size: 12px; color: #9CA3AF; margin-bottom: 12px; line-height: 1.5; }
|
.platform-section {
|
||||||
.price { font-size: 22px; font-weight: 900; color: {{ $profile->accent_color }}; }
|
margin-bottom: 32px;
|
||||||
.price-meta { font-size: 11px; color: #D1D5DB; margin-top: 2px; }
|
}
|
||||||
.negotiable { font-size: 11px; color: #F59E0B; font-weight: 600; }
|
|
||||||
.footer { text-align: center; margin-top: 60px; color: #D1D5DB; font-size: 12px; }
|
.platform-title {
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: 800;
|
||||||
|
color:
|
||||||
|
{{ $profile->text_color }}
|
||||||
|
;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cards {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
|
||||||
|
gap: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card {
|
||||||
|
background: white;
|
||||||
|
border-radius: 24px;
|
||||||
|
padding: 20px;
|
||||||
|
border: 1px solid
|
||||||
|
{{ $profile->accent_color }}
|
||||||
|
33;
|
||||||
|
box-shadow: 0 2px 8px
|
||||||
|
{{ $profile->accent_color }}
|
||||||
|
22;
|
||||||
|
}
|
||||||
|
|
||||||
|
.service {
|
||||||
|
font-weight: 700;
|
||||||
|
color: #1F2937;
|
||||||
|
margin-bottom: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.type {
|
||||||
|
display: inline-block;
|
||||||
|
background:
|
||||||
|
{{ $profile->accent_color }}
|
||||||
|
18;
|
||||||
|
color:
|
||||||
|
{{ $profile->accent_color }}
|
||||||
|
;
|
||||||
|
font-size: 11px;
|
||||||
|
font-weight: 600;
|
||||||
|
padding: 2px 10px;
|
||||||
|
border-radius: 20px;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.desc {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #9CA3AF;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.price {
|
||||||
|
font-size: 22px;
|
||||||
|
font-weight: 900;
|
||||||
|
color:
|
||||||
|
{{ $profile->accent_color }}
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
.price-meta {
|
||||||
|
font-size: 11px;
|
||||||
|
color: #D1D5DB;
|
||||||
|
margin-top: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.negotiable {
|
||||||
|
font-size: 11px;
|
||||||
|
color: #F59E0B;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer {
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 60px;
|
||||||
|
color: #D1D5DB;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
.pdf-btn {
|
.pdf-btn {
|
||||||
display: inline-flex; align-items: center; gap: 6px;
|
display: inline-flex;
|
||||||
background: {{ $profile->accent_color }}; color: white;
|
align-items: center;
|
||||||
border: none; border-radius: 99px; padding: 10px 24px;
|
gap: 6px;
|
||||||
font-size: 14px; font-weight: 700; cursor: pointer;
|
background:
|
||||||
text-decoration: none; transition: opacity 0.2s;
|
{{ $profile->accent_color }}
|
||||||
|
;
|
||||||
|
color: white;
|
||||||
|
border: none;
|
||||||
|
border-radius: 99px;
|
||||||
|
padding: 10px 24px;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 700;
|
||||||
|
cursor: pointer;
|
||||||
|
text-decoration: none;
|
||||||
|
transition: opacity 0.2s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pdf-btn:hover {
|
||||||
|
opacity: 0.9;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media print {
|
||||||
|
body {
|
||||||
|
background: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card {
|
||||||
|
break-inside: avoid;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pdf-btn {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.pdf-btn:hover { opacity: 0.9; }
|
|
||||||
@media print { body { background: white; } .card { break-inside: avoid; } .pdf-btn { display: none; } }
|
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="header">
|
<div class="header">
|
||||||
@if($profile->logo_path)
|
@if($profile->logo_path)
|
||||||
<img src="{{ route('files.serve-profile-logo') }}" alt="{{ $profile->owner_name }}" class="logo-img">
|
<img src="{{ route('files.serve-profile-logo') }}" alt="{{ $profile->owner_name }}" class="logo-img">
|
||||||
@@ -61,13 +233,16 @@
|
|||||||
<a href="{{ $profile->whatsappUrl }}" target="_blank" class="contact-pill">📱 WhatsApp</a>
|
<a href="{{ $profile->whatsappUrl }}" target="_blank" class="contact-pill">📱 WhatsApp</a>
|
||||||
@endif
|
@endif
|
||||||
@if($profile->ig_handle)
|
@if($profile->ig_handle)
|
||||||
<a href="https://instagram.com/{{ ltrim($profile->ig_handle, '@') }}" target="_blank" class="contact-pill">📸 @{{ $profile->ig_handle }}</a>
|
<a href="https://instagram.com/{{ ltrim($profile->ig_handle, '@') }}" target="_blank"
|
||||||
|
class="contact-pill">📸 {{ '@' . ltrim($profile->ig_handle, '@') }}</a>
|
||||||
@endif
|
@endif
|
||||||
@if($profile->tiktok_handle)
|
@if($profile->tiktok_handle)
|
||||||
<a href="https://tiktok.com/@{{ ltrim($profile->tiktok_handle, '@') }}" target="_blank" class="contact-pill">🎵 @{{ $profile->tiktok_handle }}</a>
|
<a href="https://tiktok.com/{{ ltrim($profile->tiktok_handle, '@') }}" target="_blank"
|
||||||
|
class="contact-pill">🎵 {{ '@' . ltrim($profile->tiktok_handle, '@') }}</a>
|
||||||
@endif
|
@endif
|
||||||
@if($profile->youtube_handle)
|
@if($profile->youtube_handle)
|
||||||
<a href="https://youtube.com/{{ $profile->youtube_handle }}" target="_blank" class="contact-pill">▶️ {{ $profile->youtube_handle }}</a>
|
<a href="https://youtube.com/{{ $profile->youtube_handle }}" target="_blank" class="contact-pill">▶️
|
||||||
|
{{ $profile->youtube_handle }}</a>
|
||||||
@endif
|
@endif
|
||||||
@if($profile->email)
|
@if($profile->email)
|
||||||
<a href="mailto:{{ $profile->email }}" class="contact-pill">✉️ {{ $profile->email }}</a>
|
<a href="mailto:{{ $profile->email }}" class="contact-pill">✉️ {{ $profile->email }}</a>
|
||||||
@@ -109,9 +284,10 @@
|
|||||||
@endforelse
|
@endforelse
|
||||||
|
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
{{ $profile->custom_footer ?: 'Prices may vary. Contact for custom packages. 🐾' }}
|
{{ $profile->custom_footer ?: 'Prices may vary. Contact for custom packages.' }}
|
||||||
<br>Generated by KOL Manager · {{ now()->format('Y') }}
|
<!--<br>Generated by Cathy's App · {{ now()->format('Y-M-D') }}-->
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
<div class="cat-card p-4 lg:p-8">
|
<div class="cat-card p-4 lg:p-8">
|
||||||
<form action="{{ route('schedule.store') }}" method="POST" id="create-event-form"
|
<form action="{{ route('schedule.store') }}" method="POST" id="create-event-form"
|
||||||
x-data="contractCheck('{{ route('contracts.check') }}')"
|
x-data="contractCheck('{{ route('contracts.check', [], false) }}')"
|
||||||
class="space-y-5">
|
class="space-y-5">
|
||||||
@csrf
|
@csrf
|
||||||
<input type="hidden" name="start_time" id="start_time_hidden">
|
<input type="hidden" name="start_time" id="start_time_hidden">
|
||||||
@@ -31,7 +31,100 @@
|
|||||||
@error('title') <p class="text-xs text-red-500 mt-1">{{ $message }}</p> @enderror
|
@error('title') <p class="text-xs text-red-500 mt-1">{{ $message }}</p> @enderror
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
|
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4" x-data="{
|
||||||
|
isNew: false,
|
||||||
|
saving: false,
|
||||||
|
newName: '', newEmail: '', newPhone: '', newCompany: '',
|
||||||
|
errMsg: '',
|
||||||
|
isNewCat: false,
|
||||||
|
savingCat: false,
|
||||||
|
newCatName: '',
|
||||||
|
catErrMsg: '',
|
||||||
|
onClientChange(e) {
|
||||||
|
this.isNew = (e.target.value === '__new__');
|
||||||
|
if (!this.isNew) {
|
||||||
|
this.clientId = e.target.value;
|
||||||
|
$dispatch('contract-check');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async saveNewClient() {
|
||||||
|
if (!this.newName.trim()) { this.errMsg = 'Name is required.'; return; }
|
||||||
|
this.saving = true; this.errMsg = '';
|
||||||
|
const fd = new FormData();
|
||||||
|
fd.append('name', this.newName);
|
||||||
|
fd.append('email', this.newEmail);
|
||||||
|
fd.append('phone', this.newPhone);
|
||||||
|
fd.append('company', this.newCompany);
|
||||||
|
fd.append('_token', document.querySelector('meta[name=csrf-token]').content);
|
||||||
|
try {
|
||||||
|
const res = await fetch('{{ route('clients.quick-store', [], false) }}', {
|
||||||
|
method:'POST',
|
||||||
|
body: fd,
|
||||||
|
headers: {
|
||||||
|
'Accept': 'application/json',
|
||||||
|
'X-Requested-With': 'XMLHttpRequest'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const data = await res.json();
|
||||||
|
if (res.ok) {
|
||||||
|
// Add new option & select it
|
||||||
|
const sel = document.getElementById('client-select');
|
||||||
|
const opt = new Option(data.name, data.id, true, true);
|
||||||
|
sel.add(opt, sel.options[1]);
|
||||||
|
sel.value = data.id;
|
||||||
|
sel.dispatchEvent(new Event('change'));
|
||||||
|
this.isNew = false;
|
||||||
|
this.newName = this.newEmail = this.newPhone = this.newCompany = '';
|
||||||
|
} else {
|
||||||
|
this.errMsg = data.message || 'Could not create client.';
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
this.errMsg = 'An unexpected error occurred.';
|
||||||
|
} finally {
|
||||||
|
this.saving = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onCategoryChange(e) {
|
||||||
|
this.isNewCat = (e.target.value === '__new__');
|
||||||
|
if (!this.isNewCat) {
|
||||||
|
this.categoryId = e.target.value;
|
||||||
|
this.checkContract();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async saveNewCategory() {
|
||||||
|
if (!this.newCatName.trim()) { this.catErrMsg = 'Category name is required.'; return; }
|
||||||
|
this.savingCat = true; this.catErrMsg = '';
|
||||||
|
const fd = new FormData();
|
||||||
|
fd.append('name', this.newCatName);
|
||||||
|
fd.append('_token', document.querySelector('meta[name=csrf-token]').content);
|
||||||
|
try {
|
||||||
|
const res = await fetch('{{ route('client-categories.quick-store', [], false) }}', {
|
||||||
|
method:'POST',
|
||||||
|
body: fd,
|
||||||
|
headers: {
|
||||||
|
'Accept': 'application/json',
|
||||||
|
'X-Requested-With': 'XMLHttpRequest'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const data = await res.json();
|
||||||
|
if (res.ok) {
|
||||||
|
const sel = document.getElementById('category-select');
|
||||||
|
const opt = new Option(data.icon + ' ' + data.name, data.id, true, true);
|
||||||
|
sel.add(opt, sel.options[1]);
|
||||||
|
sel.value = data.id;
|
||||||
|
sel.dispatchEvent(new Event('change'));
|
||||||
|
this.isNewCat = false;
|
||||||
|
this.newCatName = '';
|
||||||
|
} else {
|
||||||
|
this.catErrMsg = data.message || 'Could not create category.';
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
this.catErrMsg = 'An unexpected error occurred.';
|
||||||
|
} finally {
|
||||||
|
this.savingCat = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}">
|
||||||
{{-- Type --}}
|
{{-- Type --}}
|
||||||
<div>
|
<div>
|
||||||
<label class="block text-sm font-semibold text-gray-700 mb-1">Type</label>
|
<label class="block text-sm font-semibold text-gray-700 mb-1">Type</label>
|
||||||
@@ -45,44 +138,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{-- Client --}}
|
{{-- Client --}}
|
||||||
<div x-data="{
|
<div>
|
||||||
isNew: false,
|
|
||||||
saving: false,
|
|
||||||
newName: '', newEmail: '', newPhone: '', newCompany: '',
|
|
||||||
errMsg: '',
|
|
||||||
onClientChange(e) {
|
|
||||||
this.isNew = (e.target.value === '__new__');
|
|
||||||
if (!this.isNew) {
|
|
||||||
clientId = e.target.value;
|
|
||||||
$dispatch('contract-check');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
async saveNewClient() {
|
|
||||||
if (!this.newName.trim()) { this.errMsg = 'Name is required.'; return; }
|
|
||||||
this.saving = true; this.errMsg = '';
|
|
||||||
const fd = new FormData();
|
|
||||||
fd.append('name', this.newName);
|
|
||||||
fd.append('email', this.newEmail);
|
|
||||||
fd.append('phone', this.newPhone);
|
|
||||||
fd.append('company', this.newCompany);
|
|
||||||
fd.append('_token', document.querySelector('meta[name=csrf-token]').content);
|
|
||||||
const res = await fetch('{{ route('clients.quick-store') }}', { method:'POST', body: fd });
|
|
||||||
const data = await res.json();
|
|
||||||
if (res.ok) {
|
|
||||||
// Add new option & select it
|
|
||||||
const sel = document.getElementById('client-select');
|
|
||||||
const opt = new Option(data.name, data.id, true, true);
|
|
||||||
sel.add(opt, sel.options[1]);
|
|
||||||
sel.value = data.id;
|
|
||||||
sel.dispatchEvent(new Event('change'));
|
|
||||||
this.isNew = false;
|
|
||||||
this.newName = this.newEmail = this.newPhone = this.newCompany = '';
|
|
||||||
} else {
|
|
||||||
this.errMsg = data.message ?? 'Could not create client.';
|
|
||||||
}
|
|
||||||
this.saving = false;
|
|
||||||
}
|
|
||||||
}">
|
|
||||||
<label class="block text-sm font-semibold text-gray-700 mb-1">Client</label>
|
<label class="block text-sm font-semibold text-gray-700 mb-1">Client</label>
|
||||||
<select name="client_id" id="client-select" class="input-soft"
|
<select name="client_id" id="client-select" class="input-soft"
|
||||||
x-model="clientId"
|
x-model="clientId"
|
||||||
@@ -95,10 +151,11 @@
|
|||||||
</option>
|
</option>
|
||||||
@endforeach
|
@endforeach
|
||||||
</select>
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
{{-- Quick New Client mini-form --}}
|
{{-- Quick New Client mini-form --}}
|
||||||
<div x-show="isNew" x-transition
|
<div x-show="isNew" x-transition style="display: none;"
|
||||||
class="mt-3 bg-purple-50 rounded-2xl p-4 space-y-3 border border-purple-100">
|
class="sm:col-span-2 bg-purple-50 rounded-2xl p-4 space-y-3 border border-purple-100">
|
||||||
<p class="text-xs font-bold text-purple-700">🐱 New Client Basic Info</p>
|
<p class="text-xs font-bold text-purple-700">🐱 New Client Basic Info</p>
|
||||||
<div class="grid grid-cols-1 sm:grid-cols-2 gap-3">
|
<div class="grid grid-cols-1 sm:grid-cols-2 gap-3">
|
||||||
<div>
|
<div>
|
||||||
@@ -122,20 +179,20 @@
|
|||||||
<div class="flex gap-2 pt-1">
|
<div class="flex gap-2 pt-1">
|
||||||
<button type="button" @click="saveNewClient()" :disabled="saving"
|
<button type="button" @click="saveNewClient()" :disabled="saving"
|
||||||
class="btn-sakura text-sm px-4 py-2" x-text="saving ? 'Saving…' : '✓ Add & Select'"></button>
|
class="btn-sakura text-sm px-4 py-2" x-text="saving ? 'Saving…' : '✓ Add & Select'"></button>
|
||||||
<button type="button" @click="isNew = false; $el.closest('div').querySelector('select').value = ''"
|
<button type="button" @click="isNew = false; document.getElementById('client-select').value = ''"
|
||||||
class="text-sm px-4 py-2 rounded-full border border-pink-200 text-gray-500 hover:bg-pink-50">
|
class="text-sm px-4 py-2 rounded-full border border-pink-200 text-gray-500 hover:bg-pink-50">
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<p class="text-xs text-purple-400">Status will be set to Active automatically.</p>
|
<p class="text-xs text-purple-400">Status will be set to Active automatically.</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
{{-- Category --}}
|
{{-- Category --}}
|
||||||
<div class="sm:col-span-2">
|
<div class="sm:col-span-2">
|
||||||
<label class="block text-sm font-semibold text-gray-700 mb-1">Category</label>
|
<label class="block text-sm font-semibold text-gray-700 mb-1">Category</label>
|
||||||
<select name="category_id" class="input-soft" x-model="categoryId" @change="checkContract()">
|
<select name="category_id" id="category-select" class="input-soft" x-model="categoryId" @change="onCategoryChange($event)">
|
||||||
<option value="">— None —</option>
|
<option value="">— None —</option>
|
||||||
|
<option value="__new__" class="font-semibold text-pink-600">+ Create New Category…</option>
|
||||||
@foreach($categoryTree as $parent)
|
@foreach($categoryTree as $parent)
|
||||||
<option value="{{ $parent->id }}" {{ old('category_id') == $parent->id ? 'selected' : '' }}>
|
<option value="{{ $parent->id }}" {{ old('category_id') == $parent->id ? 'selected' : '' }}>
|
||||||
{{ $parent->icon }} {{ $parent->name }}
|
{{ $parent->icon }} {{ $parent->name }}
|
||||||
@@ -149,6 +206,25 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{{-- Quick New Category mini-form --}}
|
||||||
|
<div x-show="isNewCat" x-transition style="display: none;"
|
||||||
|
class="sm:col-span-2 bg-pink-50 rounded-2xl p-4 space-y-3 border border-pink-100">
|
||||||
|
<p class="text-xs font-bold text-pink-700">🏷️ New Category</p>
|
||||||
|
<div>
|
||||||
|
<label class="block text-xs font-semibold text-gray-600 mb-1">Category Name <span class="text-pink-400">*</span></label>
|
||||||
|
<input type="text" x-model="newCatName" class="input-soft text-sm" placeholder="e.g. Sponsored Post">
|
||||||
|
</div>
|
||||||
|
<p x-show="catErrMsg" x-text="catErrMsg" class="text-xs text-red-500"></p>
|
||||||
|
<div class="flex gap-2 pt-1">
|
||||||
|
<button type="button" @click="saveNewCategory()" :disabled="savingCat"
|
||||||
|
class="btn-sakura text-sm px-4 py-2" x-text="savingCat ? 'Saving…' : '✓ Add & Select'"></button>
|
||||||
|
<button type="button" @click="isNewCat = false; document.getElementById('category-select').value = ''"
|
||||||
|
class="text-sm px-4 py-2 rounded-full border border-pink-200 text-gray-500 hover:bg-pink-50">
|
||||||
|
Cancel
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
{{-- Contract warning --}}
|
{{-- Contract warning --}}
|
||||||
<div x-show="contractWarning" x-transition
|
<div x-show="contractWarning" x-transition
|
||||||
class="sm:col-span-2 rounded-2xl bg-amber-50 border border-amber-200 px-4 py-3 text-sm"
|
class="sm:col-span-2 rounded-2xl bg-amber-50 border border-amber-200 px-4 py-3 text-sm"
|
||||||
@@ -163,7 +239,7 @@
|
|||||||
Start Date <span class="text-pink-400">*</span>
|
Start Date <span class="text-pink-400">*</span>
|
||||||
</label>
|
</label>
|
||||||
<input type="date" id="start_date" class="input-soft"
|
<input type="date" id="start_date" class="input-soft"
|
||||||
value="{{ old('_start_date') }}" required>
|
value="{{ old('_start_date') }}" required @change="checkContract()">
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<label class="block text-sm font-semibold text-gray-700 mb-1">Start Time</label>
|
<label class="block text-sm font-semibold text-gray-700 mb-1">Start Time</label>
|
||||||
@@ -287,7 +363,8 @@
|
|||||||
|
|
||||||
<div class="flex flex-col sm:flex-row gap-3 pt-1">
|
<div class="flex flex-col sm:flex-row gap-3 pt-1">
|
||||||
<button type="submit" class="btn-sakura flex-1 py-3"
|
<button type="submit" class="btn-sakura flex-1 py-3"
|
||||||
:class="{ 'opacity-50 cursor-not-allowed': contractWarning }">
|
:class="{ 'opacity-50 cursor-not-allowed': contractWarning }"
|
||||||
|
:disabled="contractWarning">
|
||||||
🐾 Schedule It!
|
🐾 Schedule It!
|
||||||
</button>
|
</button>
|
||||||
<a href="{{ route('schedule.index') }}"
|
<a href="{{ route('schedule.index') }}"
|
||||||
@@ -301,6 +378,47 @@
|
|||||||
|
|
||||||
@push('scripts')
|
@push('scripts')
|
||||||
<script>
|
<script>
|
||||||
|
function contractCheck(checkUrl) {
|
||||||
|
return {
|
||||||
|
categoryId: '',
|
||||||
|
clientId: '',
|
||||||
|
contractWarning: false,
|
||||||
|
contractMessage: '',
|
||||||
|
async checkContract() {
|
||||||
|
if (!this.categoryId) { this.contractWarning = false; return; }
|
||||||
|
let dateVal = '';
|
||||||
|
const startDateEl = document.getElementById('start_date');
|
||||||
|
if (startDateEl && startDateEl.value) {
|
||||||
|
dateVal = startDateEl.value;
|
||||||
|
}
|
||||||
|
if (!dateVal) {
|
||||||
|
this.contractWarning = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const params = new URLSearchParams({
|
||||||
|
category_id: this.categoryId,
|
||||||
|
client_id: this.clientId || '',
|
||||||
|
date: dateVal
|
||||||
|
});
|
||||||
|
try {
|
||||||
|
const res = await fetch(checkUrl + '?' + params);
|
||||||
|
if (!res.ok) throw new Error('Network error');
|
||||||
|
const data = await res.json();
|
||||||
|
if (data && data.title) {
|
||||||
|
this.contractWarning = true;
|
||||||
|
this.contractMessage = `"${data.title}" — ${data.client_name} holds exclusive rights in the ${data.category} category until ${data.end_date} (${data.days_left} days left).`;
|
||||||
|
} else {
|
||||||
|
this.contractWarning = false;
|
||||||
|
this.contractMessage = '';
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
this.contractWarning = false;
|
||||||
|
this.contractMessage = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
document.getElementById('create-event-form').addEventListener('submit', function (e) {
|
document.getElementById('create-event-form').addEventListener('submit', function (e) {
|
||||||
const startDate = document.getElementById('start_date').value;
|
const startDate = document.getElementById('start_date').value;
|
||||||
const startTime = document.getElementById('start_time_input').value || '00:00';
|
const startTime = document.getElementById('start_time_input').value || '00:00';
|
||||||
|
|||||||
@@ -13,13 +13,19 @@
|
|||||||
|
|
||||||
{{-- ── Upcoming Alert Strip ─────────────────────────────────── --}}
|
{{-- ── Upcoming Alert Strip ─────────────────────────────────── --}}
|
||||||
@php
|
@php
|
||||||
$upcomingList = $events->filter(fn($e) => $e->start_time->isFuture() && $e->start_time->diffInHours(now()) <= 24);
|
$startOfMonth = now()->startOfMonth();
|
||||||
|
$endOfMonth = now()->endOfMonth();
|
||||||
|
$upcomingList = $events->filter(function($e) use ($startOfMonth, $endOfMonth) {
|
||||||
|
$start = $e->start_time;
|
||||||
|
$end = $e->end_time ?: $e->start_time;
|
||||||
|
return $start->lte($endOfMonth) && $end->gte($startOfMonth);
|
||||||
|
});
|
||||||
@endphp
|
@endphp
|
||||||
@if($upcomingList->isNotEmpty())
|
@if($upcomingList->isNotEmpty())
|
||||||
<div class="flex gap-2 overflow-x-auto pb-2 mb-4 -mx-4 px-4 lg:mx-0 lg:px-0">
|
<div class="flex gap-2 overflow-x-auto pb-2 mb-4 -mx-4 px-4 lg:mx-0 lg:px-0">
|
||||||
@foreach($upcomingList->take(6) as $event)
|
@foreach($upcomingList as $event)
|
||||||
<div class="shrink-0 flex items-center gap-2 bg-white rounded-2xl border border-pink-100 px-3 py-2 shadow-sm cursor-pointer hover:border-pink-300 transition-colors"
|
<div class="shrink-0 flex items-center gap-2 bg-white rounded-2xl border border-pink-100 px-3 py-2 shadow-sm cursor-pointer hover:border-pink-300 transition-colors"
|
||||||
onclick="openAlertEventModal({{ json_encode(['id' => $event->id, 'title' => $event->title, 'type' => $event->event_type, 'status' => $event->status->value, 'client' => $event->client?->name, 'start' => $event->start_time->toIso8601String(), 'end' => $event->end_time?->toIso8601String()]) }})">
|
onclick="openAlertEventModal({{ json_encode(['id' => $event->id, 'title' => $event->title, 'type' => $event->event_type, 'status' => $event->status->value, 'client' => $event->client?->name, 'start' => $event->start_time->format('d M Y H:i'), 'end' => $event->end_time?->format('d M Y H:i'), 'location' => $event->location, 'description' => $event->description, 'notes' => $event->notes, 'has_contract' => $event->has_contract, 'has_content' => $event->has_content]) }})">
|
||||||
<div class="w-1.5 h-8 rounded-full shrink-0" style="background:{{ $event->color }}"></div>
|
<div class="w-1.5 h-8 rounded-full shrink-0" style="background:{{ $event->color }}"></div>
|
||||||
<div>
|
<div>
|
||||||
<div class="text-xs font-semibold text-gray-700 whitespace-nowrap">{{ $event->title }}</div>
|
<div class="text-xs font-semibold text-gray-700 whitespace-nowrap">{{ $event->title }}</div>
|
||||||
@@ -106,8 +112,8 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||||||
'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]').content,
|
'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]').content,
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
start_time: info.event.startStr,
|
start_time: info.event.startStr ? info.event.startStr.substring(0, 19) : null,
|
||||||
end_time: info.event.endStr || null,
|
end_time: info.event.endStr ? info.event.endStr.substring(0, 19) : null,
|
||||||
}),
|
}),
|
||||||
}).then(r => r.ok ? window.KolManager.notify('Event rescheduled! 🐾') : info.revert());
|
}).then(r => r.ok ? window.KolManager.notify('Event rescheduled! 🐾') : info.revert());
|
||||||
},
|
},
|
||||||
@@ -124,11 +130,16 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||||||
const e = info.event, p = e.extendedProps;
|
const e = info.event, p = e.extendedProps;
|
||||||
document.getElementById('modal-title').textContent = e.title;
|
document.getElementById('modal-title').textContent = e.title;
|
||||||
document.getElementById('modal-body').innerHTML = `
|
document.getElementById('modal-body').innerHTML = `
|
||||||
<div class="flex gap-2"><span class="text-gray-400 w-16 shrink-0">Type</span><span>${p.type}</span></div>
|
<div class="flex gap-2"><span class="text-gray-400 w-24 shrink-0">Type</span><span>${p.type}</span></div>
|
||||||
<div class="flex gap-2"><span class="text-gray-400 w-16 shrink-0">Status</span><span>${p.status}</span></div>
|
<div class="flex gap-2"><span class="text-gray-400 w-24 shrink-0">Status</span><span>${p.status}</span></div>
|
||||||
${p.client ? `<div class="flex gap-2"><span class="text-gray-400 w-16 shrink-0">Client</span><span>${p.client}</span></div>` : ''}
|
${p.client ? `<div class="flex gap-2"><span class="text-gray-400 w-24 shrink-0">Client</span><span>${p.client}</span></div>` : ''}
|
||||||
<div class="flex gap-2"><span class="text-gray-400 w-16 shrink-0">Start</span><span>${e.start?.toLocaleString()}</span></div>
|
${p.location ? `<div class="flex gap-2"><span class="text-gray-400 w-24 shrink-0">Location</span><span>${p.location}</span></div>` : ''}
|
||||||
${e.end ? `<div class="flex gap-2"><span class="text-gray-400 w-16 shrink-0">End</span><span>${e.end.toLocaleString()}</span></div>` : ''}
|
<div class="flex gap-2"><span class="text-gray-400 w-24 shrink-0">Start</span><span>${e.start?.toLocaleString()}</span></div>
|
||||||
|
${e.end ? `<div class="flex gap-2"><span class="text-gray-400 w-24 shrink-0">End</span><span>${e.end.toLocaleString()}</span></div>` : ''}
|
||||||
|
${p.description ? `<div class="flex gap-2"><span class="text-gray-400 w-24 shrink-0">Description</span><span class="break-words">${p.description}</span></div>` : ''}
|
||||||
|
${p.notes ? `<div class="flex gap-2"><span class="text-gray-400 w-24 shrink-0">Notes</span><span class="break-words">${p.notes}</span></div>` : ''}
|
||||||
|
${p.has_contract ? `<div class="flex gap-2"><span class="text-gray-400 w-24 shrink-0">Contract</span><span class="text-pink-500 font-semibold">Yes</span></div>` : ''}
|
||||||
|
${p.has_content ? `<div class="flex gap-2"><span class="text-gray-400 w-24 shrink-0">Content Bd</span><span class="text-pink-500 font-semibold">Yes</span></div>` : ''}
|
||||||
`;
|
`;
|
||||||
const editUrl = `/schedule/${e.id}/edit`;
|
const editUrl = `/schedule/${e.id}/edit`;
|
||||||
document.getElementById('modal-actions').innerHTML = `
|
document.getElementById('modal-actions').innerHTML = `
|
||||||
@@ -156,14 +167,19 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||||||
|
|
||||||
function openAlertEventModal(e) {
|
function openAlertEventModal(e) {
|
||||||
document.getElementById('modal-title').textContent = e.title;
|
document.getElementById('modal-title').textContent = e.title;
|
||||||
const startStr = e.start ? new Date(e.start).toLocaleString() : '—';
|
const startStr = e.start ? e.start : '—';
|
||||||
const endStr = e.end ? new Date(e.end).toLocaleString() : null;
|
const endStr = e.end ? e.end : null;
|
||||||
document.getElementById('modal-body').innerHTML = `
|
document.getElementById('modal-body').innerHTML = `
|
||||||
<div class="flex gap-2"><span class="text-gray-400 w-16 shrink-0">Type</span><span>${e.type}</span></div>
|
<div class="flex gap-2"><span class="text-gray-400 w-24 shrink-0">Type</span><span>${e.type}</span></div>
|
||||||
<div class="flex gap-2"><span class="text-gray-400 w-16 shrink-0">Status</span><span>${e.status}</span></div>
|
<div class="flex gap-2"><span class="text-gray-400 w-24 shrink-0">Status</span><span>${e.status}</span></div>
|
||||||
${e.client ? `<div class="flex gap-2"><span class="text-gray-400 w-16 shrink-0">Client</span><span>${e.client}</span></div>` : ''}
|
${e.client ? `<div class="flex gap-2"><span class="text-gray-400 w-24 shrink-0">Client</span><span>${e.client}</span></div>` : ''}
|
||||||
<div class="flex gap-2"><span class="text-gray-400 w-16 shrink-0">Start</span><span>${startStr}</span></div>
|
${e.location ? `<div class="flex gap-2"><span class="text-gray-400 w-24 shrink-0">Location</span><span>${e.location}</span></div>` : ''}
|
||||||
${endStr ? `<div class="flex gap-2"><span class="text-gray-400 w-16 shrink-0">End</span><span>${endStr}</span></div>` : ''}
|
<div class="flex gap-2"><span class="text-gray-400 w-24 shrink-0">Start</span><span>${startStr}</span></div>
|
||||||
|
${endStr ? `<div class="flex gap-2"><span class="text-gray-400 w-24 shrink-0">End</span><span>${endStr}</span></div>` : ''}
|
||||||
|
${e.description ? `<div class="flex gap-2"><span class="text-gray-400 w-24 shrink-0">Description</span><span class="break-words">${e.description}</span></div>` : ''}
|
||||||
|
${e.notes ? `<div class="flex gap-2"><span class="text-gray-400 w-24 shrink-0">Notes</span><span class="break-words">${e.notes}</span></div>` : ''}
|
||||||
|
${e.has_contract ? `<div class="flex gap-2"><span class="text-gray-400 w-24 shrink-0">Contract</span><span class="text-pink-500 font-semibold">Yes</span></div>` : ''}
|
||||||
|
${e.has_content ? `<div class="flex gap-2"><span class="text-gray-400 w-24 shrink-0">Content Bd</span><span class="text-pink-500 font-semibold">Yes</span></div>` : ''}
|
||||||
`;
|
`;
|
||||||
document.getElementById('modal-actions').innerHTML = `
|
document.getElementById('modal-actions').innerHTML = `
|
||||||
<a href="/schedule/${e.id}/edit" class="btn-sakura text-sm flex-1 text-center py-2">Edit</a>
|
<a href="/schedule/${e.id}/edit" class="btn-sakura text-sm flex-1 text-center py-2">Edit</a>
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ Artisan::command('notifications:dispatch', function () {
|
|||||||
$dispatcher = app(NotificationDispatcher::class);
|
$dispatcher = app(NotificationDispatcher::class);
|
||||||
$dispatcher->dispatchAll();
|
$dispatcher->dispatchAll();
|
||||||
$this->info('🔔 Notifications dispatched.');
|
$this->info('🔔 Notifications dispatched.');
|
||||||
})->purpose('Send all pending KOL Manager notifications');
|
})->purpose('Send all pending Cathy notifications');
|
||||||
|
|
||||||
// Run every hour automatically
|
// Run every hour automatically
|
||||||
Schedule::command('notifications:dispatch')->hourly();
|
Schedule::command('notifications:dispatch')->hourly();
|
||||||
|
|||||||
@@ -27,13 +27,14 @@ Route::post('/logout', [GateController::class, 'logout'])->name('gate.logout');
|
|||||||
Route::get('/', [DashboardController::class, 'index'])->name('dashboard');
|
Route::get('/', [DashboardController::class, 'index'])->name('dashboard');
|
||||||
|
|
||||||
// CRM – Clients
|
// CRM – Clients
|
||||||
Route::resource('clients', ClientController::class);
|
|
||||||
Route::post('/clients/quick', [ClientController::class, 'quickStore'])->name('clients.quick-store');
|
Route::post('/clients/quick', [ClientController::class, 'quickStore'])->name('clients.quick-store');
|
||||||
|
Route::resource('clients', ClientController::class);
|
||||||
Route::post('/clients/{client}/avatar', [ClientController::class, 'uploadAvatar'])->name('clients.upload-avatar');
|
Route::post('/clients/{client}/avatar', [ClientController::class, 'uploadAvatar'])->name('clients.upload-avatar');
|
||||||
Route::delete('/clients/{client}/avatar', [ClientController::class, 'deleteAvatar'])->name('clients.delete-avatar');
|
Route::delete('/clients/{client}/avatar', [ClientController::class, 'deleteAvatar'])->name('clients.delete-avatar');
|
||||||
|
|
||||||
// Client Categories
|
// Client Categories
|
||||||
Route::prefix('client-categories')->name('client-categories.')->group(function (): void {
|
Route::prefix('client-categories')->name('client-categories.')->group(function (): void {
|
||||||
|
Route::post('/quick', [ClientCategoryController::class, 'quickStore'])->name('quick-store');
|
||||||
Route::get('/', [ClientCategoryController::class, 'index'])->name('index');
|
Route::get('/', [ClientCategoryController::class, 'index'])->name('index');
|
||||||
Route::post('/', [ClientCategoryController::class, 'store'])->name('store');
|
Route::post('/', [ClientCategoryController::class, 'store'])->name('store');
|
||||||
Route::put('/{category}', [ClientCategoryController::class, 'update'])->name('update');
|
Route::put('/{category}', [ClientCategoryController::class, 'update'])->name('update');
|
||||||
|
|||||||
Reference in New Issue
Block a user