Compare commits
8 Commits
main
...
ed9e7dc0fd
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ed9e7dc0fd | ||
|
|
12d44cbecc | ||
|
|
64092d3abc | ||
|
|
8b5992b7ce | ||
|
|
5656dc1f3a | ||
|
|
1e7a35ad4f | ||
|
|
79f2f22e5d | ||
|
|
15c8d3ae7c |
11
Dockerfile
11
Dockerfile
@@ -31,6 +31,7 @@ RUN apk add --no-cache \
|
||||
libpng-dev \
|
||||
libjpeg-turbo-dev \
|
||||
freetype-dev \
|
||||
libwebp-dev \
|
||||
libxml2-dev \
|
||||
libzip-dev \
|
||||
icu-dev \
|
||||
@@ -41,6 +42,7 @@ RUN apk add --no-cache \
|
||||
RUN docker-php-ext-configure gd \
|
||||
--with-freetype \
|
||||
--with-jpeg \
|
||||
--with-webp \
|
||||
&& docker-php-ext-install -j"$(nproc)" \
|
||||
pdo \
|
||||
pdo_sqlite \
|
||||
@@ -105,7 +107,7 @@ RUN mkdir -p \
|
||||
RUN sed -i 's/user = www-data/user = www-data/' /usr/local/etc/php-fpm.d/www.conf 2>/dev/null || true \
|
||||
&& sed -i 's/group = www-data/group = www-data/' /usr/local/etc/php-fpm.d/www.conf 2>/dev/null || true
|
||||
|
||||
# ── OPcache tuning ───────────────────────────
|
||||
# ── PHP Tuning & Upload Limits ─────────────────
|
||||
RUN { \
|
||||
echo "opcache.enable=1"; \
|
||||
echo "opcache.memory_consumption=128"; \
|
||||
@@ -115,6 +117,13 @@ RUN { \
|
||||
echo "opcache.fast_shutdown=1"; \
|
||||
} > /usr/local/etc/php/conf.d/opcache.ini
|
||||
|
||||
RUN { \
|
||||
echo "upload_max_filesize = 200M"; \
|
||||
echo "post_max_size = 200M"; \
|
||||
echo "memory_limit = 512M"; \
|
||||
echo "max_execution_time = 300"; \
|
||||
} > /usr/local/etc/php/conf.d/uploads.ini
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
@@ -88,21 +88,17 @@ class BrandContractController extends Controller
|
||||
{
|
||||
$categoryId = $request->integer('category_id');
|
||||
$clientId = $request->integer('client_id');
|
||||
$dateStr = $request->input('date');
|
||||
|
||||
if (! $categoryId) {
|
||||
if (! $categoryId || empty($dateStr)) {
|
||||
return response()->json(null);
|
||||
}
|
||||
|
||||
// Collect the category and its parent chain (so blocking a parent also blocks children)
|
||||
$category = ClientCategory::find($categoryId);
|
||||
$checkIds = [$categoryId];
|
||||
if ($category?->parent_id) {
|
||||
$checkIds[] = $category->parent_id;
|
||||
}
|
||||
$date = $dateStr ? \Carbon\Carbon::parse($dateStr) : today();
|
||||
|
||||
$contract = BrandContract::with(['client', 'category'])
|
||||
->active()
|
||||
->whereIn('category_id', $checkIds)
|
||||
->active($date)
|
||||
->where('category_id', $categoryId)
|
||||
->first();
|
||||
|
||||
if (! $contract) {
|
||||
|
||||
@@ -46,6 +46,22 @@ class ClientCategoryController extends Controller
|
||||
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
|
||||
{
|
||||
$validated = $request->validate([
|
||||
|
||||
@@ -41,12 +41,20 @@ class EventController extends Controller
|
||||
$clients = Client::where('status', 'active')->orderBy('name')->get();
|
||||
$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
|
||||
$calendarEvents = $events->map(fn (Event $e) => [
|
||||
'id' => $e->id,
|
||||
'title' => ($e->is_priority ? '⭐ ' : '') . $e->title,
|
||||
'start' => $e->start_time->toIso8601String(),
|
||||
'end' => $e->end_time?->toIso8601String(),
|
||||
'start' => $e->start_time->format('Y-m-d\TH:i:s'),
|
||||
'end' => $e->end_time?->format('Y-m-d\TH:i:s'),
|
||||
'backgroundColor' => $e->color,
|
||||
'borderColor' => $e->color,
|
||||
'extendedProps' => [
|
||||
@@ -54,10 +62,23 @@ class EventController extends Controller
|
||||
'client' => $e->client?->name,
|
||||
'type' => $e->event_type,
|
||||
'priority' => $e->is_priority,
|
||||
'location' => $e->location,
|
||||
'description' => $e->description,
|
||||
'notes' => $e->notes,
|
||||
'has_contract' => $e->has_contract,
|
||||
'has_content' => $e->has_content,
|
||||
],
|
||||
]);
|
||||
|
||||
return view('schedule.index', compact('events', 'clients', 'calendarEvents', 'categoryTree'));
|
||||
$holidays = \Illuminate\Support\Facades\Cache::remember('indonesian_holidays', 86400, function() {
|
||||
$url = "https://libur.deno.dev/api";
|
||||
$response = @file_get_contents($url);
|
||||
if ($response === false) return [];
|
||||
$data = json_decode($response, true);
|
||||
return is_array($data) ? $data : [];
|
||||
});
|
||||
|
||||
return view('schedule.index', compact('events', 'clients', 'calendarEvents', 'categoryTree', 'holidays'));
|
||||
}
|
||||
|
||||
public function store(Request $request): RedirectResponse
|
||||
@@ -113,6 +134,7 @@ class EventController extends Controller
|
||||
'status' => ContentStatus::Drafting,
|
||||
'target_date' => $event->start_time->toDateString(),
|
||||
'notes' => $event->notes,
|
||||
'body' => $event->description,
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -192,11 +214,19 @@ class EventController extends Controller
|
||||
|
||||
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,
|
||||
'title' => ($e->is_priority ? '⭐ ' : '') . $e->title,
|
||||
'start' => $e->start_time->toIso8601String(),
|
||||
'end' => $e->end_time?->toIso8601String(),
|
||||
'start' => $e->start_time->format('Y-m-d\TH:i:s'),
|
||||
'end' => $e->end_time?->format('Y-m-d\TH:i:s'),
|
||||
'backgroundColor' => $e->color,
|
||||
'borderColor' => $e->color,
|
||||
'allDay' => $e->is_all_day,
|
||||
@@ -205,8 +235,14 @@ class EventController extends Controller
|
||||
'client' => $e->client?->name,
|
||||
'type' => $e->event_type,
|
||||
'priority' => $e->is_priority,
|
||||
'location' => $e->location,
|
||||
'description' => $e->description,
|
||||
'notes' => $e->notes,
|
||||
'has_contract' => $hasContract,
|
||||
'has_content' => $hasContent,
|
||||
],
|
||||
]);
|
||||
];
|
||||
});
|
||||
|
||||
return response()->json($events);
|
||||
}
|
||||
|
||||
@@ -45,6 +45,9 @@ class InvoiceController extends Controller
|
||||
'issue_date' => 'required|date',
|
||||
'due_date' => 'required|date|after_or_equal:issue_date',
|
||||
'notes' => 'nullable|string',
|
||||
'signature_image' => 'nullable|image|max:2048',
|
||||
'signer_name' => 'nullable|string|max:255',
|
||||
'signer_title' => 'nullable|string|max:255',
|
||||
'bank_name' => 'nullable|string|max:100',
|
||||
'bank_account' => 'nullable|string|max:50',
|
||||
'bank_holder' => 'nullable|string|max:100',
|
||||
@@ -60,6 +63,18 @@ class InvoiceController extends Controller
|
||||
unset($validated['items']);
|
||||
$validated['status'] = InvoiceStatus::Draft->value;
|
||||
|
||||
if ($request->hasFile('signature_image')) {
|
||||
$validated['signature_image'] = $request->file('signature_image')->store('invoice-signatures', 'public');
|
||||
} else {
|
||||
// Fallback to settings signature if none provided at creation
|
||||
$settings = InvoiceSettings::instance();
|
||||
if ($settings->signature_image) {
|
||||
// We reference the same image path, or copy it.
|
||||
// Assuming referencing the same public image is fine.
|
||||
$validated['signature_image'] = $settings->signature_image;
|
||||
}
|
||||
}
|
||||
|
||||
$invoice = $this->invoiceService->create($validated, $items);
|
||||
|
||||
return redirect()->route('invoices.show', $invoice)
|
||||
@@ -94,6 +109,9 @@ class InvoiceController extends Controller
|
||||
'due_date' => 'required|date',
|
||||
'paid_date' => 'nullable|date',
|
||||
'notes' => 'nullable|string',
|
||||
'signature_image' => 'nullable|image|max:2048',
|
||||
'signer_name' => 'nullable|string|max:255',
|
||||
'signer_title' => 'nullable|string|max:255',
|
||||
'bank_name' => 'nullable|string|max:100',
|
||||
'bank_account' => 'nullable|string|max:50',
|
||||
'bank_holder' => 'nullable|string|max:100',
|
||||
@@ -108,6 +126,18 @@ class InvoiceController extends Controller
|
||||
$items = $validated['items'];
|
||||
unset($validated['items']);
|
||||
|
||||
if ($request->hasFile('signature_image')) {
|
||||
if ($invoice->signature_image && \Illuminate\Support\Facades\Storage::disk('public')->exists($invoice->signature_image)) {
|
||||
\Illuminate\Support\Facades\Storage::disk('public')->delete($invoice->signature_image);
|
||||
}
|
||||
$validated['signature_image'] = $request->file('signature_image')->store('invoice-signatures', 'public');
|
||||
} elseif ($request->boolean('remove_signature')) {
|
||||
if ($invoice->signature_image && \Illuminate\Support\Facades\Storage::disk('public')->exists($invoice->signature_image)) {
|
||||
\Illuminate\Support\Facades\Storage::disk('public')->delete($invoice->signature_image);
|
||||
}
|
||||
$validated['signature_image'] = null;
|
||||
}
|
||||
|
||||
$this->invoiceService->update($invoice, $validated, $items);
|
||||
|
||||
return redirect()->route('invoices.show', $invoice)
|
||||
|
||||
@@ -36,19 +36,34 @@ class InvoiceSettingsController extends Controller
|
||||
'default_bank_account' => 'nullable|string|max:50',
|
||||
'default_bank_holder' => 'nullable|string|max:100',
|
||||
'default_notes' => 'nullable|string|max:1000',
|
||||
'signature_image' => 'nullable|image|max:2048',
|
||||
'signer_name' => 'nullable|string|max:100',
|
||||
'signer_title' => 'nullable|string|max:100',
|
||||
]);
|
||||
|
||||
$settings = InvoiceSettings::instance();
|
||||
|
||||
if ($request->hasFile('header_logo')) {
|
||||
// Delete old logo if exists
|
||||
if ($settings->header_logo) {
|
||||
if ($settings->header_logo && Storage::disk('public')->exists($settings->header_logo)) {
|
||||
Storage::disk('public')->delete($settings->header_logo);
|
||||
}
|
||||
$path = $request->file('header_logo')->store('invoice-logos', 'public');
|
||||
$validated['header_logo'] = $path;
|
||||
}
|
||||
|
||||
if ($request->hasFile('signature_image')) {
|
||||
if ($settings->signature_image && Storage::disk('public')->exists($settings->signature_image)) {
|
||||
Storage::disk('public')->delete($settings->signature_image);
|
||||
}
|
||||
$validated['signature_image'] = $request->file('signature_image')->store('invoice-signatures', 'public');
|
||||
} elseif ($request->boolean('remove_signature')) {
|
||||
if ($settings->signature_image && Storage::disk('public')->exists($settings->signature_image)) {
|
||||
Storage::disk('public')->delete($settings->signature_image);
|
||||
}
|
||||
$validated['signature_image'] = null;
|
||||
}
|
||||
|
||||
$settings->update($validated);
|
||||
|
||||
return redirect()->route('invoice-settings.edit')
|
||||
@@ -69,7 +84,7 @@ class InvoiceSettingsController extends Controller
|
||||
$settings->update(['header_logo' => $path]);
|
||||
|
||||
return response()->json([
|
||||
'url' => asset('storage/' . $path),
|
||||
'url' => '/storage/' . $path,
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -85,4 +100,36 @@ class InvoiceSettingsController extends Controller
|
||||
return redirect()->route('invoice-settings.edit')
|
||||
->with('success', '🗑️ Logo removed.');
|
||||
}
|
||||
|
||||
public function uploadSignature(Request $request): JsonResponse
|
||||
{
|
||||
$request->validate([
|
||||
'signature_image' => 'required|image|max:2048',
|
||||
]);
|
||||
|
||||
$settings = InvoiceSettings::instance();
|
||||
|
||||
// Delete old signature if exists
|
||||
if ($settings->signature_image && Storage::disk('public')->exists($settings->signature_image)) {
|
||||
Storage::disk('public')->delete($settings->signature_image);
|
||||
}
|
||||
|
||||
$path = $request->file('signature_image')->store('invoice-signatures', 'public');
|
||||
$settings->update(['signature_image' => $path]);
|
||||
|
||||
return response()->json([
|
||||
'url' => '/storage/' . $path,
|
||||
'path' => $path
|
||||
]);
|
||||
}
|
||||
|
||||
public function deleteSignature(Request $request): JsonResponse
|
||||
{
|
||||
$settings = InvoiceSettings::instance();
|
||||
if ($settings->signature_image && Storage::disk('public')->exists($settings->signature_image)) {
|
||||
Storage::disk('public')->delete($settings->signature_image);
|
||||
}
|
||||
$settings->update(['signature_image' => null]);
|
||||
return response()->json(['message' => 'Signature deleted']);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,11 +34,12 @@ class BrandContract extends Model
|
||||
|
||||
// ── Scopes ───────────────────────────────────────────────────
|
||||
|
||||
public function scopeActive($query)
|
||||
public function scopeActive($query, $date = null)
|
||||
{
|
||||
$date = $date ?? today();
|
||||
return $query->where('is_active', true)
|
||||
->where('start_date', '<=', today())
|
||||
->where('end_date', '>=', today());
|
||||
->where('start_date', '<=', $date)
|
||||
->where('end_date', '>=', $date);
|
||||
}
|
||||
|
||||
// ── Helpers ──────────────────────────────────────────────────
|
||||
|
||||
@@ -21,6 +21,7 @@ class Invoice extends Model
|
||||
'subtotal', 'tax_rate', 'tax_amount', 'total', 'currency',
|
||||
'status', 'issue_date', 'due_date', 'paid_date', 'notes',
|
||||
'bank_name', 'bank_account', 'bank_holder', 'branch_name',
|
||||
'signature_image', 'signer_name', 'signer_title',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
|
||||
@@ -25,6 +25,9 @@ class InvoiceSettings extends Model
|
||||
'default_bank_account',
|
||||
'default_bank_holder',
|
||||
'default_notes',
|
||||
'signature_image',
|
||||
'signer_name',
|
||||
'signer_title',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
|
||||
@@ -23,7 +23,7 @@ class RateCardProfile extends Model
|
||||
public static function getSingleton(): self
|
||||
{
|
||||
return static::firstOrCreate([], [
|
||||
'owner_name' => config('app.name', 'KOL Manager'),
|
||||
'owner_name' => config('app.name', 'Cathy Page'),
|
||||
'bg_color' => '#FFF8F0',
|
||||
'accent_color' => '#FFB7C5',
|
||||
'text_color' => '#374151',
|
||||
|
||||
@@ -21,7 +21,7 @@ class EmailNotifier
|
||||
|
||||
Mail::raw($combined, function ($mail) use ($toEmail, $setting): void {
|
||||
$mail->to($toEmail)
|
||||
->subject("🐱 KOL Manager — {$setting->name} Notifications");
|
||||
->subject("🐱 Cathy's App — {$setting->name} Notifications");
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ class WahaNotifier
|
||||
{
|
||||
$this->send(
|
||||
$setting,
|
||||
"🐱 *KOL Manager — Test Notification*\n\nYour WhatsApp channel is configured correctly! 🎉"
|
||||
"🐱 *Cathy's App — Test Notification*\n\nYour WhatsApp channel is configured correctly! 🎉"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('invoice_settings', function (Blueprint $table) {
|
||||
$table->string('signature_image')->nullable()->after('header_logo');
|
||||
});
|
||||
|
||||
Schema::table('invoices', function (Blueprint $table) {
|
||||
$table->string('signature_image')->nullable()->after('notes');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('invoice_settings', function (Blueprint $table) {
|
||||
$table->dropColumn('signature_image');
|
||||
});
|
||||
|
||||
Schema::table('invoices', function (Blueprint $table) {
|
||||
$table->dropColumn('signature_image');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('invoice_settings', function (Blueprint $table) {
|
||||
$table->string('signer_name')->nullable()->after('signature_image');
|
||||
$table->string('signer_title')->nullable()->after('signer_name');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('invoice_settings', function (Blueprint $table) {
|
||||
$table->dropColumn(['signer_name', 'signer_title']);
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('invoices', function (Blueprint $table) {
|
||||
$table->string('signer_name')->nullable()->after('signature_image');
|
||||
$table->string('signer_title')->nullable()->after('signer_name');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('invoices', function (Blueprint $table) {
|
||||
$table->dropColumn(['signer_name', 'signer_title']);
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -20,10 +20,26 @@ if [ ! -f .env ]; then
|
||||
fi
|
||||
|
||||
# ── 2. Generate APP_KEY if empty ────────────
|
||||
if grep -qE '^APP_KEY=$' .env 2>/dev/null; then
|
||||
echo "[key] Generating application key…"
|
||||
php artisan key:generate --force --quiet
|
||||
if ! grep -qE '^APP_KEY=base64:' .env 2>/dev/null; then
|
||||
echo "[key] Generating application key directly…"
|
||||
|
||||
# 2a. Clear cached configs that might cause MissingAppKeyException
|
||||
php artisan config:clear --quiet 2>/dev/null || true
|
||||
|
||||
# 2b. Generate native base64 key
|
||||
NEW_KEY="base64:$(php -r 'echo base64_encode(random_bytes(32));')"
|
||||
|
||||
if grep -q '^APP_KEY=' .env 2>/dev/null; then
|
||||
# Replace existing empty/invalid APP_KEY safely
|
||||
sed -i "s|^APP_KEY=.*|APP_KEY=$NEW_KEY|" .env
|
||||
else
|
||||
# Append nicely
|
||||
echo "APP_KEY=$NEW_KEY" >> .env
|
||||
fi
|
||||
fi
|
||||
|
||||
# 2c. Force Laravel to read from .env by ditching Docker's empty OS injection
|
||||
unset APP_KEY
|
||||
|
||||
# ── 3. Ensure SQLite database file exists ───
|
||||
if [ ! -f database/database.sqlite ]; then
|
||||
|
||||
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "KOL-Manager",
|
||||
"name": "app",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
@extends('layouts.app')
|
||||
@section('title', 'Categories')
|
||||
@section('page-title', '🏷️ Category Management')
|
||||
@section('page-title', 'Category Management 🏷️')
|
||||
@section('page-subtitle', 'Organise clients, schedules & content by category')
|
||||
|
||||
@section('content')
|
||||
@@ -17,9 +17,8 @@
|
||||
{{-- Add form --}}
|
||||
<div class="cat-card overflow-hidden" x-data="{ open: {{ $errors->any() ? 'true' : 'false' }} }">
|
||||
<div class="flex items-center gap-3 px-5 py-4 border-b border-pink-50">
|
||||
<button type="button" @click="open = !open"
|
||||
class="btn-sakura text-xs"
|
||||
x-text="open ? '✕ Close' : '+ Add New Category'">
|
||||
<button type="button" @click="open = !open" class="btn-sakura text-xs"
|
||||
x-text="open ? '✕ Close' : '+ Add Category'">
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -28,9 +27,9 @@
|
||||
class="p-5 grid grid-cols-2 sm:grid-cols-4 gap-3 items-end border-b border-pink-50">
|
||||
@csrf
|
||||
<div>
|
||||
<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"
|
||||
placeholder="e.g. Energy Drinks"
|
||||
<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" placeholder="e.g. Susu Formula"
|
||||
class="input-soft" value="{{ old('name') }}">
|
||||
</div>
|
||||
<div>
|
||||
@@ -46,8 +45,8 @@
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-semibold text-gray-600 mb-1">Icon (emoji)</label>
|
||||
<input type="text" name="icon" maxlength="10" placeholder="🏷️"
|
||||
class="input-soft" value="{{ old('icon') }}">
|
||||
<input type="text" name="icon" maxlength="10" placeholder="🏷️" class="input-soft"
|
||||
value="{{ old('icon') }}">
|
||||
</div>
|
||||
<div class="flex items-end gap-2">
|
||||
<div class="flex-1">
|
||||
@@ -84,7 +83,8 @@
|
||||
@endif
|
||||
<div class="flex-1 min-w-0">
|
||||
<div class="font-semibold text-gray-700 text-sm">{{ $root->name }}</div>
|
||||
<div class="text-xs text-gray-400">{{ $root->children->count() }} sub · {{ $root->clients_count }} client(s)</div>
|
||||
<div class="text-xs text-gray-400">{{ $root->children->count() }} sub · {{ $root->clients_count }}
|
||||
client(s)</div>
|
||||
</div>
|
||||
<div class="flex gap-2 shrink-0">
|
||||
<button @click="editing = !editing"
|
||||
@@ -95,7 +95,8 @@
|
||||
<form action="{{ route('client-categories.destroy', $root) }}" method="POST"
|
||||
onsubmit="return confirm('Remove this category? Its children will be promoted.')">
|
||||
@csrf @method('DELETE')
|
||||
<button class="text-xs px-3 py-1.5 rounded-full border border-red-100 text-red-400 hover:bg-red-50">
|
||||
<button
|
||||
class="text-xs px-3 py-1.5 rounded-full border border-red-100 text-red-400 hover:bg-red-50">
|
||||
🗑️
|
||||
</button>
|
||||
</form>
|
||||
@@ -144,7 +145,8 @@
|
||||
{{-- Children --}}
|
||||
@foreach($root->children as $child)
|
||||
<div x-data="{ editingC: false }">
|
||||
<div class="flex items-center gap-3 px-5 py-2.5 pl-12 border-t border-pink-50/60 hover:bg-pink-50/20 transition-colors">
|
||||
<div
|
||||
class="flex items-center gap-3 px-5 py-2.5 pl-12 border-t border-pink-50/60 hover:bg-pink-50/20 transition-colors">
|
||||
<span class="text-base w-6 text-center shrink-0">{{ $child->icon ?: '↳' }}</span>
|
||||
@if($child->color)
|
||||
<span class="w-2.5 h-2.5 rounded-full shrink-0" style="background:{{ $child->color }}"></span>
|
||||
@@ -162,7 +164,8 @@
|
||||
<form action="{{ route('client-categories.destroy', $child) }}" method="POST"
|
||||
onsubmit="return confirm('Remove subcategory?')">
|
||||
@csrf @method('DELETE')
|
||||
<button class="text-xs px-2.5 py-1 rounded-full border border-red-100 text-red-400 hover:bg-red-50">
|
||||
<button
|
||||
class="text-xs px-2.5 py-1 rounded-full border border-red-100 text-red-400 hover:bg-red-50">
|
||||
🗑️
|
||||
</button>
|
||||
</form>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title', 'Clients')
|
||||
@section('page-title', 'Clients / CRM 👥')
|
||||
@section('page-title', 'Clients👥')
|
||||
@section('page-subtitle', 'Manage your brand partners and contacts')
|
||||
|
||||
@section('content')
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
<div class="flex items-center justify-between gap-2 mb-3">
|
||||
<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 Client</a>
|
||||
@if(request('category') || request('status'))
|
||||
<a href="{{ route('clients.index') }}"
|
||||
class="text-xs px-3 py-2 rounded-full border border-gray-200 text-gray-500 hover:bg-gray-50 flex items-center gap-1">
|
||||
@@ -22,7 +22,8 @@
|
||||
<button @click="open = !open"
|
||||
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'">
|
||||
<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"
|
||||
stroke="currentColor" stroke-width="2">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M3 4h18M7 10h10M11 16h2" />
|
||||
</svg>
|
||||
Filter
|
||||
@@ -36,35 +37,34 @@
|
||||
<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">
|
||||
{{-- Row 1: search + dropdowns --}}
|
||||
<div class="flex flex-col sm:flex-row sm:items-center gap-2">
|
||||
{{-- Search (fills remaining space on desktop) --}}
|
||||
<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>
|
||||
<input type="text" placeholder="Filter by name…" class="input-soft pl-9 text-sm py-2 w-full"
|
||||
<div class="grid grid-cols-1 sm:grid-cols-12 gap-3 items-center">
|
||||
{{-- Search --}}
|
||||
<div class="relative sm:col-span-5 lg:col-span-6 w-full">
|
||||
<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"
|
||||
oninput="filterClients(this.value)" id="search-input">
|
||||
</div>
|
||||
|
||||
{{-- Category dropdown --}}
|
||||
<select name="category" class="input-soft text-sm py-2 sm:w-48 shrink-0"
|
||||
onchange="this.form.submit()">
|
||||
<div class="sm:col-span-4 lg:col-span-3 w-full">
|
||||
<select name="category" class="input-soft text-sm py-2 w-full" onchange="this.form.submit()">
|
||||
<option value="">All Categories</option>
|
||||
@foreach($categories as $parent)
|
||||
<option value="{{ $parent->id }}"
|
||||
{{ request('category') == $parent->id ? 'selected' : '' }}>
|
||||
<option value="{{ $parent->id }}" {{ request('category') == $parent->id ? 'selected' : '' }}>
|
||||
{{ $parent->icon }} {{ $parent->name }}
|
||||
</option>
|
||||
@foreach($parent->children as $child)
|
||||
<option value="{{ $child->id }}"
|
||||
{{ request('category') == $child->id ? 'selected' : '' }}>
|
||||
<option value="{{ $child->id }}" {{ request('category') == $child->id ? 'selected' : '' }}>
|
||||
↳ {{ $child->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
{{-- Status dropdown --}}
|
||||
<select name="status" class="input-soft text-sm py-2 sm:w-36 shrink-0"
|
||||
onchange="this.form.submit()">
|
||||
<div class="sm:col-span-3 lg:col-span-3 w-full">
|
||||
<select name="status" class="input-soft text-sm py-2 w-full" onchange="this.form.submit()">
|
||||
<option value="">All Statuses</option>
|
||||
@foreach($statuses as $s)
|
||||
<option value="{{ $s->value }}" {{ request('status') === $s->value ? 'selected' : '' }}>
|
||||
@@ -73,6 +73,7 @@
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
@@ -87,8 +88,7 @@
|
||||
<div class="flex items-start gap-3">
|
||||
@if($client->avatar)
|
||||
<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) }}"
|
||||
alt="{{ $client->name }}"
|
||||
<img src="{{ \Illuminate\Support\Facades\Storage::url($client->avatar) }}" alt="{{ $client->name }}"
|
||||
class="w-full h-full object-cover">
|
||||
</div>
|
||||
@else
|
||||
@@ -108,7 +108,8 @@
|
||||
<div class="text-xs text-gray-400 truncate">{{ $client->company }}</div>
|
||||
@endif
|
||||
@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 }}
|
||||
@if($client->category->parent)
|
||||
<span class="text-gray-300 mx-0.5">·</span>
|
||||
@@ -124,10 +125,12 @@
|
||||
<span class="text-xs bg-pink-50 text-pink-600 px-2 py-0.5 rounded-full">📸 {{ $client->ig_handle }}</span>
|
||||
@endif
|
||||
@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
|
||||
@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
|
||||
</div>
|
||||
|
||||
@@ -139,8 +142,10 @@
|
||||
|
||||
@if($client->email || $client->city)
|
||||
<div class="text-xs text-gray-400 space-y-0.5">
|
||||
@if($client->email) <div class="truncate">✉️ {{ $client->email }}</div> @endif
|
||||
@if($client->city) <div>📍 {{ $client->city }}{{ $client->country ? ', '.$client->country : '' }}</div> @endif
|
||||
@if($client->email)
|
||||
<div class="truncate">✉️ {{ $client->email }}</div> @endif
|
||||
@if($client->city)
|
||||
<div>📍 {{ $client->city }}{{ $client->country ? ', ' . $client->country : '' }}</div> @endif
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
</div>
|
||||
<div>
|
||||
<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>
|
||||
|
||||
@@ -116,7 +116,8 @@
|
||||
|
||||
<div class="flex flex-col sm:flex-row gap-3 pt-1">
|
||||
<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') }}"
|
||||
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
|
||||
@@ -135,16 +136,35 @@ function contractCheck(checkUrl) {
|
||||
contractMessage: '',
|
||||
async checkContract() {
|
||||
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);
|
||||
if (!res.ok) throw new Error('Network error');
|
||||
const data = await res.json();
|
||||
if (data) {
|
||||
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 = '';
|
||||
}
|
||||
},
|
||||
submitIfClear(form) {
|
||||
if (this.contractWarning) {
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
@section('content')
|
||||
<div class="flex flex-col sm:flex-row sm:items-center justify-between gap-3 mb-5">
|
||||
<div class="flex gap-2 flex-wrap">
|
||||
<a href="{{ route('content.create') }}" class="btn-sakura text-sm shrink-0">+ New Brief</a>
|
||||
@foreach(['instagram', 'tiktok', 'youtube'] as $p)
|
||||
<a href="{{ request()->fullUrlWithQuery(['platform' => $p]) }}"
|
||||
class="px-3 py-1.5 rounded-full text-xs font-semibold transition-colors
|
||||
@@ -16,10 +17,12 @@
|
||||
</a>
|
||||
@endforeach
|
||||
@if(request('platform'))
|
||||
<a href="{{ route('content.index') }}" class="px-3 py-1.5 rounded-full text-xs text-gray-400 hover:text-gray-600 border border-gray-200 bg-white">✕ Clear</a>
|
||||
<a href="{{ route('content.index') }}"
|
||||
class="px-3 py-1.5 rounded-full text-xs text-gray-400 hover:text-gray-600 border border-gray-200 bg-white">✕
|
||||
Clear</a>
|
||||
@endif
|
||||
</div>
|
||||
<a href="{{ route('content.create') }}" class="btn-sakura text-sm shrink-0">+ New Brief</a>
|
||||
|
||||
</div>
|
||||
|
||||
{{--
|
||||
@@ -28,8 +31,7 @@
|
||||
x-sort:group is on the INNER items div (not the column div) to avoid
|
||||
SortableJS mutating the outer layout container.
|
||||
--}}
|
||||
<div class="grid grid-cols-1 gap-4 lg:flex lg:flex-nowrap lg:gap-4"
|
||||
x-data="kanban()">
|
||||
<div class="grid grid-cols-1 gap-4 lg:flex lg:flex-nowrap lg:gap-4" x-data="kanban()">
|
||||
@foreach($columns as $col)
|
||||
@php $status = $col['status']; @endphp
|
||||
|
||||
@@ -43,23 +45,33 @@
|
||||
<span class="text-base">{{ $status->icon() }}</span>
|
||||
<span class="font-bold text-gray-700 text-sm">{{ $status->label() }}</span>
|
||||
</div>
|
||||
<span class="text-xs bg-white rounded-full px-2 py-0.5 font-bold text-gray-500 shadow-sm">{{ count($col['items']) }}</span>
|
||||
<span
|
||||
class="text-xs bg-white rounded-full px-2 py-0.5 font-bold text-gray-500 shadow-sm">{{ count($col['items']) }}</span>
|
||||
</div>
|
||||
|
||||
{{-- Sortable items container --}}
|
||||
<div class="flex flex-col gap-2 flex-1 min-h-12"
|
||||
x-sort:group="kanban"
|
||||
@sort="moved($event, '{{ $status->value }}')"
|
||||
<div class="flex flex-col gap-2 flex-1 min-h-12 kanban-column"
|
||||
data-col-status="{{ $status->value }}">
|
||||
|
||||
@foreach($col['items'] as $brief)
|
||||
<div class="bg-white rounded-2xl p-3 shadow-sm border border-pink-50 select-none
|
||||
cursor-grab active:cursor-grabbing hover:shadow-md transition-shadow"
|
||||
x-sort:item="{{ $brief->id }}"
|
||||
cursor-grab active:cursor-grabbing hover:shadow-md transition-shadow kanban-item"
|
||||
data-id="{{ $brief->id }}">
|
||||
<div class="flex items-start gap-2 mb-1.5">
|
||||
<span class="text-sm shrink-0">{{ $brief->platform_icon }}</span>
|
||||
<a href="{{ route('content.show', $brief) }}"
|
||||
<a href="#"
|
||||
data-brief="{{ json_encode([
|
||||
'id' => $brief->id,
|
||||
'title' => $brief->title,
|
||||
'platform' => $brief->platform_icon . ' ' . ucfirst($brief->platform),
|
||||
'status' => $brief->status->label(),
|
||||
'client' => $brief->client?->name,
|
||||
'target_date' => $brief->target_date?->format('d M Y'),
|
||||
'hook' => $brief->hook,
|
||||
'body' => $brief->body,
|
||||
'notes' => $brief->notes
|
||||
]) }}"
|
||||
@click.prevent="openModal(JSON.parse($el.dataset.brief))"
|
||||
class="font-semibold text-gray-800 text-xs leading-tight hover:text-pink-500 line-clamp-2 flex-1">
|
||||
{{ $brief->title }}
|
||||
</a>
|
||||
@@ -68,12 +80,14 @@
|
||||
<div class="text-xs text-gray-400 mb-1">👥 {{ $brief->client->name }}</div>
|
||||
@endif
|
||||
@if($brief->target_date)
|
||||
<div class="text-xs {{ $brief->target_date->isPast() && $brief->status->value !== 'posted' ? 'text-red-400 font-bold' : 'text-gray-400' }}">
|
||||
<div
|
||||
class="text-xs {{ $brief->target_date->isPast() && $brief->status->value !== 'posted' ? 'text-red-400 font-bold' : 'text-gray-400' }}">
|
||||
📅 {{ $brief->target_date->format('d M') }}
|
||||
</div>
|
||||
@endif
|
||||
<div class="flex justify-end mt-1.5">
|
||||
<a href="{{ route('content.edit', $brief) }}" class="text-xs text-gray-400 hover:text-pink-500">Edit</a>
|
||||
<a href="{{ route('content.edit', $brief) }}"
|
||||
class="text-xs text-gray-400 hover:text-pink-500">Edit</a>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@@ -87,24 +101,106 @@
|
||||
</a>
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
{{-- Content Detail Request Modal --}}
|
||||
<div x-show="modalOpen" class="fixed inset-0 z-[60] flex items-center justify-center bg-black/40 backdrop-blur-sm" style="display: none;" x-transition>
|
||||
<div @click.outside="modalOpen = false" class="bg-white p-5 w-full max-w-lg rounded-3xl shadow-xl mx-4 max-h-[90vh] flex flex-col relative"
|
||||
x-transition:enter="transition ease-out duration-300"
|
||||
x-transition:enter-start="opacity-0 translate-y-4"
|
||||
x-transition:enter-end="opacity-100 translate-y-0"
|
||||
x-transition:leave="transition ease-in duration-200"
|
||||
x-transition:leave-start="opacity-100 translate-y-0"
|
||||
x-transition:leave-end="opacity-0 translate-y-4">
|
||||
<div class="flex items-center justify-between mb-4 border-b border-pink-50 pb-3 shrink-0">
|
||||
<h3 class="font-extrabold text-gray-800 text-xl truncate pr-4" x-text="activeBrief?.title"></h3>
|
||||
<button @click="modalOpen = false" class="text-gray-400 hover:text-pink-500 hover:bg-pink-50 w-8 h-8 rounded-full flex items-center justify-center transition-colors">✕</button>
|
||||
</div>
|
||||
|
||||
<div class="text-sm text-gray-600 space-y-4 flex-1 overflow-y-auto pr-2 custom-scrollbar">
|
||||
<div class="flex gap-3"><span class="text-gray-400 w-20 shrink-0 font-medium">Platform</span><span class="font-bold text-gray-800" x-text="activeBrief?.platform"></span></div>
|
||||
<div class="flex gap-3"><span class="text-gray-400 w-20 shrink-0 font-medium">Status</span><span class="font-bold badge bg-pink-100 text-pink-700 rounded-full px-2 py-0.5" x-text="activeBrief?.status"></span></div>
|
||||
<template x-if="activeBrief?.client">
|
||||
<div class="flex gap-3 items-center"><span class="text-gray-400 w-20 shrink-0 font-medium">Client</span><span class="font-semibold text-pink-500" x-text="activeBrief?.client"></span></div>
|
||||
</template>
|
||||
<template x-if="activeBrief?.target_date">
|
||||
<div class="flex gap-3"><span class="text-gray-400 w-20 shrink-0 font-medium">Target</span><span class="font-medium" x-text="activeBrief?.target_date"></span></div>
|
||||
</template>
|
||||
|
||||
<template x-if="activeBrief?.hook">
|
||||
<div class="flex flex-col gap-1 mt-4">
|
||||
<span class="text-gray-400 font-medium">🎣 Hook</span>
|
||||
<div class="whitespace-pre-wrap bg-pink-50/50 border border-pink-100 p-3 rounded-2xl text-gray-700 leading-relaxed" x-text="activeBrief?.hook"></div>
|
||||
</div>
|
||||
</template>
|
||||
<template x-if="activeBrief?.body">
|
||||
<div class="flex flex-col gap-1 mt-4">
|
||||
<span class="text-gray-400 font-medium">📖 Body</span>
|
||||
<div class="whitespace-pre-wrap bg-gray-50 border border-gray-100 p-3 rounded-2xl text-gray-700 leading-relaxed" x-text="activeBrief?.body"></div>
|
||||
</div>
|
||||
</template>
|
||||
<template x-if="activeBrief?.notes">
|
||||
<div class="flex flex-col gap-1 mt-4">
|
||||
<span class="text-gray-400 font-medium">📝 Notes</span>
|
||||
<div class="whitespace-pre-wrap bg-yellow-50/50 border border-yellow-100 p-3 rounded-2xl text-gray-700 leading-relaxed" x-text="activeBrief?.notes"></div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
<div class="flex gap-3 mt-5 pt-4 border-t border-pink-50 shrink-0">
|
||||
<a :href="`/content/${activeBrief?.id}/edit`" class="btn-sakura text-sm flex-1 text-center py-2.5">Edit Brief</a>
|
||||
<a :href="`/content/${activeBrief?.id}`" class="py-2.5 rounded-full border border-pink-200 text-pink-500 text-sm hover:bg-pink-50 flex-1 text-center font-bold bg-white transition-colors">Details Page</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@push('scripts')
|
||||
<script src="https://cdn.jsdelivr.net/npm/sortablejs@1.15.2/Sortable.min.js"></script>
|
||||
<script>
|
||||
function kanban() {
|
||||
return {
|
||||
moved(event, targetStatus) {
|
||||
const id = event.item?.dataset?.id;
|
||||
if (!id) return;
|
||||
modalOpen: false,
|
||||
activeBrief: null,
|
||||
init() {
|
||||
// Start Sortable once script loads
|
||||
const initSort = () => {
|
||||
if (typeof Sortable !== 'undefined') {
|
||||
document.querySelectorAll('.kanban-column').forEach(el => {
|
||||
Sortable.create(el, {
|
||||
group: 'kanban-board',
|
||||
animation: 150,
|
||||
onEnd: (evt) => {
|
||||
const id = evt.item.dataset.id;
|
||||
const targetCol = evt.to.dataset.colStatus;
|
||||
if (!id || !targetCol) return;
|
||||
|
||||
// If dropped in same column identically, skip fetch
|
||||
if (evt.from === evt.to && evt.oldIndex === evt.newIndex) return;
|
||||
|
||||
fetch(`/content/${id}/status`, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]').content,
|
||||
},
|
||||
body: JSON.stringify({ status: targetStatus }),
|
||||
}).then(r => { if (r.ok) window.KolManager.notify('Status updated! 🎬'); });
|
||||
body: JSON.stringify({ status: targetCol }),
|
||||
}).then(r => {
|
||||
if (r.ok) window.KolManager.notify('Status updated! 🎬');
|
||||
else window.KolManager.notify('❌ Failed to update status');
|
||||
}).catch(() => window.KolManager.notify('❌ Network error!'));
|
||||
}
|
||||
});
|
||||
});
|
||||
} else {
|
||||
setTimeout(initSort, 100);
|
||||
}
|
||||
};
|
||||
initSort();
|
||||
},
|
||||
openModal(brief) {
|
||||
this.activeBrief = brief;
|
||||
this.modalOpen = true;
|
||||
}
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
@extends('layouts.app')
|
||||
@section('title', 'Brand Contracts')
|
||||
@section('page-title', '📋 Brand Contracts')
|
||||
@section('page-title', 'Brand Contracts 📋')
|
||||
@section('page-subtitle', 'Manage exclusive brand agreements per category')
|
||||
|
||||
@section('content')
|
||||
@@ -19,7 +19,7 @@
|
||||
<div class="flex items-center gap-3 px-5 py-4 border-b border-pink-50">
|
||||
<button type="button" @click="open = !open"
|
||||
class="btn-sakura text-xs"
|
||||
x-text="open ? '✕ Close' : '+ Add New Contract'">
|
||||
x-text="open ? '✕ Close' : '+ Add Contract'">
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
<div>
|
||||
<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"
|
||||
placeholder="e.g. Exclusive – Energy Drinks 2025"
|
||||
placeholder="e.g. Exclusive – Susu Formula 2026"
|
||||
class="input-soft" value="{{ old('title') }}">
|
||||
</div>
|
||||
<div>
|
||||
@@ -209,6 +209,7 @@
|
||||
<li>🔒 When a contract is <strong>Active</strong>, creating schedules or content for a competing brand in the same category will show a warning.</li>
|
||||
<li>✅ The contracted brand itself is always allowed — no warning shown.</li>
|
||||
<li>🏷️ Blocking a <strong>parent category</strong> also blocks all its subcategories.</li>
|
||||
<li>🏷️ Blocking a <strong>child category</strong> does not block the parent category.</li>
|
||||
<li>📅 Contracts only block during their active date range. Expired contracts are ignored automatically.</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -23,7 +23,8 @@
|
||||
@if($activity['priority'])<span class="text-amber-400 text-xs">⭐</span>@endif
|
||||
<span class="text-base shrink-0">{{ $activity['icon'] }}</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 class="text-xs text-gray-500 mt-0.5">{{ $activity['subtitle'] }}</div>
|
||||
</div>
|
||||
@@ -91,7 +92,7 @@
|
||||
|
||||
{{-- ── Bottom Row ───────────────────────────────────────────── --}}
|
||||
<div class="grid grid-cols-1 lg:grid-cols-3 gap-4">
|
||||
|
||||
<!--
|
||||
{{-- Social Stats --}}
|
||||
<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">
|
||||
@@ -118,7 +119,7 @@
|
||||
</p>
|
||||
@endforelse
|
||||
</div>
|
||||
|
||||
-->
|
||||
{{-- Recent Invoices --}}
|
||||
<div class="cat-card p-4 lg:p-5">
|
||||
<div class="flex items-center justify-between mb-3">
|
||||
@@ -155,4 +156,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include('layouts.fab')
|
||||
|
||||
@endsection
|
||||
@@ -4,7 +4,7 @@
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<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 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'])
|
||||
@@ -28,7 +28,7 @@
|
||||
{{-- Logo / header --}}
|
||||
<div class="text-center mb-8 select-none">
|
||||
<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>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -7,13 +7,14 @@
|
||||
@section('content')
|
||||
<div class="max-w-3xl mx-auto">
|
||||
<div class="cat-card p-4 lg:p-8" x-data="invoiceForm()">
|
||||
<form action="{{ route('invoices.store') }}" method="POST">
|
||||
<form action="{{ route('invoices.store') }}" method="POST" enctype="multipart/form-data">
|
||||
@csrf
|
||||
|
||||
{{-- Header fields --}}
|
||||
<div class="grid grid-cols-1 sm:grid-cols-2 gap-3 mb-5">
|
||||
<div class="sm:col-span-2">
|
||||
<label class="block text-sm font-semibold text-gray-700 mb-1">Invoice Title <span class="text-pink-400">*</span></label>
|
||||
<label class="block text-sm font-semibold text-gray-700 mb-1">Invoice Title <span
|
||||
class="text-pink-400">*</span></label>
|
||||
<input type="text" name="title" value="{{ old('title') }}" class="input-soft" required
|
||||
placeholder="e.g. Instagram Collaboration - Brand X">
|
||||
</div>
|
||||
@@ -44,13 +45,13 @@
|
||||
<div>
|
||||
<label class="block text-sm font-semibold text-gray-700 mb-1">Due Date</label>
|
||||
<input type="date" name="due_date"
|
||||
value="{{ old('due_date', today()->addDays(14)->toDateString()) }}"
|
||||
class="input-soft" required>
|
||||
value="{{ old('due_date', today()->addDays(14)->toDateString()) }}" class="input-soft" required>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-semibold text-gray-700 mb-1">Tax Rate (%)</label>
|
||||
<input type="number" name="tax_rate" x-model="taxRate" @input="recalc()"
|
||||
value="{{ old('tax_rate', $invoiceSettings->default_tax_rate ?? 11) }}" class="input-soft" step="0.01">
|
||||
value="{{ old('tax_rate', $invoiceSettings->default_tax_rate ?? 11) }}" class="input-soft"
|
||||
step="0.01">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -65,10 +66,8 @@
|
||||
<template x-for="(item, index) in items" :key="index">
|
||||
<div class="bg-pink-50 rounded-2xl p-3">
|
||||
{{-- Description full width --}}
|
||||
<input type="text" :name="`items[${index}][description]`"
|
||||
x-model="item.description"
|
||||
class="input-soft text-sm mb-2 bg-white"
|
||||
placeholder="Service description" required>
|
||||
<input type="text" :name="`items[${index}][description]`" x-model="item.description"
|
||||
class="input-soft text-sm mb-2 bg-white" placeholder="Service description" required>
|
||||
{{-- Qty / Price / Total in a row --}}
|
||||
<div class="flex gap-2 items-center">
|
||||
<div class="w-16 shrink-0">
|
||||
@@ -81,8 +80,7 @@
|
||||
<label class="text-xs text-gray-400 block mb-0.5">Unit Price</label>
|
||||
<input type="number" :name="`items[${index}][unit_price]`"
|
||||
x-model.number="item.unit_price" @input="recalc()"
|
||||
class="input-soft text-sm bg-white" min="0" step="1000"
|
||||
placeholder="0">
|
||||
class="input-soft text-sm bg-white" min="0" step="1000" placeholder="0">
|
||||
</div>
|
||||
<div class="w-24 shrink-0 text-right">
|
||||
<label class="text-xs text-gray-400 block mb-0.5">Total</label>
|
||||
@@ -96,12 +94,11 @@
|
||||
{{-- Taxable checkbox --}}
|
||||
<div class="mt-2 flex items-center gap-2">
|
||||
<input type="hidden" :name="`items[${index}][is_taxable]`" value="0">
|
||||
<input type="checkbox" :name="`items[${index}][is_taxable]`"
|
||||
:id="`taxable_${index}`"
|
||||
x-model="item.is_taxable" @change="recalc()"
|
||||
value="1"
|
||||
<input type="checkbox" :name="`items[${index}][is_taxable]`" :id="`taxable_${index}`"
|
||||
x-model="item.is_taxable" @change="recalc()" value="1"
|
||||
class="w-3.5 h-3.5 accent-pink-400">
|
||||
<label :for="`taxable_${index}`" class="text-xs text-gray-500 cursor-pointer select-none">
|
||||
<label :for="`taxable_${index}`"
|
||||
class="text-xs text-gray-500 cursor-pointer select-none">
|
||||
Taxable
|
||||
</label>
|
||||
</div>
|
||||
@@ -126,13 +123,20 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-5 flex items-center gap-2 bg-pink-50/50 p-4 rounded-2xl border border-pink-100">
|
||||
<input type="hidden" name="use_custom_fields" value="0">
|
||||
<input type="checkbox" id="useCustomFields" name="use_custom_fields" value="1" x-model="showCustomFields" class="w-4 h-4 text-pink-600 bg-white border-pink-300 rounded focus:ring-pink-500 cursor-pointer">
|
||||
<label for="useCustomFields" class="text-sm font-bold text-gray-700 cursor-pointer select-none">Show Custom Bank & Signature Settings</label>
|
||||
</div>
|
||||
|
||||
<div x-show="showCustomFields" x-collapse>
|
||||
{{-- Bank Info --}}
|
||||
<div class="grid grid-cols-1 sm:grid-cols-2 gap-3 mb-5">
|
||||
<div>
|
||||
<label class="block text-xs font-semibold text-gray-600 mb-1">Bank Name</label>
|
||||
<input type="text" name="bank_name"
|
||||
value="{{ old('bank_name', $invoiceSettings->default_bank_name) }}"
|
||||
class="input-soft text-sm" placeholder="BCA, Mandiri...">
|
||||
value="{{ old('bank_name', $invoiceSettings->default_bank_name) }}" class="input-soft text-sm"
|
||||
placeholder="BCA, Mandiri...">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-semibold text-gray-600 mb-1">Branch Name</label>
|
||||
@@ -154,8 +158,32 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Custom Signature Text --}}
|
||||
<div class="grid grid-cols-1 sm:grid-cols-2 gap-3 mb-5">
|
||||
<div>
|
||||
<label class="block text-xs font-semibold text-gray-600 mb-1">Signer Name</label>
|
||||
<input type="text" name="signer_name" value="{{ old('signer_name') }}" class="input-soft text-sm" placeholder="e.g. Cathy">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-semibold text-gray-600 mb-1">Signer Title</label>
|
||||
<input type="text" name="signer_title" value="{{ old('signer_title') }}" class="input-soft text-sm" placeholder="e.g. Director">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-5">
|
||||
<label class="block text-sm font-semibold text-gray-700 mb-1">Notes</label>
|
||||
<label class="block text-sm font-semibold text-gray-700 mb-1">Custom Signature Image (Optional)</label>
|
||||
<p class="text-xs text-gray-400 mb-2">Leave blank to use your default signature from settings.</p>
|
||||
<input type="file" name="signature_image" accept="image/*" class="w-full text-sm text-gray-600
|
||||
file:mr-3 file:py-1.5 file:px-4
|
||||
file:rounded-full file:border-0
|
||||
file:text-xs file:font-semibold
|
||||
file:bg-pink-50 file:text-pink-600
|
||||
hover:file:bg-pink-100 cursor-pointer">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-5">
|
||||
<label class="block text-sm font-semibold text-gray-700 mb-1">Notes / Payment Terms</label>
|
||||
<textarea name="notes" rows="2" class="input-soft resize-none"
|
||||
placeholder="Payment terms, etc.">{{ old('notes', $invoiceSettings->default_notes) }}</textarea>
|
||||
</div>
|
||||
@@ -175,6 +203,7 @@
|
||||
<script>
|
||||
function invoiceForm() {
|
||||
return {
|
||||
showCustomFields: {{ old('use_custom_fields', false) ? 'true' : 'false' }},
|
||||
items: [{ description: @json($invoiceSettings->default_service_description ?? ''), quantity: 1, unit_price: 0, is_taxable: true }],
|
||||
taxRate: {{ $invoiceSettings->default_tax_rate ?? 11 }},
|
||||
get subtotal() {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
@section('content')
|
||||
<div class="max-w-3xl mx-auto">
|
||||
<div class="cat-card p-4 lg:p-8" x-data="invoiceEditForm()">
|
||||
<form action="{{ route('invoices.update', $invoice) }}" method="POST">
|
||||
<form action="{{ route('invoices.update', $invoice) }}" method="POST" enctype="multipart/form-data">
|
||||
@csrf @method('PUT')
|
||||
|
||||
{{-- Header fields --}}
|
||||
@@ -121,6 +121,13 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-5 flex items-center gap-2 bg-pink-50/50 p-4 rounded-2xl border border-pink-100">
|
||||
<input type="hidden" name="use_custom_fields" value="0">
|
||||
<input type="checkbox" id="useCustomFields" name="use_custom_fields" value="1" x-model="showCustomFields" class="w-4 h-4 text-pink-600 bg-white border-pink-300 rounded focus:ring-pink-500 cursor-pointer">
|
||||
<label for="useCustomFields" class="text-sm font-bold text-gray-700 cursor-pointer select-none">Show Custom Bank & Signature Settings</label>
|
||||
</div>
|
||||
|
||||
<div x-show="showCustomFields" x-collapse>
|
||||
{{-- Bank Info --}}
|
||||
<div class="grid grid-cols-1 sm:grid-cols-2 gap-3 mb-5">
|
||||
<div>
|
||||
@@ -145,8 +152,51 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Custom Signature Text --}}
|
||||
<div class="grid grid-cols-1 sm:grid-cols-2 gap-3 mb-5">
|
||||
<div>
|
||||
<label class="block text-xs font-semibold text-gray-600 mb-1">Signer Name</label>
|
||||
<input type="text" name="signer_name" value="{{ old('signer_name', $invoice->signer_name) }}" class="input-soft text-sm" placeholder="e.g. Cathy">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-semibold text-gray-600 mb-1">Signer Title</label>
|
||||
<input type="text" name="signer_title" value="{{ old('signer_title', $invoice->signer_title) }}" class="input-soft text-sm" placeholder="e.g. Director">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-5" x-data="{
|
||||
removeSign() {
|
||||
if (!confirm('Remove the signature from this invoice?')) return;
|
||||
$refs.removeSignInput.value = '1';
|
||||
this.$el.closest('form').submit();
|
||||
}
|
||||
}">
|
||||
<label class="block text-sm font-semibold text-gray-700 mb-1">Custom Signature Image (Optional)</label>
|
||||
<p class="text-xs text-gray-400 mb-3">Upload a specific signature for this invoice. Leave blank to keep the current one.</p>
|
||||
|
||||
@if($invoice->signature_image)
|
||||
<div class="flex items-center gap-4 mb-3 p-3 bg-white rounded-xl border border-pink-100">
|
||||
<img src="{{ '/storage/' . $invoice->signature_image }}" alt="Signature" class="h-16 object-contain">
|
||||
<div>
|
||||
<input type="hidden" name="remove_signature" value="0" x-ref="removeSignInput">
|
||||
<button type="button" @click="removeSign()" class="text-xs px-3 py-1.5 rounded-full border border-red-200 text-red-400 hover:bg-red-50">
|
||||
🗑️ Remove
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<input type="file" name="signature_image" accept="image/*" class="w-full text-sm text-gray-600
|
||||
file:mr-3 file:py-1.5 file:px-4
|
||||
file:rounded-full file:border-0
|
||||
file:text-xs file:font-semibold
|
||||
file:bg-pink-50 file:text-pink-600
|
||||
hover:file:bg-pink-100 cursor-pointer">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-5">
|
||||
<label class="block text-sm font-semibold text-gray-700 mb-1">Notes</label>
|
||||
<label class="block text-sm font-semibold text-gray-700 mb-1">Notes / Payment Terms</label>
|
||||
<textarea name="notes" rows="2" class="input-soft resize-none">{{ old('notes', $invoice->notes) }}</textarea>
|
||||
</div>
|
||||
|
||||
@@ -170,6 +220,7 @@ function invoiceEditForm() {
|
||||
});
|
||||
@endphp
|
||||
return {
|
||||
showCustomFields: {{ old('use_custom_fields', ($invoice->bank_name || $invoice->signature_image || $invoice->signer_name || $invoice->signer_title) ? true : false) ? 'true' : 'false' }},
|
||||
items: @json($itemsJson),
|
||||
taxRate: {{ $invoice->tax_rate }},
|
||||
get subtotal() {
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
<div class="flex flex-col sm:flex-row sm:items-center justify-between gap-3 mb-5">
|
||||
|
||||
<div class="flex gap-2 shrink-0">
|
||||
<a href="{{ route('invoices.create') }}" class="btn-sakura text-sm">+ New Invoice</a>
|
||||
<a href="{{ route('invoice-settings.edit') }}"
|
||||
class="text-xs px-3 py-2 rounded-full border border-gray-200 text-gray-500 hover:bg-gray-50 flex items-center gap-1">
|
||||
class="btn-sakura text-sm px-3 py-2 rounded-full border border-gray-200 text-gray-500 hover:bg-gray-50 flex items-center gap-1">
|
||||
⚙️ Settings
|
||||
</a>
|
||||
<a href="{{ route('invoices.create') }}" class="btn-sakura text-sm">+ New Invoice</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -33,16 +33,20 @@
|
||||
<span class="font-bold text-gray-800">{{ $invoice->formatted_total }}</span>
|
||||
</div>
|
||||
<div class="flex gap-2 mt-3 pt-3 border-t border-pink-50">
|
||||
<a href="{{ route('invoices.show', $invoice) }}" class="flex-1 text-center text-xs py-1.5 px-3 rounded-full border border-pink-200 text-pink-600 hover:bg-pink-50">View</a>
|
||||
<a href="{{ route('invoices.pdf', $invoice) }}" target="_blank" class="flex-1 text-center text-xs py-1.5 px-3 rounded-full border border-pink-200 text-pink-600 hover:bg-pink-50">PDF</a>
|
||||
<a href="{{ route('invoices.edit', $invoice) }}" class="flex-1 text-center text-xs py-1.5 px-3 rounded-full border border-pink-200 text-gray-600 hover:bg-pink-50">Edit</a>
|
||||
<a href="{{ route('invoices.show', $invoice) }}"
|
||||
class="flex-1 text-center text-xs py-1.5 px-3 rounded-full border border-pink-200 text-pink-600 hover:bg-pink-50">View</a>
|
||||
<a href="{{ route('invoices.pdf', $invoice) }}" target="_blank"
|
||||
class="flex-1 text-center text-xs py-1.5 px-3 rounded-full border border-pink-200 text-pink-600 hover:bg-pink-50">PDF</a>
|
||||
<a href="{{ route('invoices.edit', $invoice) }}"
|
||||
class="flex-1 text-center text-xs py-1.5 px-3 rounded-full border border-pink-200 text-gray-600 hover:bg-pink-50">Edit</a>
|
||||
{{-- Share button disabled --}}
|
||||
</div>
|
||||
</div>
|
||||
@empty
|
||||
<div class="text-center py-16 text-gray-400">
|
||||
<span class="text-5xl block mb-2">🧾</span>
|
||||
<p>No invoices yet. <a href="{{ route('invoices.create') }}" class="text-pink-500 hover:underline">Create one!</a></p>
|
||||
<p>No invoices yet. <a href="{{ route('invoices.create') }}" class="text-pink-500 hover:underline">Create
|
||||
one!</a></p>
|
||||
</div>
|
||||
@endforelse
|
||||
</div>
|
||||
@@ -65,7 +69,8 @@
|
||||
<tbody>
|
||||
@forelse($invoices as $invoice)
|
||||
<tr class="border-b border-pink-50 hover:bg-pink-50/50 transition-colors">
|
||||
<td class="px-5 py-4 font-mono text-sm font-semibold text-gray-700">{{ $invoice->invoice_number }}</td>
|
||||
<td class="px-5 py-4 font-mono text-sm font-semibold text-gray-700">{{ $invoice->invoice_number }}
|
||||
</td>
|
||||
<td class="px-5 py-4 text-sm text-gray-600">{{ $invoice->client?->name ?? '—' }}</td>
|
||||
<td class="px-5 py-4 text-sm text-gray-700 max-w-xs truncate">{{ $invoice->title }}</td>
|
||||
<td class="px-5 py-4 font-bold text-gray-800 text-sm">{{ $invoice->formatted_total }}</td>
|
||||
@@ -75,21 +80,28 @@
|
||||
<span class="text-red-400 text-xs block">Overdue!</span>
|
||||
@endif
|
||||
</td>
|
||||
<td class="px-5 py-4"><span class="badge {{ $invoice->status->badgeClass() }}">{{ $invoice->status->label() }}</span></td>
|
||||
<td class="px-5 py-4"><span
|
||||
class="badge {{ $invoice->status->badgeClass() }}">{{ $invoice->status->label() }}</span>
|
||||
</td>
|
||||
<td class="px-5 py-4">
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('invoices.show', $invoice) }}" class="text-xs text-pink-500 hover:underline">View</a>
|
||||
<a href="{{ route('invoices.pdf', $invoice) }}" class="text-xs text-pink-500 hover:underline" target="_blank">PDF</a>
|
||||
<a href="{{ route('invoices.edit', $invoice) }}" class="text-xs text-gray-500 hover:underline">Edit</a>
|
||||
<a href="{{ route('invoices.show', $invoice) }}"
|
||||
class="text-xs text-pink-500 hover:underline">View</a>
|
||||
<a href="{{ route('invoices.pdf', $invoice) }}"
|
||||
class="text-xs text-pink-500 hover:underline" target="_blank">PDF</a>
|
||||
<a href="{{ route('invoices.edit', $invoice) }}"
|
||||
class="text-xs text-gray-500 hover:underline">Edit</a>
|
||||
{{-- Share button disabled --}}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr><td colspan="7" class="text-center py-16 text-gray-400">
|
||||
<tr>
|
||||
<td colspan="7" class="text-center py-16 text-gray-400">
|
||||
<span class="text-4xl block mb-2">🧾</span>
|
||||
No invoices yet.
|
||||
</td></tr>
|
||||
</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
@php
|
||||
@@ -9,69 +10,226 @@
|
||||
$g = hexdec(substr($hex, 2, 2));
|
||||
$b = hexdec(substr($hex, 4, 2));
|
||||
// 92% white + 8% accent → very light tint
|
||||
$tint = sprintf('#%02X%02X%02X',
|
||||
$tint = sprintf(
|
||||
'#%02X%02X%02X',
|
||||
(int) (255 * 0.92 + $r * 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)
|
||||
$tintMid = sprintf('#%02X%02X%02X',
|
||||
$tintMid = sprintf(
|
||||
'#%02X%02X%02X',
|
||||
(int) (255 * 0.80 + $r * 0.20),
|
||||
(int) (255 * 0.80 + $g * 0.20),
|
||||
(int) (255 * 0.80 + $b * 0.20)
|
||||
);
|
||||
@endphp
|
||||
<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-table { width: 100%; margin-bottom: 36px; }
|
||||
.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; }
|
||||
.header-table {
|
||||
width: 100%;
|
||||
margin-bottom: 36px;
|
||||
}
|
||||
|
||||
.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-table { width: 100%; margin-bottom: 28px; }
|
||||
.section-title { font-size: 10px; font-weight: 700; 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; }
|
||||
.billing-table {
|
||||
width: 100%;
|
||||
margin-bottom: 28px;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 10px;
|
||||
font-weight: 700;
|
||||
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 ───────────────────────────── */
|
||||
table.items { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
|
||||
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; }
|
||||
table.items {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
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-wrap { width: 100%; margin-bottom: 24px; }
|
||||
.totals-inner { width: 260px; float: right; }
|
||||
.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; }
|
||||
.totals-wrap {
|
||||
width: 100%;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.totals-inner {
|
||||
width: 260px;
|
||||
float: right;
|
||||
}
|
||||
|
||||
.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 ─────────────────────────── */
|
||||
.bank-box { background: {{ $tint }}; border-radius: 10px;
|
||||
padding: 14px 16px; margin-bottom: 16px; }
|
||||
.bank-title { font-weight: 700; font-size: 12px; color: #374151; margin-bottom: 4px; }
|
||||
.bank-detail { font-size: 12px; color: #6B7280; }
|
||||
.bank-box {
|
||||
background:
|
||||
{{ $tint }}
|
||||
;
|
||||
border-radius: 10px;
|
||||
padding: 14px 16px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.notes { font-size: 11px; color: #9CA3AF; font-style: italic; }
|
||||
.footer { margin-top: 40px; text-align: center; font-size: 11px; color: #D1D5DB; }
|
||||
.bank-title {
|
||||
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>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
{{-- ── Header ─────────────────────────────────────────────────── --}}
|
||||
@@ -83,12 +241,14 @@
|
||||
@if($invoiceSettings->header_logo && file_exists(storage_path('app/public/' . $invoiceSettings->header_logo)))
|
||||
<td style="vertical-align:middle; padding-right:12px; width:64px;">
|
||||
<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>
|
||||
@endif
|
||||
<td style="vertical-align:middle;">
|
||||
<div class="logo-name">{{ $invoiceSettings->header_name ?: 'KOL Manager' }}</div>
|
||||
<div class="logo-sub">{{ $invoiceSettings->header_title ?: 'Personal Talent Assistant' }}</div>
|
||||
<div class="logo-name">{{ $invoiceSettings->header_name ?: 'Cathy' }}</div>
|
||||
<div class="logo-sub">{{ $invoiceSettings->header_title ?: 'Personal Talent Assistant' }}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -106,9 +266,12 @@
|
||||
<div class="section-title">Bill To</div>
|
||||
@if($invoice->client)
|
||||
<div class="billing-name">{{ $invoice->client->name }}</div>
|
||||
@if($invoice->client->company) <div class="billing-detail">{{ $invoice->client->company }}</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
|
||||
@if($invoice->client->company)
|
||||
<div class="billing-detail">{{ $invoice->client->company }}</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
|
||||
<div class="billing-detail">—</div>
|
||||
@endif
|
||||
@@ -116,10 +279,19 @@
|
||||
<td style="width:50%; vertical-align:top; text-align:right;">
|
||||
<div class="section-title">Invoice Details</div>
|
||||
<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><td class="lbl">Due Date</td><td class="val">{{ $invoice->due_date->format('d M Y') }}</td></tr>
|
||||
<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)
|
||||
<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
|
||||
</table>
|
||||
</td>
|
||||
@@ -142,7 +314,8 @@
|
||||
<td>
|
||||
{{ $item->description }}
|
||||
@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
|
||||
</td>
|
||||
<td class="td-center">{{ $item->quantity }}</td>
|
||||
@@ -164,7 +337,8 @@
|
||||
@if($invoice->tax_rate > 0)
|
||||
<tr>
|
||||
<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>
|
||||
@endif
|
||||
<tr class="totals-total">
|
||||
@@ -187,11 +361,33 @@
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div style="margin-top: 40px;">
|
||||
@if($invoice->notes)
|
||||
<div class="notes">{{ $invoice->notes }}</div>
|
||||
<div class="notes" style="width: 50%; float: left; margin-top: 10px;">{{ $invoice->notes }}</div>
|
||||
@endif
|
||||
|
||||
<div class="footer">Generated by KOL Manager · Thank you for the collaboration!</div>
|
||||
@if($invoice->signature_image && file_exists(storage_path('app/public/' . $invoice->signature_image)))
|
||||
<div style="width: 200px; float: right; text-align: center;">
|
||||
<div style="font-size: 11px; color: #374151; margin-bottom: 12px;">
|
||||
Jakarta, {{ $invoice->issue_date->format('d F Y') }}
|
||||
</div>
|
||||
<img src="{{ storage_path('app/public/' . $invoice->signature_image) }}" style="max-height: 80px; max-width: 180px; object-fit: contain; margin-bottom: 8px;">
|
||||
<div style="font-size: 12px; font-weight: 800; color: #111827; text-transform: uppercase;">
|
||||
{{ $invoice->signer_name ?: ($invoiceSettings->signer_name ?: ($invoiceSettings->header_name ?: 'Signature')) }}
|
||||
</div>
|
||||
@if($invoice->signer_title || $invoiceSettings->signer_title || $invoiceSettings->header_title)
|
||||
<div style="font-size: 10px; color: #6B7280; text-transform: uppercase; margin-top: 3px;">
|
||||
{{ $invoice->signer_title ?: ($invoiceSettings->signer_title ?: $invoiceSettings->header_title) }}
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div style="clear: both;"></div>
|
||||
</div>
|
||||
|
||||
<div class="footer">Thank you for the collaboration!</div>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -8,7 +8,7 @@
|
||||
<div class="max-w-2xl mx-auto">
|
||||
<div class="flex items-center gap-3 mb-5">
|
||||
<a href="{{ route('invoices.index') }}"
|
||||
class="text-xs px-3 py-2 rounded-full border border-pink-200 text-gray-500 hover:bg-pink-50">
|
||||
class="btn-sakura text-sm px-3 py-2 rounded-full border border-pink-200 text-gray-500 hover:bg-pink-50">
|
||||
← Back to Invoices
|
||||
</a>
|
||||
</div>
|
||||
@@ -21,8 +21,7 @@
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<form action="{{ route('invoice-settings.update') }}" method="POST" enctype="multipart/form-data"
|
||||
class="space-y-5">
|
||||
<form action="{{ route('invoice-settings.update') }}" method="POST" enctype="multipart/form-data" class="space-y-5">
|
||||
@csrf
|
||||
|
||||
{{-- Number Format --}}
|
||||
@@ -34,9 +33,8 @@
|
||||
Prefix <span class="text-pink-400">*</span>
|
||||
</label>
|
||||
<input type="text" name="invoice_prefix"
|
||||
value="{{ old('invoice_prefix', $settings->invoice_prefix) }}"
|
||||
class="input-soft text-sm" placeholder="INV-EA" required
|
||||
id="prefix-input" oninput="updatePreview()">
|
||||
value="{{ old('invoice_prefix', $settings->invoice_prefix) }}" class="input-soft text-sm"
|
||||
placeholder="INV-EA" required id="prefix-input" oninput="updatePreview()">
|
||||
<p class="text-xs text-gray-400 mt-1">e.g. <code>INV-EA</code> → <strong>INV-EA-001</strong></p>
|
||||
</div>
|
||||
<div>
|
||||
@@ -45,8 +43,7 @@
|
||||
</label>
|
||||
<input type="number" name="invoice_next_number"
|
||||
value="{{ old('invoice_next_number', $settings->invoice_next_number) }}"
|
||||
class="input-soft text-sm" min="1" required
|
||||
id="number-input" oninput="updatePreview()">
|
||||
class="input-soft text-sm" min="1" required id="number-input" oninput="updatePreview()">
|
||||
<p class="text-xs text-gray-400 mt-1">Used for the next new invoice</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -62,11 +59,10 @@
|
||||
<h2 class="text-sm font-bold text-gray-700 mb-4 flex items-center gap-2">🎨 Invoice Header</h2>
|
||||
|
||||
{{-- Logo auto-upload (independent of main Save form) --}}
|
||||
<div class="mb-4"
|
||||
x-data="{
|
||||
<div class="mb-4" x-data="{
|
||||
uploading: false,
|
||||
errorMsg: '',
|
||||
logoUrl: '{{ $settings->header_logo ? asset('storage/' . $settings->header_logo) : '' }}',
|
||||
logoUrl: '{{ $settings->header_logo ? '/storage/' . $settings->header_logo : '' }}',
|
||||
|
||||
async pickFile(input) {
|
||||
if (!input.files.length) return;
|
||||
@@ -76,7 +72,7 @@
|
||||
fd.append('header_logo', input.files[0]);
|
||||
fd.append('_token', document.querySelector('meta[name=csrf-token]').content);
|
||||
try {
|
||||
const res = await fetch('{{ route('invoice-settings.upload-logo') }}', { method: 'POST', body: fd });
|
||||
const res = await fetch('{{ route('invoice-settings.upload-logo', [], false) }}', { method: 'POST', body: fd });
|
||||
const data = await res.json();
|
||||
if (res.ok) {
|
||||
this.logoUrl = data.url + '?t=' + Date.now();
|
||||
@@ -95,7 +91,7 @@
|
||||
const fd = new FormData();
|
||||
fd.append('_token', document.querySelector('meta[name=csrf-token]').content);
|
||||
fd.append('_method', 'DELETE');
|
||||
await fetch('{{ route('invoice-settings.delete-logo') }}', { method: 'POST', body: fd });
|
||||
await fetch('{{ route('invoice-settings.delete-logo', [], false) }}', { method: 'POST', body: fd });
|
||||
this.logoUrl = '';
|
||||
}
|
||||
}">
|
||||
@@ -118,15 +114,12 @@
|
||||
|
||||
<label class="block text-xs font-semibold text-gray-600 mb-1">Logo / Profile Picture</label>
|
||||
<div class="relative">
|
||||
<input type="file" accept="image/*"
|
||||
@change="pickFile($event.target)"
|
||||
class="w-full text-sm text-gray-600
|
||||
<input type="file" accept="image/*" @change="pickFile($event.target)" class="w-full text-sm text-gray-600
|
||||
file:mr-3 file:py-1.5 file:px-4
|
||||
file:rounded-full file:border-0
|
||||
file:text-xs file:font-semibold
|
||||
file:bg-pink-50 file:text-pink-600
|
||||
hover:file:bg-pink-100 cursor-pointer"
|
||||
:disabled="uploading">
|
||||
hover:file:bg-pink-100 cursor-pointer" :disabled="uploading">
|
||||
<span x-show="uploading" class="text-xs text-pink-500 mt-1 block">Uploading…</span>
|
||||
<span x-show="errorMsg" x-text="errorMsg" class="text-xs text-red-500 mt-1 block"></span>
|
||||
</div>
|
||||
@@ -136,14 +129,12 @@
|
||||
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
|
||||
<div>
|
||||
<label class="block text-xs font-semibold text-gray-600 mb-1">Talent / Business Name</label>
|
||||
<input type="text" name="header_name"
|
||||
value="{{ old('header_name', $settings->header_name) }}"
|
||||
<input type="text" name="header_name" value="{{ old('header_name', $settings->header_name) }}"
|
||||
class="input-soft text-sm" placeholder="Your name or brand">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-semibold text-gray-600 mb-1">Title / Tagline</label>
|
||||
<input type="text" name="header_title"
|
||||
value="{{ old('header_title', $settings->header_title) }}"
|
||||
<input type="text" name="header_title" value="{{ old('header_title', $settings->header_title) }}"
|
||||
class="input-soft text-sm" placeholder="Content Creator · KOL">
|
||||
</div>
|
||||
<div x-data="{ color: '{{ old('accent_color', $settings->accent_color ?? '#FFB7C5') }}' }">
|
||||
@@ -188,8 +179,8 @@
|
||||
<div>
|
||||
<label class="block text-xs font-semibold text-gray-600 mb-1">Default Bank Name</label>
|
||||
<input type="text" name="default_bank_name"
|
||||
value="{{ old('default_bank_name', $settings->default_bank_name) }}"
|
||||
class="input-soft text-sm" placeholder="BCA, Mandiri…">
|
||||
value="{{ old('default_bank_name', $settings->default_bank_name) }}" class="input-soft text-sm"
|
||||
placeholder="BCA, Mandiri…">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-semibold text-gray-600 mb-1">Default Branch Name</label>
|
||||
@@ -214,6 +205,82 @@
|
||||
<textarea name="default_notes" rows="2" class="input-soft text-sm resize-none"
|
||||
placeholder="e.g. Payment due within 14 days from invoice date.">{{ old('default_notes', $settings->default_notes) }}</textarea>
|
||||
</div>
|
||||
|
||||
<div class="sm:col-span-2 mt-2 pt-4 border-t border-gray-100">
|
||||
<label class="block text-xs font-semibold text-gray-600 mb-1">Default Signature Image</label>
|
||||
<p class="text-xs text-gray-400 mb-3">Upload your signature here so it appears automatically on all new invoices.</p>
|
||||
|
||||
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4 mb-4">
|
||||
<div>
|
||||
<label class="block text-xs font-semibold text-gray-600 mb-1">Signer Name</label>
|
||||
<input type="text" name="signer_name" placeholder="e.g. {{ $settings->header_name ?: 'John Doe' }}" value="{{ old('signer_name', $settings->signer_name) }}" class="input-soft text-sm">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-semibold text-gray-600 mb-1">Signer Title</label>
|
||||
<input type="text" name="signer_title" placeholder="e.g. {{ $settings->header_title ?: 'Manager' }}" value="{{ old('signer_title', $settings->signer_title) }}" class="input-soft text-sm">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div x-data="{
|
||||
uploading: false,
|
||||
errorMsg: '',
|
||||
signatureUrl: '{{ $settings->signature_image ? '/storage/' . $settings->signature_image : '' }}',
|
||||
|
||||
async pickFile(input) {
|
||||
if (!input.files.length) return;
|
||||
this.uploading = true;
|
||||
this.errorMsg = '';
|
||||
const fd = new FormData();
|
||||
fd.append('signature_image', input.files[0]);
|
||||
fd.append('_token', document.querySelector('meta[name=csrf-token]').content);
|
||||
try {
|
||||
const res = await fetch('{{ route('invoice-settings.upload-signature', [], false) }}', { method: 'POST', body: fd });
|
||||
const data = await res.json();
|
||||
if (res.ok) {
|
||||
this.signatureUrl = data.url + '?t=' + Date.now();
|
||||
} else {
|
||||
this.errorMsg = data.message ?? 'Upload failed.';
|
||||
}
|
||||
} catch {
|
||||
this.errorMsg = 'Network error. Please try again.';
|
||||
}
|
||||
this.uploading = false;
|
||||
input.value = '';
|
||||
},
|
||||
|
||||
async removeSignature() {
|
||||
if (!confirm('Remove this signature?')) return;
|
||||
const fd = new FormData();
|
||||
fd.append('_token', document.querySelector('meta[name=csrf-token]').content);
|
||||
fd.append('_method', 'DELETE');
|
||||
await fetch('{{ route('invoice-settings.delete-signature', [], false) }}', { method: 'POST', body: fd });
|
||||
this.signatureUrl = '';
|
||||
}
|
||||
}">
|
||||
|
||||
<template x-if="signatureUrl">
|
||||
<div class="flex items-center gap-4 mb-3 p-3 bg-white rounded-xl border border-pink-100">
|
||||
<img :src="signatureUrl" alt="Signature preview" class="h-16 object-contain">
|
||||
<div>
|
||||
<button type="button" @click="removeSignature()" class="text-xs px-3 py-1.5 rounded-full border border-red-200 text-red-400 hover:bg-red-50">
|
||||
🗑️ Remove
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div class="relative">
|
||||
<input type="file" accept="image/*" @change="pickFile($event.target)" class="w-full text-sm text-gray-600
|
||||
file:mr-3 file:py-1.5 file:px-4
|
||||
file:rounded-full file:border-0
|
||||
file:text-xs file:font-semibold
|
||||
file:bg-pink-50 file:text-pink-600
|
||||
hover:file:bg-pink-100 cursor-pointer" :disabled="uploading">
|
||||
<span x-show="uploading" class="text-xs text-pink-500 mt-1 block">Uploading…</span>
|
||||
<span x-show="errorMsg" x-text="errorMsg" class="text-xs text-red-500 mt-1 block"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -8,10 +8,14 @@
|
||||
<div class="max-w-3xl mx-auto">
|
||||
<div class="flex gap-3 mb-6">
|
||||
<a href="{{ route('invoices.edit', $invoice) }}" class="btn-sakura">Edit</a>
|
||||
<a href="{{ route('invoices.pdf', $invoice) }}" target="_blank" class="btn btn-outline rounded-full text-pink-500 border-pink-300">📥 Download PDF</a>
|
||||
<form action="{{ route('invoices.destroy', $invoice) }}" method="POST" onsubmit="return confirm('Delete this invoice?')">
|
||||
<a href="{{ route('invoices.pdf', $invoice) }}" target="_blank"
|
||||
class="btn-sakura text-sm px-4 py-2.5 rounded-full border border-pink-200 text-pink-500 hover:bg-pink-50">📥
|
||||
Download PDF</a>
|
||||
<form action="{{ route('invoices.destroy', $invoice) }}" method="POST"
|
||||
onsubmit="return confirm('Delete this invoice?')">
|
||||
@csrf @method('DELETE')
|
||||
<button class="btn btn-ghost rounded-full text-error">Delete</button>
|
||||
<button
|
||||
class="btn-sakura text-sm px-4 py-2.5 rounded-full border border-red-200 text-red-500 hover:bg-red-50">Delete</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -20,13 +24,12 @@
|
||||
<div class="flex justify-between items-start mb-8">
|
||||
<div class="flex items-center gap-3">
|
||||
@if($invoiceSettings->header_logo)
|
||||
<img src="{{ asset('storage/' . $invoiceSettings->header_logo) }}"
|
||||
alt="Logo" class="h-14 w-14 object-cover rounded-2xl border border-pink-100 shrink-0">
|
||||
<img src="{{ asset('storage/' . $invoiceSettings->header_logo) }}" alt="Logo"
|
||||
class="h-14 w-14 object-cover rounded-2xl border border-pink-100 shrink-0">
|
||||
@endif
|
||||
<div>
|
||||
<div class="text-xl font-extrabold"
|
||||
style="color:{{ $invoiceSettings->accent_color ?? '#FFB7C5' }}">
|
||||
{{ $invoiceSettings->header_name ?: '🐱 KOL Manager' }}
|
||||
<div class="text-xl font-extrabold" style="color:{{ $invoiceSettings->accent_color ?? '#FFB7C5' }}">
|
||||
{{ $invoiceSettings->header_name ?: '🐱 Cathy' }}
|
||||
</div>
|
||||
<div class="text-sm text-gray-400 mt-0.5">
|
||||
{{ $invoiceSettings->header_title ?: 'Personal Talent Assistant' }}
|
||||
@@ -45,9 +48,12 @@
|
||||
<h4 class="text-xs font-bold text-gray-400 uppercase mb-2">Bill To</h4>
|
||||
@if($invoice->client)
|
||||
<div class="font-semibold text-gray-800">{{ $invoice->client->name }}</div>
|
||||
@if($invoice->client->company) <div class="text-sm text-gray-500">{{ $invoice->client->company }}</div> @endif
|
||||
@if($invoice->client->email) <div class="text-sm text-gray-500">{{ $invoice->client->email }}</div> @endif
|
||||
@if($invoice->client->full_address) <div class="text-sm text-gray-400">{{ $invoice->client->full_address }}</div> @endif
|
||||
@if($invoice->client->company)
|
||||
<div class="text-sm text-gray-500">{{ $invoice->client->company }}</div> @endif
|
||||
@if($invoice->client->email)
|
||||
<div class="text-sm text-gray-500">{{ $invoice->client->email }}</div> @endif
|
||||
@if($invoice->client->full_address)
|
||||
<div class="text-sm text-gray-400">{{ $invoice->client->full_address }}</div> @endif
|
||||
@else
|
||||
<div class="text-gray-500 text-sm">No client</div>
|
||||
@endif
|
||||
@@ -56,8 +62,12 @@
|
||||
<div class="text-xs font-bold text-gray-400 uppercase mb-2">Invoice Details</div>
|
||||
<div class="text-sm space-y-1">
|
||||
<div><span class="text-gray-400">Issue:</span> {{ $invoice->issue_date->format('d M Y') }}</div>
|
||||
<div><span class="text-gray-400">Due:</span> <span class="{{ $invoice->due_date->isPast() && $invoice->status->value !== 'paid' ? 'text-red-500 font-bold' : '' }}">{{ $invoice->due_date->format('d M Y') }}</span></div>
|
||||
@if($invoice->paid_date) <div><span class="text-gray-400">Paid:</span> {{ $invoice->paid_date->format('d M Y') }}</div> @endif
|
||||
<div><span class="text-gray-400">Due:</span> <span
|
||||
class="{{ $invoice->due_date->isPast() && $invoice->status->value !== 'paid' ? 'text-red-500 font-bold' : '' }}">{{ $invoice->due_date->format('d M Y') }}</span>
|
||||
</div>
|
||||
@if($invoice->paid_date)
|
||||
<div><span class="text-gray-400">Paid:</span> {{ $invoice->paid_date->format('d M Y') }}</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -69,7 +79,8 @@
|
||||
$r = hexdec(substr($hex, 0, 2));
|
||||
$g = hexdec(substr($hex, 2, 2));
|
||||
$b = hexdec(substr($hex, 4, 2));
|
||||
$tint = sprintf('#%02X%02X%02X',
|
||||
$tint = sprintf(
|
||||
'#%02X%02X%02X',
|
||||
(int) (255 * 0.92 + $r * 0.08),
|
||||
(int) (255 * 0.92 + $g * 0.08),
|
||||
(int) (255 * 0.92 + $b * 0.08)
|
||||
@@ -90,12 +101,15 @@
|
||||
<td class="py-3 px-4 text-sm text-gray-700">
|
||||
{{ $item->description }}
|
||||
@if(!$item->is_taxable)
|
||||
<span class="ml-1.5 text-xs bg-gray-100 text-gray-500 px-2 py-0.5 rounded-full font-medium">Non-Taxable</span>
|
||||
<span
|
||||
class="ml-1.5 text-xs bg-gray-100 text-gray-500 px-2 py-0.5 rounded-full font-medium">Non-Taxable</span>
|
||||
@endif
|
||||
</td>
|
||||
<td class="py-3 px-4 text-sm text-center text-gray-600">{{ $item->quantity }}</td>
|
||||
<td class="py-3 px-4 text-sm text-right text-gray-600">Rp {{ number_format($item->unit_price, 0, ',', '.') }}</td>
|
||||
<td class="py-3 px-4 text-sm text-right font-semibold text-gray-800">Rp {{ number_format($item->total, 0, ',', '.') }}</td>
|
||||
<td class="py-3 px-4 text-sm text-right text-gray-600">Rp
|
||||
{{ number_format($item->unit_price, 0, ',', '.') }}</td>
|
||||
<td class="py-3 px-4 text-sm text-right font-semibold text-gray-800">Rp
|
||||
{{ number_format($item->total, 0, ',', '.') }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
@@ -105,7 +119,8 @@
|
||||
<div class="flex justify-end mb-8">
|
||||
<div class="w-72 space-y-2 text-sm">
|
||||
<div class="flex justify-between text-gray-500">
|
||||
<span>Subtotal</span><span class="font-medium">Rp {{ number_format($invoice->subtotal, 0, ',', '.') }}</span>
|
||||
<span>Subtotal</span><span class="font-medium">Rp
|
||||
{{ number_format($invoice->subtotal, 0, ',', '.') }}</span>
|
||||
</div>
|
||||
@if($invoice->tax_rate > 0)
|
||||
<div class="flex justify-between text-amber-600">
|
||||
@@ -132,9 +147,29 @@
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="flex flex-col sm:flex-row justify-between items-start mt-10 gap-6">
|
||||
<div class="flex-1 text-left">
|
||||
@if($invoice->notes)
|
||||
<div class="mt-4 text-sm text-gray-500 italic">{{ $invoice->notes }}</div>
|
||||
<div class="text-sm text-gray-500 italic">{{ $invoice->notes }}</div>
|
||||
@endif
|
||||
</div>
|
||||
@if($invoice->signature_image)
|
||||
<div class="shrink-0 text-center w-full sm:w-auto">
|
||||
<div class="text-sm text-gray-500 mb-3">
|
||||
Jakarta, {{ $invoice->issue_date->format('d F Y') }}
|
||||
</div>
|
||||
<img src="{{ '/storage/' . $invoice->signature_image }}" alt="Signature" class="h-20 object-contain mb-3 mx-auto">
|
||||
<div class="text-sm font-extrabold text-gray-800 uppercase tracking-wide">
|
||||
{{ $invoice->signer_name ?: ($invoiceSettings->signer_name ?: ($invoiceSettings->header_name ?: 'Signature')) }}
|
||||
</div>
|
||||
@if($invoice->signer_title || $invoiceSettings->signer_title || $invoiceSettings->header_title)
|
||||
<div class="text-xs text-gray-400 uppercase mt-0.5 tracking-wider">
|
||||
{{ $invoice->signer_title ?: ($invoiceSettings->signer_title ?: $invoiceSettings->header_title) }}
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -1,5 +1,6 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" data-theme="light">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<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">
|
||||
@vite(['resources/css/app.css', 'resources/js/app.js'])
|
||||
</head>
|
||||
|
||||
<body class="bg-cream font-sans antialiased" x-data="appShell()">
|
||||
|
||||
{{-- ── Backdrop (mobile only) ─────────────────────────────────── --}}
|
||||
<div
|
||||
x-show="sidebarOpen"
|
||||
x-transition:enter="transition-opacity duration-300"
|
||||
x-transition:enter-start="opacity-0"
|
||||
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>
|
||||
<div x-show="sidebarOpen" x-transition:enter="transition-opacity duration-300" x-transition:enter-start="opacity-0"
|
||||
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 ─────────────────────────────────────────────────── --}}
|
||||
<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
|
||||
<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
|
||||
flex flex-col py-6 px-4
|
||||
transition-transform duration-300 ease-in-out
|
||||
lg:translate-x-0"
|
||||
>
|
||||
lg:translate-x-0">
|
||||
{{-- Logo --}}
|
||||
<div class="flex items-center justify-between gap-3 mb-8 px-2">
|
||||
<a href="{{ route('dashboard') }}" @click="sidebarOpen = false"
|
||||
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-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>
|
||||
</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>
|
||||
|
||||
{{-- Nav --}}
|
||||
<nav class="flex flex-col gap-1 flex-1 overflow-y-auto">
|
||||
<a href="{{ route('dashboard') }}"
|
||||
@click="sidebarOpen = false"
|
||||
<a href="{{ route('dashboard') }}" @click="sidebarOpen = false"
|
||||
class="nav-item {{ request()->routeIs('dashboard') ? 'active' : '' }}">
|
||||
<span class="text-lg shrink-0">🏠</span> Dashboard
|
||||
</a>
|
||||
|
||||
<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') }}"
|
||||
@click="sidebarOpen = false"
|
||||
<a href="{{ route('schedule.index') }}" @click="sidebarOpen = false"
|
||||
class="nav-item {{ request()->routeIs('schedule.*') ? 'active' : '' }}">
|
||||
<span class="text-lg shrink-0">📅</span>
|
||||
<span class="flex-1">Schedule</span>
|
||||
</a>
|
||||
|
||||
<a href="{{ route('clients.index') }}"
|
||||
@click="sidebarOpen = false"
|
||||
<a href="{{ route('clients.index') }}" @click="sidebarOpen = false"
|
||||
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 href="{{ route('client-categories.index') }}"
|
||||
@click="sidebarOpen = false"
|
||||
<a href="{{ route('client-categories.index') }}" @click="sidebarOpen = false"
|
||||
class="nav-item {{ request()->routeIs('client-categories.*') ? 'active' : '' }}">
|
||||
<span class="text-lg shrink-0">🏷️</span> Categories
|
||||
</a>
|
||||
|
||||
<a href="{{ route('contracts.index') }}"
|
||||
@click="sidebarOpen = false"
|
||||
<a href="{{ route('contracts.index') }}" @click="sidebarOpen = false"
|
||||
class="nav-item {{ request()->routeIs('contracts.*') ? 'active' : '' }}">
|
||||
<span class="text-lg shrink-0">📋</span> Brand Contracts
|
||||
<span class="text-lg shrink-0">📋</span> Contracts
|
||||
</a>
|
||||
|
||||
<!--
|
||||
<a href="{{ route('social-hub.index') }}"
|
||||
@click="sidebarOpen = false"
|
||||
class="nav-item {{ request()->routeIs('social-hub.*') ? 'active' : '' }}">
|
||||
<span class="text-lg shrink-0">📱</span> Social Hub
|
||||
</a>
|
||||
|
||||
-->
|
||||
<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') }}"
|
||||
@click="sidebarOpen = false"
|
||||
<a href="{{ route('invoices.index') }}" @click="sidebarOpen = false"
|
||||
class="nav-item {{ request()->routeIs('invoices.*') ? 'active' : '' }}">
|
||||
<span class="text-lg shrink-0">🧾</span> Invoices
|
||||
</a>
|
||||
|
||||
<a href="{{ route('rate-cards.index') }}"
|
||||
@click="sidebarOpen = false"
|
||||
<a href="{{ route('rate-cards.index') }}" @click="sidebarOpen = false"
|
||||
class="nav-item {{ request()->routeIs('rate-cards.*') ? 'active' : '' }}">
|
||||
<span class="text-lg shrink-0">💰</span> Rate Cards
|
||||
</a>
|
||||
|
||||
<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') }}"
|
||||
@click="sidebarOpen = false"
|
||||
<a href="{{ route('content.index') }}" @click="sidebarOpen = false"
|
||||
class="nav-item {{ request()->routeIs('content.*') ? 'active' : '' }}">
|
||||
<span class="text-lg shrink-0">🎬</span> Content Board
|
||||
</a>
|
||||
|
||||
<a href="{{ route('files.index') }}"
|
||||
@click="sidebarOpen = false"
|
||||
<a href="{{ route('files.index') }}" @click="sidebarOpen = false"
|
||||
class="nav-item {{ request()->routeIs('files.*') ? 'active' : '' }}">
|
||||
<span class="text-lg shrink-0">📁</span> Files
|
||||
</a>
|
||||
|
||||
<a href="{{ route('notes.index') }}"
|
||||
@click="sidebarOpen = false"
|
||||
<a href="{{ route('notes.index') }}" @click="sidebarOpen = false"
|
||||
class="nav-item {{ request()->routeIs('notes.*') ? 'active' : '' }}">
|
||||
<span class="text-lg shrink-0">📝</span> Notes
|
||||
</a>
|
||||
|
||||
<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') }}"
|
||||
@click="sidebarOpen = false"
|
||||
<a href="{{ route('settings.notifications') }}" @click="sidebarOpen = false"
|
||||
class="nav-item {{ request()->routeIs('settings.*') ? 'active' : '' }}">
|
||||
<span class="text-lg shrink-0">🔔</span> Notifications
|
||||
</a>
|
||||
@@ -152,48 +134,42 @@
|
||||
<div class="flex-1 flex flex-col min-w-0">
|
||||
|
||||
{{-- ── 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) --}}
|
||||
<button
|
||||
@click="sidebarOpen = true"
|
||||
<button @click="sidebarOpen = true"
|
||||
class="lg:hidden text-2xl transition-transform duration-150 active:scale-90 focus:outline-none select-none"
|
||||
aria-label="Open menu"
|
||||
>🐱</button>
|
||||
aria-label="Open menu">🐱</button>
|
||||
|
||||
{{-- Page title (hidden when search open) --}}
|
||||
<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>
|
||||
<p class="text-xs lg:text-sm text-gray-400 hidden sm:block">@yield('page-subtitle', today()->format('l, d F Y'))</p>
|
||||
<h1 class="text-base lg:text-xl font-bold text-gray-800 truncate">@yield('page-title', 'Dashboard')
|
||||
</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>
|
||||
|
||||
{{-- ── Global Search bar ─────────────────────────── --}}
|
||||
<div class="flex-1 min-w-0" x-show="searchOpen" x-transition style="display:none">
|
||||
<div class="relative">
|
||||
<span class="absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 text-sm pointer-events-none">🔍</span>
|
||||
<input
|
||||
id="global-search-input"
|
||||
type="text"
|
||||
placeholder="Search clients, events, invoices…"
|
||||
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"
|
||||
>
|
||||
<span
|
||||
class="absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 text-sm pointer-events-none"></span>
|
||||
<input id="global-search-input" type="text" placeholder="Search clients, events, invoices…"
|
||||
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 --}}
|
||||
<div
|
||||
x-show="searchResults.length > 0 || (searchQuery.length >= 2 && !searchLoading)"
|
||||
<div 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"
|
||||
@click.outside="searchResults = []"
|
||||
>
|
||||
@click.outside="searchResults = []">
|
||||
<template x-if="searchLoading">
|
||||
<div class="px-4 py-3 text-sm text-gray-400 flex items-center gap-2">
|
||||
<span class="animate-spin">🐾</span> Searching…
|
||||
</div>
|
||||
</template>
|
||||
<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 x-for="group in searchResults" :key="group.type">
|
||||
<div>
|
||||
@@ -205,8 +181,10 @@
|
||||
@click="closeSearch()">
|
||||
<span class="text-lg shrink-0" x-text="item.icon"></span>
|
||||
<div class="min-w-0">
|
||||
<div class="text-sm font-semibold text-gray-700 truncate" x-text="item.title"></div>
|
||||
<div class="text-xs text-gray-400 truncate" x-text="item.subtitle"></div>
|
||||
<div class="text-sm font-semibold text-gray-700 truncate"
|
||||
x-text="item.title"></div>
|
||||
<div class="text-xs text-gray-400 truncate" x-text="item.subtitle">
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</template>
|
||||
@@ -226,20 +204,19 @@
|
||||
{{-- Right actions --}}
|
||||
<div class="flex items-center gap-2 shrink-0">
|
||||
{{-- Search toggle --}}
|
||||
<button
|
||||
@click="toggleSearch()"
|
||||
<button @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"
|
||||
:title="searchOpen ? 'Close search' : 'Search'"
|
||||
aria-label="Toggle search"
|
||||
>
|
||||
:title="searchOpen ? 'Close search' : 'Search'" aria-label="Toggle search">
|
||||
<span x-text="searchOpen ? '✕' : '🔍'" class="text-sm lg:text-base"></span>
|
||||
</button>
|
||||
|
||||
<!--
|
||||
{{-- 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"
|
||||
style="background: linear-gradient(135deg, #FFB7C5, #E8D5F5);">
|
||||
FUN
|
||||
</div>
|
||||
-->
|
||||
</div>
|
||||
</header>
|
||||
|
||||
@@ -310,4 +287,5 @@ function appShell() {
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
57
resources/views/layouts/fab.blade.php
Normal file
57
resources/views/layouts/fab.blade.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<div x-data="{ open: false }" class="fixed bottom-6 right-6 z-50 flex flex-col items-end">
|
||||
{{-- Menu items (hidden by default) --}}
|
||||
<div x-show="open" x-transition:enter="transition ease-out duration-200"
|
||||
x-transition:enter-start="opacity-0 translate-y-4 scale-95"
|
||||
x-transition:enter-end="opacity-100 translate-y-0 scale-100"
|
||||
x-transition:leave="transition ease-in duration-150"
|
||||
x-transition:leave-start="opacity-100 translate-y-0 scale-100"
|
||||
x-transition:leave-end="opacity-0 translate-y-4 scale-95"
|
||||
@click.away="open = false"
|
||||
class="flex flex-col items-end gap-3 mb-4" style="display: none;">
|
||||
|
||||
<a href="{{ route('files.index') }}" class="flex items-center gap-3 group">
|
||||
<span class="bg-gray-800 text-white font-medium text-xs px-3 py-2 rounded-lg shadow-xl min-w-max hidden lg:block opacity-0 translate-x-4 group-hover:opacity-100 group-hover:translate-x-0 transition-all duration-300 ease-out">Upload File</span>
|
||||
<div class="w-12 h-12 rounded-full bg-teal-500 text-white flex items-center justify-center shadow hover:scale-110 transition-transform duration-200 text-lg">📁</div>
|
||||
</a>
|
||||
|
||||
<a href="{{ route('notes.index') }}" class="flex items-center gap-3 group">
|
||||
<span class="bg-gray-800 text-white font-medium text-xs px-3 py-2 rounded-lg shadow-xl min-w-max hidden lg:block opacity-0 translate-x-4 group-hover:opacity-100 group-hover:translate-x-0 transition-all duration-300 ease-out">Add Notes</span>
|
||||
<div class="w-12 h-12 rounded-full bg-yellow-400 text-white flex items-center justify-center shadow hover:scale-110 transition-transform duration-200 text-lg">📝</div>
|
||||
</a>
|
||||
|
||||
<a href="{{ route('content.create') }}" class="flex items-center gap-3 group">
|
||||
<span class="bg-gray-800 text-white font-medium text-xs px-3 py-2 rounded-lg shadow-xl min-w-max hidden lg:block opacity-0 translate-x-4 group-hover:opacity-100 group-hover:translate-x-0 transition-all duration-300 ease-out">New Board</span>
|
||||
<div class="w-12 h-12 rounded-full bg-purple-500 text-white flex items-center justify-center shadow hover:scale-110 transition-transform duration-200 text-lg">🎬</div>
|
||||
</a>
|
||||
|
||||
<a href="{{ route('contracts.index') }}" class="flex items-center gap-3 group">
|
||||
<span class="bg-gray-800 text-white font-medium text-xs px-3 py-2 rounded-lg shadow-xl min-w-max hidden lg:block opacity-0 translate-x-4 group-hover:opacity-100 group-hover:translate-x-0 transition-all duration-300 ease-out">New Contract</span>
|
||||
<div class="w-12 h-12 rounded-full bg-rose-500 text-white flex items-center justify-center shadow hover:scale-110 transition-transform duration-200 text-lg">📄</div>
|
||||
</a>
|
||||
|
||||
<a href="{{ route('invoices.create') }}" class="flex items-center gap-3 group">
|
||||
<span class="bg-gray-800 text-white font-medium text-xs px-3 py-2 rounded-lg shadow-xl min-w-max hidden lg:block opacity-0 translate-x-4 group-hover:opacity-100 group-hover:translate-x-0 transition-all duration-300 ease-out">New Invoice</span>
|
||||
<div class="w-12 h-12 rounded-full bg-amber-500 text-white flex items-center justify-center shadow hover:scale-110 transition-transform duration-200 text-lg">🧾</div>
|
||||
</a>
|
||||
|
||||
<a href="{{ route('clients.create') }}" class="flex items-center gap-3 group">
|
||||
<span class="bg-gray-800 text-white font-medium text-xs px-3 py-2 rounded-lg shadow-xl min-w-max hidden lg:block opacity-0 translate-x-4 group-hover:opacity-100 group-hover:translate-x-0 transition-all duration-300 ease-out">Add Client</span>
|
||||
<div class="w-12 h-12 rounded-full bg-emerald-500 text-white flex items-center justify-center shadow hover:scale-110 transition-transform duration-200 text-lg">👥</div>
|
||||
</a>
|
||||
|
||||
<a href="{{ route('schedule.create') }}" class="flex items-center gap-3 group">
|
||||
<span class="bg-gray-800 text-white font-medium text-xs px-3 py-2 rounded-lg shadow-xl min-w-max hidden lg:block opacity-0 translate-x-4 group-hover:opacity-100 group-hover:translate-x-0 transition-all duration-300 ease-out">Add Event</span>
|
||||
<div class="w-12 h-12 rounded-full bg-blue-500 text-white flex items-center justify-center shadow hover:scale-110 transition-transform duration-200 text-lg">📅</div>
|
||||
</a>
|
||||
|
||||
</div>
|
||||
|
||||
{{-- Main FAB button --}}
|
||||
<button @click="open = !open"
|
||||
class="w-16 h-16 rounded-full bg-pink-500 hover:bg-pink-600 text-white flex items-center justify-center shadow-lg shadow-pink-500/40 hover:shadow-2xl hover:shadow-pink-500/50 transition-all duration-300 hover:-translate-y-1 hover:scale-105 active:scale-95 z-50 transform"
|
||||
:class="{'rotate-45 bg-pink-600': open}">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-8 w-8 transition-transform duration-300" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="3">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M12 4v16m8-8H4" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
@@ -1,7 +1,7 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title', 'Notes')
|
||||
@section('page-title', '📝 Notes')
|
||||
@section('page-title', 'Notes Management 📝')
|
||||
@section('page-subtitle', 'Quick notes, checklists & reminders')
|
||||
|
||||
@section('content')
|
||||
@@ -10,15 +10,14 @@
|
||||
|
||||
{{-- ── Toolbar ──────────────────────────────────────────────── --}}
|
||||
<div class="flex items-center gap-2 mb-4">
|
||||
<button @click="openNew()"
|
||||
class="btn-sakura text-sm px-4 py-2 flex items-center gap-1.5 shrink-0">
|
||||
<button @click="openNew()" class="btn-sakura text-sm px-4 py-2 flex items-center gap-1.5 shrink-0">
|
||||
+ New Note
|
||||
</button>
|
||||
|
||||
{{-- Search --}}
|
||||
<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>
|
||||
<input type="text" x-model="searchQuery" placeholder="Search notes…"
|
||||
<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…"
|
||||
class="input-soft pl-9 text-sm py-2 w-full">
|
||||
</div>
|
||||
|
||||
@@ -37,11 +36,12 @@
|
||||
<template x-for="note in filteredPinned" :key="note.id">
|
||||
<div class="rounded-3xl p-4 flex flex-col gap-2 shadow-sm border border-black/5 cursor-pointer
|
||||
hover:shadow-md transition-shadow duration-200 group relative"
|
||||
:style="`background:${note.color || '#FFFFFF'}`"
|
||||
@click="openEdit(note)">
|
||||
:style="`background:${note.color || '#FFFFFF'}`" @click="openEdit(note)">
|
||||
|
||||
{{-- Pin badge --}}
|
||||
<div class="absolute top-2.5 right-2.5 text-xs text-amber-400 opacity-60 group-hover:opacity-100">📌</div>
|
||||
<div
|
||||
class="absolute top-2.5 right-2.5 text-xs text-amber-400 opacity-60 group-hover:opacity-100">
|
||||
📌</div>
|
||||
|
||||
{{-- Title --}}
|
||||
<p class="font-bold text-gray-800 text-sm leading-snug pr-5 line-clamp-2"
|
||||
@@ -86,8 +86,7 @@
|
||||
<template x-for="note in filteredUnpinned" :key="note.id">
|
||||
<div class="rounded-3xl p-4 flex flex-col gap-2 shadow-sm border border-black/5 cursor-pointer
|
||||
hover:shadow-md transition-shadow duration-200 group"
|
||||
:style="`background:${note.color || '#FFFFFF'}`"
|
||||
@click="openEdit(note)">
|
||||
:style="`background:${note.color || '#FFFFFF'}`" @click="openEdit(note)">
|
||||
|
||||
{{-- Title --}}
|
||||
<p class="font-bold text-gray-800 text-sm leading-snug line-clamp-2"
|
||||
@@ -142,21 +141,14 @@
|
||||
{{-- ════════════════════════════════════════════════════════════
|
||||
Note Editor Modal
|
||||
════════════════════════════════════════════════════════════ --}}
|
||||
<div x-show="showModal"
|
||||
x-transition:enter="transition ease-out duration-200"
|
||||
x-transition:enter-start="opacity-0"
|
||||
x-transition:enter-end="opacity-100"
|
||||
x-transition:leave="transition ease-in duration-150"
|
||||
x-transition:leave-start="opacity-100"
|
||||
x-transition:leave-end="opacity-0"
|
||||
<div x-show="showModal" x-transition:enter="transition ease-out duration-200" x-transition:enter-start="opacity-0"
|
||||
x-transition:enter-end="opacity-100" x-transition:leave="transition ease-in duration-150"
|
||||
x-transition:leave-start="opacity-100" x-transition:leave-end="opacity-0"
|
||||
class="fixed inset-0 z-50 flex items-end sm:items-center justify-center bg-black/40 px-0 sm:px-4"
|
||||
style="display:none"
|
||||
@keydown.escape.window="showModal = false">
|
||||
style="display:none" @keydown.escape.window="showModal = false">
|
||||
|
||||
<div class="w-full sm:max-w-lg rounded-t-3xl sm:rounded-3xl shadow-2xl flex flex-col overflow-hidden"
|
||||
:style="`background:${editorColor || '#FFFFFF'}`"
|
||||
style="max-height:90vh"
|
||||
@click.stop>
|
||||
:style="`background:${editorColor || '#FFFFFF'}`" style="max-height:90vh" @click.stop>
|
||||
|
||||
{{-- ── Modal Header ─────────────────────────────── --}}
|
||||
<div class="flex items-center gap-2 px-4 pt-4 pb-3 border-b border-black/5 shrink-0">
|
||||
@@ -188,8 +180,7 @@
|
||||
<div class="flex-1 overflow-y-auto px-4 py-3 space-y-1">
|
||||
|
||||
{{-- Title --}}
|
||||
<input type="text" x-model="editorTitle" x-ref="titleInput"
|
||||
placeholder="Note title…"
|
||||
<input type="text" x-model="editorTitle" x-ref="titleInput" placeholder="Note title…"
|
||||
class="w-full bg-transparent border-none outline-none font-bold text-gray-800 text-lg placeholder-gray-300 mb-2"
|
||||
@keydown.enter.prevent="focusFirstBlock()">
|
||||
|
||||
@@ -203,21 +194,18 @@
|
||||
</template>
|
||||
<template x-if="block.type === 'checkbox'">
|
||||
<input type="checkbox" x-model="block.checked"
|
||||
class="w-4 h-4 accent-pink-400 shrink-0 cursor-pointer mt-px"
|
||||
@click.stop>
|
||||
class="w-4 h-4 accent-pink-400 shrink-0 cursor-pointer mt-px" @click.stop>
|
||||
</template>
|
||||
<template x-if="block.type === 'paragraph'">
|
||||
<span class="w-4 shrink-0"></span>
|
||||
</template>
|
||||
|
||||
{{-- Text input --}}
|
||||
<input type="text"
|
||||
x-model="block.text"
|
||||
<input type="text" x-model="block.text"
|
||||
:placeholder="block.type === 'paragraph' ? 'Add text…' : block.type === 'bullet' ? 'List item…' : 'To-do item…'"
|
||||
:class="block.type === 'checkbox' && block.checked ? 'line-through text-gray-400' : 'text-gray-700'"
|
||||
class="flex-1 bg-transparent border-none outline-none text-sm placeholder-gray-300 py-0.5"
|
||||
:data-block-id="block.id"
|
||||
@keydown.enter.prevent="insertBlockAfter(idx)"
|
||||
:data-block-id="block.id" @keydown.enter.prevent="insertBlockAfter(idx)"
|
||||
@keydown.backspace="handleBackspace($event, block, idx)">
|
||||
|
||||
{{-- Block type switcher (hover) --}}
|
||||
@@ -232,7 +220,8 @@
|
||||
:class="block.type === 'checkbox' ? 'text-pink-500' : 'text-gray-300 hover:text-gray-500'"
|
||||
class="text-xs px-1 leading-none" title="Checkbox">☐</button>
|
||||
<button @click.stop="removeBlock(idx)" type="button"
|
||||
class="text-xs px-1 leading-none text-gray-300 hover:text-red-400 ml-1" title="Remove">✕</button>
|
||||
class="text-xs px-1 leading-none text-gray-300 hover:text-red-400 ml-1"
|
||||
title="Remove">✕</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -257,10 +246,10 @@
|
||||
{{-- ── Modal Footer ─────────────────────────────── --}}
|
||||
<div class="flex gap-2 px-4 pb-5 pt-3 border-t border-black/5 shrink-0">
|
||||
<button @click="saveNote()" type="button"
|
||||
class="btn-sakura flex-1 py-2.5 text-sm flex items-center justify-center gap-2"
|
||||
:disabled="saving">
|
||||
class="btn-sakura flex-1 py-2.5 text-sm flex items-center justify-center gap-2" :disabled="saving">
|
||||
<span x-show="!saving">💾 Save Note</span>
|
||||
<span x-show="saving" class="flex items-center gap-1.5"><span class="animate-spin inline-block">🐾</span> Saving…</span>
|
||||
<span x-show="saving" class="flex items-center gap-1.5"><span
|
||||
class="animate-spin inline-block">🐾</span> Saving…</span>
|
||||
</button>
|
||||
<button @click="showModal = false" type="button"
|
||||
class="flex-1 py-2.5 rounded-full border border-pink-200 text-gray-600 text-sm hover:bg-pink-50 transition-colors">
|
||||
|
||||
@@ -33,10 +33,19 @@
|
||||
<input type="text" name="content_type" value="{{ old('content_type') }}" class="input-soft"
|
||||
placeholder="Reel, Story, Feed...">
|
||||
</div>
|
||||
<div>
|
||||
<div x-data="{
|
||||
rawPrice: '{{ old('price', '') }}',
|
||||
get formattedPrice() {
|
||||
if (!this.rawPrice) return '';
|
||||
return parseInt(this.rawPrice).toLocaleString('id-ID');
|
||||
},
|
||||
set formattedPrice(val) {
|
||||
this.rawPrice = val.replace(/\D/g, '');
|
||||
}
|
||||
}">
|
||||
<label class="block text-sm font-semibold text-gray-700 mb-1">Price <span class="text-pink-400">*</span></label>
|
||||
<input type="number" name="price" value="{{ old('price') }}" class="input-soft"
|
||||
min="0" step="100000" required placeholder="0">
|
||||
<input type="hidden" name="price" :value="rawPrice">
|
||||
<input type="text" x-model="formattedPrice" class="input-soft" required placeholder="0">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-semibold text-gray-700 mb-1">Currency</label>
|
||||
|
||||
@@ -33,10 +33,19 @@
|
||||
<input type="text" name="content_type" value="{{ old('content_type', $rateCard->content_type) }}"
|
||||
class="input-soft" placeholder="Reel, Story...">
|
||||
</div>
|
||||
<div>
|
||||
<div x-data="{
|
||||
rawPrice: '{{ old('price', $rateCard->price) }}',
|
||||
get formattedPrice() {
|
||||
if (!this.rawPrice) return '';
|
||||
return parseInt(this.rawPrice).toLocaleString('id-ID');
|
||||
},
|
||||
set formattedPrice(val) {
|
||||
this.rawPrice = val.replace(/\D/g, '');
|
||||
}
|
||||
}">
|
||||
<label class="block text-sm font-semibold text-gray-700 mb-1">Price</label>
|
||||
<input type="number" name="price" value="{{ old('price', $rateCard->price) }}"
|
||||
class="input-soft" min="0" step="100000">
|
||||
<input type="hidden" name="price" :value="rawPrice">
|
||||
<input type="text" x-model="formattedPrice" class="input-soft" placeholder="0">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-semibold text-gray-700 mb-1">Currency</label>
|
||||
|
||||
@@ -7,20 +7,20 @@
|
||||
@section('content')
|
||||
<div class="flex flex-wrap items-center justify-between gap-3 mb-5">
|
||||
<div class="flex flex-wrap items-center gap-2">
|
||||
<a href="{{ route('rate-cards.create') }}" class="btn-sakura text-sm shrink-0">+ Add Service</a>
|
||||
<a href="{{ route('rate-cards.public') }}" target="_blank"
|
||||
class="text-xs px-3 py-2 rounded-full border border-pink-200 text-pink-500 hover:bg-pink-50 flex items-center gap-1">
|
||||
class="btn-sakura text-sm px-3 py-2 rounded-full border border-pink-200 text-pink-500 hover:bg-pink-50 flex items-center gap-1">
|
||||
🔗 Public Page
|
||||
</a>
|
||||
<a href="{{ route('rate-cards.pdf') }}"
|
||||
class="text-xs px-3 py-2 rounded-full border border-blue-200 text-blue-500 hover:bg-blue-50 flex items-center gap-1">
|
||||
class="btn-sakura text-sm px-3 py-2 rounded-full border border-blue-200 text-blue-500 hover:bg-blue-50 flex items-center gap-1">
|
||||
📄 PDF
|
||||
</a>
|
||||
<a href="{{ route('rate-cards.profile') }}"
|
||||
class="text-xs px-3 py-2 rounded-full border border-purple-200 text-purple-500 hover:bg-purple-50 flex items-center gap-1">
|
||||
class="btn-sakura text-sm px-3 py-2 rounded-full border border-purple-200 text-purple-500 hover:bg-purple-50 flex items-center gap-1">
|
||||
🎨 Profile
|
||||
</a>
|
||||
</div>
|
||||
<a href="{{ route('rate-cards.create') }}" class="btn-sakura text-sm shrink-0">+ Add Service</a>
|
||||
</div>
|
||||
|
||||
@php
|
||||
@@ -43,10 +43,12 @@
|
||||
<div class="min-w-0">
|
||||
<h3 class="font-bold text-gray-800 text-sm leading-tight">{{ $card->service_name }}</h3>
|
||||
@if($card->content_type)
|
||||
<span class="text-xs bg-pink-50 text-pink-600 px-2 py-0.5 rounded-full inline-block mt-1">{{ $card->content_type }}</span>
|
||||
<span
|
||||
class="text-xs bg-pink-50 text-pink-600 px-2 py-0.5 rounded-full inline-block mt-1">{{ $card->content_type }}</span>
|
||||
@endif
|
||||
</div>
|
||||
<span class="text-xs px-2 py-1 rounded-full shrink-0
|
||||
<span
|
||||
class="text-xs px-2 py-1 rounded-full shrink-0
|
||||
{{ $card->is_active ? 'bg-green-100 text-green-600' : 'bg-gray-100 text-gray-400' }}">
|
||||
{{ $card->is_active ? 'Active' : 'Hidden' }}
|
||||
</span>
|
||||
|
||||
@@ -26,52 +26,50 @@
|
||||
</div>
|
||||
<div class="p-5 grid grid-cols-1 sm:grid-cols-2 gap-4">
|
||||
<div>
|
||||
<label class="block text-xs font-semibold text-gray-600 mb-1">Display Name <span class="text-pink-400">*</span></label>
|
||||
<input type="text" name="owner_name" required
|
||||
value="{{ old('owner_name', $profile->owner_name) }}"
|
||||
<label class="block text-xs font-semibold text-gray-600 mb-1">Display Name <span
|
||||
class="text-pink-400">*</span></label>
|
||||
<input type="text" name="owner_name" required value="{{ old('owner_name', $profile->owner_name) }}"
|
||||
class="input-soft" placeholder="e.g. Sakura KOL">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-semibold text-gray-600 mb-1">Tagline</label>
|
||||
<input type="text" name="tagline"
|
||||
value="{{ old('tagline', $profile->tagline) }}"
|
||||
class="input-soft" placeholder="e.g. Lifestyle & Beauty Creator">
|
||||
<input type="text" name="tagline" value="{{ old('tagline', $profile->tagline) }}" class="input-soft"
|
||||
placeholder="e.g. Lifestyle & Beauty Creator">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-semibold text-gray-600 mb-1">Email</label>
|
||||
<input type="email" name="email"
|
||||
value="{{ old('email', $profile->email) }}"
|
||||
class="input-soft" placeholder="hi@example.com">
|
||||
<input type="email" name="email" value="{{ old('email', $profile->email) }}" class="input-soft"
|
||||
placeholder="hi@example.com">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-semibold text-gray-600 mb-1">WhatsApp Number</label>
|
||||
<input type="text" name="whatsapp"
|
||||
value="{{ old('whatsapp', $profile->whatsapp) }}"
|
||||
<input type="text" name="whatsapp" value="{{ old('whatsapp', $profile->whatsapp) }}"
|
||||
class="input-soft" placeholder="+6012-345-6789">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-semibold text-gray-600 mb-1">Instagram Handle</label>
|
||||
<div class="relative">
|
||||
<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"
|
||||
value="{{ old('ig_handle', $profile->ig_handle) }}"
|
||||
class="input-soft pl-7" placeholder="yourhandle">
|
||||
<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" value="{{ old('ig_handle', $profile->ig_handle) }}"
|
||||
class="input-soft pl-7" placeholder="@yourhandle">
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-semibold text-gray-600 mb-1">TikTok Handle</label>
|
||||
<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"
|
||||
value="{{ old('tiktok_handle', $profile->tiktok_handle) }}"
|
||||
class="input-soft pl-7" placeholder="yourhandle">
|
||||
value="{{ old('tiktok_handle', $profile->tiktok_handle) }}" class="input-soft pl-7"
|
||||
placeholder="@yourhandle">
|
||||
</div>
|
||||
</div>
|
||||
<div class="sm:col-span-2">
|
||||
<label class="block text-xs font-semibold text-gray-600 mb-1">YouTube Handle / Channel</label>
|
||||
<input type="text" name="youtube_handle"
|
||||
value="{{ old('youtube_handle', $profile->youtube_handle) }}"
|
||||
class="input-soft" placeholder="@yourchannel">
|
||||
value="{{ old('youtube_handle', $profile->youtube_handle) }}" class="input-soft"
|
||||
placeholder="@yourchannel">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -92,8 +90,7 @@
|
||||
<span class="text-xs text-gray-400">Current logo</span>
|
||||
</div>
|
||||
@endif
|
||||
<input type="file" name="logo" accept="image/*"
|
||||
class="w-full text-sm text-gray-600
|
||||
<input type="file" name="logo" accept="image/*" class="w-full text-sm text-gray-600
|
||||
file:mr-3 file:py-2 file:px-4 file:rounded-full file:border-0
|
||||
file:text-xs file:font-semibold file:bg-pink-50 file:text-pink-600
|
||||
hover:file:bg-pink-100 cursor-pointer">
|
||||
@@ -113,7 +110,8 @@
|
||||
<div>
|
||||
<label class="block text-xs font-semibold text-gray-600 mb-1">Accent Color</label>
|
||||
<div class="flex items-center gap-2">
|
||||
<input type="color" name="accent_color" value="{{ old('accent_color', $profile->accent_color) }}"
|
||||
<input type="color" name="accent_color"
|
||||
value="{{ old('accent_color', $profile->accent_color) }}"
|
||||
class="h-10 w-16 rounded-2xl border border-pink-200 cursor-pointer p-1 bg-white shrink-0"
|
||||
oninput="document.getElementById('accent_text').value=this.value">
|
||||
<input type="text" id="accent_text" value="{{ old('accent_color', $profile->accent_color) }}"
|
||||
@@ -132,16 +130,13 @@
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-semibold text-gray-600 mb-1">Custom Footer</label>
|
||||
<input type="text" name="custom_footer"
|
||||
value="{{ old('custom_footer', $profile->custom_footer) }}"
|
||||
class="input-soft"
|
||||
placeholder="e.g. Prices valid until Dec 2025 · DM for bundles">
|
||||
<input type="text" name="custom_footer" value="{{ old('custom_footer', $profile->custom_footer) }}"
|
||||
class="input-soft" placeholder="e.g. Prices valid until Dec 2025 · DM for bundles">
|
||||
</div>
|
||||
<div class="sm:col-span-2">
|
||||
<label class="flex items-start gap-3 cursor-pointer">
|
||||
<input type="checkbox" name="show_prices" value="1"
|
||||
class="w-4 h-4 accent-pink-400 mt-0.5 shrink-0"
|
||||
{{ old('show_prices', $profile->show_prices) ? 'checked' : '' }}>
|
||||
class="w-4 h-4 accent-pink-400 mt-0.5 shrink-0" {{ old('show_prices', $profile->show_prices) ? 'checked' : '' }}>
|
||||
<div>
|
||||
<span class="text-sm font-medium text-gray-700">Show prices publicly</span>
|
||||
<p class="text-xs text-gray-400">Uncheck to show "On Request" instead of actual prices</p>
|
||||
@@ -155,16 +150,16 @@
|
||||
<div class="flex flex-wrap items-center gap-3">
|
||||
<button type="submit" class="btn-sakura px-6 py-2.5">💾 Save Profile</button>
|
||||
<a href="{{ route('rate-cards.public') }}" target="_blank"
|
||||
class="text-xs px-4 py-2.5 rounded-full border border-pink-200 text-pink-500 hover:bg-pink-50">
|
||||
👁️ Preview Public Page
|
||||
class="btn-sakura text-sm px-4 py-2.5 rounded-full border border-pink-200 text-pink-500 hover:bg-pink-50">
|
||||
👁️ Preview
|
||||
</a>
|
||||
<a href="{{ route('rate-cards.pdf') }}"
|
||||
class="text-xs px-4 py-2.5 rounded-full border border-blue-200 text-blue-500 hover:bg-blue-50">
|
||||
class="btn-sakura text-sm px-4 py-2.5 rounded-full border border-blue-200 text-blue-500 hover:bg-blue-50">
|
||||
📄 Download PDF
|
||||
</a>
|
||||
<a href="{{ route('rate-cards.index') }}"
|
||||
class="text-xs px-4 py-2.5 rounded-full border border-gray-200 text-gray-500 hover:bg-gray-50">
|
||||
← Back to Rate Cards
|
||||
class="btn-sakura text-sm px-4 py-2.5 rounded-full border border-gray-200 text-gray-500 hover:bg-gray-50">
|
||||
← Back
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -1,48 +1,220 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<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">
|
||||
<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; }
|
||||
.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; }
|
||||
* {
|
||||
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;
|
||||
}
|
||||
|
||||
.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 {
|
||||
display: inline-flex; align-items: center; gap-6px;
|
||||
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;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap-6px;
|
||||
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; }
|
||||
.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; }
|
||||
|
||||
.contact-pill:hover {
|
||||
background:
|
||||
{{ $profile->accent_color }}
|
||||
18;
|
||||
}
|
||||
|
||||
.platform-section {
|
||||
margin-bottom: 32px;
|
||||
}
|
||||
|
||||
.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 {
|
||||
display: inline-flex; align-items: center; gap: 6px;
|
||||
background: {{ $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;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
background:
|
||||
{{ $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>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="header">
|
||||
@@ -61,13 +233,16 @@
|
||||
<a href="{{ $profile->whatsappUrl }}" target="_blank" class="contact-pill">📱 WhatsApp</a>
|
||||
@endif
|
||||
@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
|
||||
@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
|
||||
@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
|
||||
@if($profile->email)
|
||||
<a href="mailto:{{ $profile->email }}" class="contact-pill">✉️ {{ $profile->email }}</a>
|
||||
@@ -109,9 +284,10 @@
|
||||
@endforelse
|
||||
|
||||
<div class="footer">
|
||||
{{ $profile->custom_footer ?: 'Prices may vary. Contact for custom packages. 🐾' }}
|
||||
<br>Generated by KOL Manager · {{ now()->format('Y') }}
|
||||
{{ $profile->custom_footer ?: 'Prices may vary. Contact for custom packages.' }}
|
||||
<!--<br>Generated by Cathy's App · {{ now()->format('Y-M-D') }}-->
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -7,16 +7,14 @@
|
||||
@section('content')
|
||||
<div class="max-w-2xl mx-auto">
|
||||
<div class="flex items-center gap-3 mb-5">
|
||||
<a href="{{ route('schedule.index') }}"
|
||||
class="text-xs px-3 py-2 rounded-full border border-pink-200 text-gray-500 hover:bg-pink-50">
|
||||
<a href="{{ route('schedule.index') }}" class="btn-sakura text-sm px-5 py-2">
|
||||
← Back to Schedule
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="cat-card p-4 lg:p-8">
|
||||
<form action="{{ route('schedule.store') }}" method="POST" id="create-event-form"
|
||||
x-data="contractCheck('{{ route('contracts.check') }}')"
|
||||
class="space-y-5">
|
||||
x-data="contractCheck('{{ route('contracts.check', [], false) }}')" class="space-y-5">
|
||||
@csrf
|
||||
<input type="hidden" name="start_time" id="start_time_hidden">
|
||||
<input type="hidden" name="end_time" id="end_time_hidden">
|
||||
@@ -26,12 +24,105 @@
|
||||
<label class="block text-sm font-semibold text-gray-700 mb-1">
|
||||
Title <span class="text-pink-400">*</span>
|
||||
</label>
|
||||
<input type="text" name="title" value="{{ old('title') }}"
|
||||
class="input-soft" placeholder="Event title" required>
|
||||
<input type="text" name="title" value="{{ old('title') }}" class="input-soft" placeholder="Event title"
|
||||
required>
|
||||
@error('title') <p class="text-xs text-red-500 mt-1">{{ $message }}</p> @enderror
|
||||
</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 --}}
|
||||
<div>
|
||||
<label class="block text-sm font-semibold text-gray-700 mb-1">Type</label>
|
||||
@@ -45,47 +136,9 @@
|
||||
</div>
|
||||
|
||||
{{-- Client --}}
|
||||
<div x-data="{
|
||||
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;
|
||||
}
|
||||
}">
|
||||
<div>
|
||||
<label class="block text-sm font-semibold text-gray-700 mb-1">Client</label>
|
||||
<select name="client_id" id="client-select" class="input-soft"
|
||||
x-model="clientId"
|
||||
<select name="client_id" id="client-select" class="input-soft" x-model="clientId"
|
||||
@change="onClientChange($event); if($event.target.value !== '__new__') checkContract()">
|
||||
<option value="">— None —</option>
|
||||
<option value="__new__" class="font-semibold text-pink-600">+ Create New Client…</option>
|
||||
@@ -95,23 +148,28 @@
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
{{-- Quick New Client mini-form --}}
|
||||
<div x-show="isNew" x-transition
|
||||
class="mt-3 bg-purple-50 rounded-2xl p-4 space-y-3 border border-purple-100">
|
||||
<div x-show="isNew" x-transition style="display: none;"
|
||||
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>
|
||||
<div class="grid grid-cols-1 sm:grid-cols-2 gap-3">
|
||||
<div>
|
||||
<label class="block text-xs font-semibold text-gray-600 mb-1">Name <span class="text-pink-400">*</span></label>
|
||||
<input type="text" x-model="newName" class="input-soft text-sm" placeholder="Client / brand name">
|
||||
<label class="block text-xs font-semibold text-gray-600 mb-1">Name <span
|
||||
class="text-pink-400">*</span></label>
|
||||
<input type="text" x-model="newName" class="input-soft text-sm"
|
||||
placeholder="Client / brand name">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-semibold text-gray-600 mb-1">Company</label>
|
||||
<input type="text" x-model="newCompany" class="input-soft text-sm" placeholder="Company name">
|
||||
<input type="text" x-model="newCompany" class="input-soft text-sm"
|
||||
placeholder="Company name">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-semibold text-gray-600 mb-1">Email</label>
|
||||
<input type="email" x-model="newEmail" class="input-soft text-sm" placeholder="contact@brand.com">
|
||||
<input type="email" x-model="newEmail" class="input-soft text-sm"
|
||||
placeholder="contact@brand.com">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-semibold text-gray-600 mb-1">Phone</label>
|
||||
@@ -121,21 +179,24 @@
|
||||
<p x-show="errMsg" x-text="errMsg" class="text-xs text-red-500"></p>
|
||||
<div class="flex gap-2 pt-1">
|
||||
<button type="button" @click="saveNewClient()" :disabled="saving"
|
||||
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 = ''"
|
||||
class="btn-sakura text-sm px-4 py-2"
|
||||
x-text="saving ? 'Saving…' : '✓ Add & Select'"></button>
|
||||
<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">
|
||||
Cancel
|
||||
</button>
|
||||
</div>
|
||||
<p class="text-xs text-purple-400">Status will be set to Active automatically.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Category --}}
|
||||
<div class="sm:col-span-2">
|
||||
<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="__new__" class="font-semibold text-pink-600">+ Create New Category…</option>
|
||||
@foreach($categoryTree as $parent)
|
||||
<option value="{{ $parent->id }}" {{ old('category_id') == $parent->id ? 'selected' : '' }}>
|
||||
{{ $parent->icon }} {{ $parent->name }}
|
||||
@@ -149,6 +210,29 @@
|
||||
</select>
|
||||
</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 --}}
|
||||
<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"
|
||||
@@ -162,8 +246,8 @@
|
||||
<label class="block text-sm font-semibold text-gray-700 mb-1">
|
||||
Start Date <span class="text-pink-400">*</span>
|
||||
</label>
|
||||
<input type="date" id="start_date" class="input-soft"
|
||||
value="{{ old('_start_date') }}" required>
|
||||
<input type="date" id="start_date" class="input-soft" value="{{ old('_start_date') }}" required
|
||||
@change="checkContract()">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-semibold text-gray-700 mb-1">Start Time</label>
|
||||
@@ -183,8 +267,8 @@
|
||||
{{-- Location --}}
|
||||
<div class="sm:col-span-2">
|
||||
<label class="block text-sm font-semibold text-gray-700 mb-1">Location</label>
|
||||
<input type="text" name="location" value="{{ old('location') }}"
|
||||
class="input-soft" placeholder="Online / venue address">
|
||||
<input type="text" name="location" value="{{ old('location') }}" class="input-soft"
|
||||
placeholder="Online / venue address">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -208,8 +292,7 @@
|
||||
|
||||
{{-- Priority --}}
|
||||
<div class="flex items-center gap-2">
|
||||
<input type="checkbox" name="is_priority" value="1" id="priority"
|
||||
class="w-4 h-4 accent-pink-400" {{ old('is_priority') ? 'checked' : '' }}>
|
||||
<input type="checkbox" name="is_priority" value="1" id="priority" class="w-4 h-4 accent-pink-400" {{ old('is_priority') ? 'checked' : '' }}>
|
||||
<label for="priority" class="text-sm text-gray-600 cursor-pointer">⭐ Mark as Priority</label>
|
||||
</div>
|
||||
|
||||
@@ -234,19 +317,26 @@
|
||||
<div>
|
||||
<label class="block text-xs font-semibold text-gray-600 mb-1">Platform</label>
|
||||
<select name="content_platform" class="input-soft text-sm">
|
||||
<option value="instagram" {{ old('content_platform') === 'instagram' ? 'selected' : '' }}>📸 Instagram</option>
|
||||
<option value="tiktok" {{ old('content_platform') === 'tiktok' ? 'selected' : '' }}>🎵 TikTok</option>
|
||||
<option value="youtube" {{ old('content_platform') === 'youtube' ? 'selected' : '' }}>▶️ YouTube</option>
|
||||
<option value="other" {{ old('content_platform') === 'other' ? 'selected' : '' }}>📱 Other</option>
|
||||
<option value="instagram" {{ old('content_platform') === 'instagram' ? 'selected' : '' }}>📸
|
||||
Instagram</option>
|
||||
<option value="tiktok" {{ old('content_platform') === 'tiktok' ? 'selected' : '' }}>🎵 TikTok
|
||||
</option>
|
||||
<option value="youtube" {{ old('content_platform') === 'youtube' ? 'selected' : '' }}>▶️
|
||||
YouTube</option>
|
||||
<option value="other" {{ old('content_platform') === 'other' ? 'selected' : '' }}>📱 Other
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-semibold text-gray-600 mb-1">Content Type</label>
|
||||
<select name="content_type" class="input-soft text-sm">
|
||||
<option value="post" {{ old('content_type') === 'post' ? 'selected' : '' }}>Post / Feed</option>
|
||||
<option value="reel" {{ old('content_type') === 'reel' ? 'selected' : '' }}>Reel / Short</option>
|
||||
<option value="post" {{ old('content_type') === 'post' ? 'selected' : '' }}>Post / Feed
|
||||
</option>
|
||||
<option value="reel" {{ old('content_type') === 'reel' ? 'selected' : '' }}>Reel / Short
|
||||
</option>
|
||||
<option value="story" {{ old('content_type') === 'story' ? 'selected' : '' }}>Story</option>
|
||||
<option value="video" {{ old('content_type') === 'video' ? 'selected' : '' }}>Long Video</option>
|
||||
<option value="video" {{ old('content_type') === 'video' ? 'selected' : '' }}>Long Video
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<p class="sm:col-span-2 text-xs text-purple-500">
|
||||
@@ -269,8 +359,7 @@
|
||||
<div class="sm:col-span-2">
|
||||
<label class="block text-xs font-semibold text-gray-600 mb-1">Contract Title</label>
|
||||
<input type="text" name="contract_title" class="input-soft text-sm"
|
||||
placeholder="e.g. Exclusive Posting Contract — BrandX"
|
||||
value="{{ old('contract_title') }}">
|
||||
placeholder="e.g. Exclusive Posting Contract — BrandX" value="{{ old('contract_title') }}">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-semibold text-gray-600 mb-1">Contract Start</label>
|
||||
@@ -287,7 +376,7 @@
|
||||
|
||||
<div class="flex flex-col sm:flex-row gap-3 pt-1">
|
||||
<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!
|
||||
</button>
|
||||
<a href="{{ route('schedule.index') }}"
|
||||
@@ -301,6 +390,47 @@
|
||||
|
||||
@push('scripts')
|
||||
<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) {
|
||||
const startDate = document.getElementById('start_date').value;
|
||||
const startTime = document.getElementById('start_time_input').value || '00:00';
|
||||
|
||||
@@ -13,13 +13,19 @@
|
||||
|
||||
{{-- ── Upcoming Alert Strip ─────────────────────────────────── --}}
|
||||
@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
|
||||
@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">
|
||||
@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"
|
||||
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>
|
||||
<div class="text-xs font-semibold text-gray-700 whitespace-nowrap">{{ $event->title }}</div>
|
||||
@@ -98,6 +104,43 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
}
|
||||
},
|
||||
|
||||
dayCellDidMount(info) {
|
||||
const holidays = @json($holidays ?? []);
|
||||
const holidayMap = {};
|
||||
holidays.forEach(h => holidayMap[h.date] = h.name);
|
||||
|
||||
const year = info.date.getFullYear();
|
||||
const month = String(info.date.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(info.date.getDate()).padStart(2, '0');
|
||||
const dateStr = `${year}-${month}-${day}`;
|
||||
|
||||
if (holidayMap[dateStr]) {
|
||||
const frame = info.el.querySelector('.fc-daygrid-day-frame');
|
||||
if (frame) {
|
||||
// Update background color for the highlighted box
|
||||
frame.style.backgroundColor = '#fff0f0'; // Light red highlighted box
|
||||
frame.style.position = 'relative'; // Required for absolute positioning of text
|
||||
|
||||
// Add the holiday text to the top-left corner
|
||||
const holidayEl = document.createElement('div');
|
||||
holidayEl.textContent = holidayMap[dateStr];
|
||||
holidayEl.style.position = 'absolute';
|
||||
holidayEl.style.top = '4px';
|
||||
holidayEl.style.left = '4px';
|
||||
holidayEl.style.color = '#ef4444'; // Red text
|
||||
holidayEl.style.fontSize = '0.70rem'; // Small text
|
||||
holidayEl.style.fontWeight = '600';
|
||||
holidayEl.style.whiteSpace = 'nowrap';
|
||||
holidayEl.style.overflow = 'hidden';
|
||||
holidayEl.style.textOverflow = 'ellipsis';
|
||||
holidayEl.style.maxWidth = '75%'; // Prevent it from overlapping with the date number (usually on right)
|
||||
holidayEl.style.zIndex = '1';
|
||||
|
||||
frame.appendChild(holidayEl);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
eventDrop(info) {
|
||||
fetch(`/schedule/${info.event.id}/dates`, {
|
||||
method: 'PATCH',
|
||||
@@ -106,8 +149,8 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]').content,
|
||||
},
|
||||
body: JSON.stringify({
|
||||
start_time: info.event.startStr,
|
||||
end_time: info.event.endStr || null,
|
||||
start_time: info.event.startStr ? info.event.startStr.substring(0, 19) : null,
|
||||
end_time: info.event.endStr ? info.event.endStr.substring(0, 19) : null,
|
||||
}),
|
||||
}).then(r => r.ok ? window.KolManager.notify('Event rescheduled! 🐾') : info.revert());
|
||||
},
|
||||
@@ -124,11 +167,16 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
const e = info.event, p = e.extendedProps;
|
||||
document.getElementById('modal-title').textContent = e.title;
|
||||
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-16 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>` : ''}
|
||||
<div class="flex gap-2"><span class="text-gray-400 w-16 shrink-0">Start</span><span>${e.start?.toLocaleString()}</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">Type</span><span>${p.type}</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-24 shrink-0">Client</span><span>${p.client}</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>` : ''}
|
||||
<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><div class="flex-1 break-words whitespace-pre-wrap overflow-y-auto max-h-20 pr-1">${p.description}</div></div>` : ''}
|
||||
${p.notes ? `<div class="flex gap-2"><span class="text-gray-400 w-24 shrink-0">Notes</span><div class="flex-1 break-words whitespace-pre-wrap overflow-y-auto max-h-20 pr-1">${p.notes}</div></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`;
|
||||
document.getElementById('modal-actions').innerHTML = `
|
||||
@@ -156,14 +204,19 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
|
||||
function openAlertEventModal(e) {
|
||||
document.getElementById('modal-title').textContent = e.title;
|
||||
const startStr = e.start ? new Date(e.start).toLocaleString() : '—';
|
||||
const endStr = e.end ? new Date(e.end).toLocaleString() : null;
|
||||
const startStr = e.start ? e.start : '—';
|
||||
const endStr = e.end ? e.end : null;
|
||||
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-16 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>` : ''}
|
||||
<div class="flex gap-2"><span class="text-gray-400 w-16 shrink-0">Start</span><span>${startStr}</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">Type</span><span>${e.type}</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-24 shrink-0">Client</span><span>${e.client}</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>` : ''}
|
||||
<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><div class="flex-1 break-words whitespace-pre-wrap overflow-y-auto max-h-20 pr-1">${e.description}</div></div>` : ''}
|
||||
${e.notes ? `<div class="flex gap-2"><span class="text-gray-400 w-24 shrink-0">Notes</span><div class="flex-1 break-words whitespace-pre-wrap overflow-y-auto max-h-20 pr-1">${e.notes}</div></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 = `
|
||||
<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->dispatchAll();
|
||||
$this->info('🔔 Notifications dispatched.');
|
||||
})->purpose('Send all pending KOL Manager notifications');
|
||||
})->purpose('Send all pending Cathy notifications');
|
||||
|
||||
// Run every hour automatically
|
||||
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');
|
||||
|
||||
// CRM – Clients
|
||||
Route::resource('clients', ClientController::class);
|
||||
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::delete('/clients/{client}/avatar', [ClientController::class, 'deleteAvatar'])->name('clients.delete-avatar');
|
||||
|
||||
// Client Categories
|
||||
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::post('/', [ClientCategoryController::class, 'store'])->name('store');
|
||||
Route::put('/{category}', [ClientCategoryController::class, 'update'])->name('update');
|
||||
@@ -75,6 +76,8 @@ Route::get('/invoice-settings', [InvoiceSettingsController::class, 'edit'])->nam
|
||||
Route::post('/invoice-settings', [InvoiceSettingsController::class, 'update'])->name('invoice-settings.update');
|
||||
Route::post('/invoice-settings/logo', [InvoiceSettingsController::class, 'uploadLogo'])->name('invoice-settings.upload-logo');
|
||||
Route::delete('/invoice-settings/logo', [InvoiceSettingsController::class, 'deleteLogo'])->name('invoice-settings.delete-logo');
|
||||
Route::post('/invoice-settings/signature', [InvoiceSettingsController::class, 'uploadSignature'])->name('invoice-settings.upload-signature');
|
||||
Route::delete('/invoice-settings/signature', [InvoiceSettingsController::class, 'deleteSignature'])->name('invoice-settings.delete-signature');
|
||||
|
||||
// Financial – Rate Cards
|
||||
Route::get('/rate-cards/public', [RateCardController::class, 'public'])->name('rate-cards.public');
|
||||
|
||||
Reference in New Issue
Block a user