From 59a27240571292fa4db94e73e59e885aa098d10d Mon Sep 17 00:00:00 2001 From: I-Fun Date: Sun, 5 Apr 2026 22:37:51 +0700 Subject: [PATCH] refactor: improve UI responsiveness, add currency formatting to invoice inputs, update address formatting, and refine Docker setup instructions. --- How-To.txt | 14 +++++++-- app/Models/Client.php | 15 ++++++---- resources/views/clients/show.blade.php | 2 +- resources/views/content/index.blade.php | 30 +++++++++----------- resources/views/invoices/create.blade.php | 13 +++++++-- resources/views/invoices/edit.blade.php | 13 +++++++-- resources/views/invoices/pdf.blade.php | 2 +- resources/views/invoices/show.blade.php | 2 +- resources/views/rate-cards/index.blade.php | 10 +++---- resources/views/rate-cards/profile.blade.php | 12 ++++---- resources/views/schedule/index.blade.php | 4 +-- 11 files changed, 70 insertions(+), 47 deletions(-) diff --git a/How-To.txt b/How-To.txt index 8cfe76e..0814f9e 100644 --- a/How-To.txt +++ b/How-To.txt @@ -1,6 +1,14 @@ -git clone this repository +# On local machine +#git clone this repository composer install -#php artisan key:generate +php artisan key:generate touch database/database.sqlite && php artisan migrate npm install -npm run build \ No newline at end of file +npm run build + +# On Docker +cp .env.example .env.docker +docker compose build +docker compose up -d + + diff --git a/app/Models/Client.php b/app/Models/Client.php index 08cbfe3..40c2dfb 100644 --- a/app/Models/Client.php +++ b/app/Models/Client.php @@ -57,14 +57,19 @@ class Client extends Model public function getFullAddressAttribute(): string { + $line3_parts = array_filter([$this->city, $this->state]); + $country_part = array_filter([$this->postal_code, $this->country]); + $country_str = implode(' - ', $country_part); + if ($country_str) { + $line3_parts[] = $country_str; + } + $line3 = implode(', ', $line3_parts); + return collect([ $this->address_line1, $this->address_line2, - $this->city, - $this->state, - $this->postal_code, - $this->country, - ])->filter()->implode(', '); + $line3 + ])->filter()->implode("\n"); } public function getInitialsAttribute(): string diff --git a/resources/views/clients/show.blade.php b/resources/views/clients/show.blade.php index 6b58234..5d90172 100644 --- a/resources/views/clients/show.blade.php +++ b/resources/views/clients/show.blade.php @@ -133,7 +133,7 @@ @if($client->full_address)
📍 - {{ $client->full_address }} + {!! nl2br(e($client->full_address)) !!}
@endif @if($client->notes) diff --git a/resources/views/content/index.blade.php b/resources/views/content/index.blade.php index 3d01172..905bda5 100644 --- a/resources/views/content/index.blade.php +++ b/resources/views/content/index.blade.php @@ -8,19 +8,6 @@
+ New Brief - @foreach(['instagram', 'tiktok', 'youtube'] as $p) - - {{ ['instagram' => '📸', 'tiktok' => '🎵', 'youtube' => '▶️'][$p] }} {{ ucfirst($p) }} - - @endforeach - @if(request('platform')) - ✕ - Clear - @endif
@@ -36,8 +23,19 @@ @php $status = $col['status']; @endphp {{-- Column shell — layout only, NOT the sort target --}} + @php + $bgColors = [ + 'drafting' => '#f2f2f2', + 'filming' => 'rgba(251, 189, 35, 0.2)', + 'editing' => 'rgba(58, 191, 248, 0.2)', + 'review' => 'rgba(240, 0, 184, 0.2)', + 'posted' => 'rgba(54, 211, 153, 0.2)', + 'archived' => 'rgba(42, 50, 60, 0.2)', + ]; + $bgStyle = isset($bgColors[$status->value]) ? 'background-color: ' . $bgColors[$status->value] . ';' : ''; + @endphp
+ style="{{ $bgStyle }}" data-status="{{ $status->value }}"> {{-- Column header --}}
@@ -54,7 +52,7 @@ @foreach($col['items'] as $brief)
diff --git a/resources/views/invoices/create.blade.php b/resources/views/invoices/create.blade.php index 3a611f2..463a250 100644 --- a/resources/views/invoices/create.blade.php +++ b/resources/views/invoices/create.blade.php @@ -78,9 +78,16 @@
- + +
diff --git a/resources/views/invoices/edit.blade.php b/resources/views/invoices/edit.blade.php index daef9ef..9b44213 100644 --- a/resources/views/invoices/edit.blade.php +++ b/resources/views/invoices/edit.blade.php @@ -75,9 +75,16 @@
- + +
diff --git a/resources/views/invoices/pdf.blade.php b/resources/views/invoices/pdf.blade.php index 0698668..961c658 100644 --- a/resources/views/invoices/pdf.blade.php +++ b/resources/views/invoices/pdf.blade.php @@ -271,7 +271,7 @@ @if($invoice->client->email)
{{ $invoice->client->email }}
@endif @if($invoice->client->full_address) -
{{ $invoice->client->full_address }}
@endif +
{!! nl2br(e($invoice->client->full_address)) !!}
@endif @else
—
@endif diff --git a/resources/views/invoices/show.blade.php b/resources/views/invoices/show.blade.php index b521aae..6263ba4 100644 --- a/resources/views/invoices/show.blade.php +++ b/resources/views/invoices/show.blade.php @@ -53,7 +53,7 @@ @if($invoice->client->email)
{{ $invoice->client->email }}
@endif @if($invoice->client->full_address) -
{{ $invoice->client->full_address }}
@endif +
{!! nl2br(e($invoice->client->full_address)) !!}
@endif @else
No client
@endif diff --git a/resources/views/rate-cards/index.blade.php b/resources/views/rate-cards/index.blade.php index ed40095..2565229 100644 --- a/resources/views/rate-cards/index.blade.php +++ b/resources/views/rate-cards/index.blade.php @@ -6,18 +6,18 @@ @section('content') -
- {{-- Past Brands --}}
@@ -356,18 +354,18 @@
{{-- Actions --}} -
- + diff --git a/resources/views/schedule/index.blade.php b/resources/views/schedule/index.blade.php index 9904576..30f52b8 100644 --- a/resources/views/schedule/index.blade.php +++ b/resources/views/schedule/index.blade.php @@ -91,7 +91,7 @@ document.addEventListener('DOMContentLoaded', function () { headerToolbar: { left: 'prev,next today', center: 'title', - right: isMobile ? 'listWeek,timeGridDay' : 'dayGridMonth,timeGridWeek,listWeek', + right: isMobile ? 'dayGridMonth,listWeek,timeGridDay' : 'dayGridMonth,timeGridWeek,listWeek', }, editable: !isMobile, selectable: true, @@ -99,7 +99,7 @@ document.addEventListener('DOMContentLoaded', function () { height: 'auto', windowResize(view) { const mob = window.innerWidth < 640; - if (mob && calendar.view.type !== 'listWeek' && calendar.view.type !== 'timeGridDay') { + if (mob && calendar.view.type !== 'listWeek' && calendar.view.type !== 'timeGridDay' && calendar.view.type !== 'dayGridMonth') { calendar.changeView('listWeek'); } },