From 2a193c97ea0a8e9e2e18cc42a1b48dc0a204dfe7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Beganovi=C4=87?= Date: Thu, 14 Jan 2021 13:29:46 +0100 Subject: [PATCH] Show quotes/invoices in full-screen by default --- .../ClientPortal/InvoiceController.php | 8 +- .../ClientPortal/QuoteController.php | 8 +- .../livewire/invoices-table.blade.php | 4 +- .../livewire/quotes-table.blade.php | 4 +- .../invoices/show/fullscreen.blade.php | 32 ++++--- .../quotes/includes/actions.blade.php | 31 +++++++ .../portal/ninja2020/quotes/show.blade.php | 83 ++++++++++--------- .../quotes/show/fullscreen.blade.php | 36 ++------ 8 files changed, 112 insertions(+), 94 deletions(-) create mode 100644 resources/views/portal/ninja2020/quotes/includes/actions.blade.php diff --git a/app/Http/Controllers/ClientPortal/InvoiceController.php b/app/Http/Controllers/ClientPortal/InvoiceController.php index 0f75cf33c6..1c6ee81eba 100644 --- a/app/Http/Controllers/ClientPortal/InvoiceController.php +++ b/app/Http/Controllers/ClientPortal/InvoiceController.php @@ -54,11 +54,11 @@ class InvoiceController extends Controller 'invoice' => $invoice, ]; - if ($request->query('mode') === 'fullscreen') { - return $this->render('invoices.show.fullscreen', $data); + if ($request->query('mode') === 'portal') { + return $this->render('invoices.show', $data); } - return $this->render('invoices.show', $data); + return $this->render('invoices.show.fullscreen', $data); } /** @@ -135,7 +135,7 @@ class InvoiceController extends Controller ]; // nlog($data); - + return $this->render('invoices.payment', $data); } diff --git a/app/Http/Controllers/ClientPortal/QuoteController.php b/app/Http/Controllers/ClientPortal/QuoteController.php index 5200f2d628..85e7ab4a07 100644 --- a/app/Http/Controllers/ClientPortal/QuoteController.php +++ b/app/Http/Controllers/ClientPortal/QuoteController.php @@ -43,11 +43,11 @@ class QuoteController extends Controller 'quote' => $quote, ]; - if ($request->query('mode') === 'fullscreen') { - return $this->render('quotes.show.fullscreen', $data); + if ($request->query('mode') === 'portal') { + return $this->render('quotes.show', $data); } - return $this->render('quotes.show', $data); + return $this->render('quotes.show.fullscreen', $data); } public function bulk(ProcessQuotesInBulkRequest $request) @@ -111,7 +111,7 @@ class QuoteController extends Controller foreach ($quotes as $quote) { $quote->service()->approve(auth()->user())->save(); event(new QuoteWasApproved(auth('contact')->user(), $quote, $quote->company, Ninja::eventVars())); - + if (request()->has('signature') && !is_null(request()->signature) && !empty(request()->signature)) { InjectSignature::dispatch($quote, request()->signature); } diff --git a/resources/views/portal/ninja2020/components/livewire/invoices-table.blade.php b/resources/views/portal/ninja2020/components/livewire/invoices-table.blade.php index baf97af907..66da6013ce 100644 --- a/resources/views/portal/ninja2020/components/livewire/invoices-table.blade.php +++ b/resources/views/portal/ninja2020/components/livewire/invoices-table.blade.php @@ -100,11 +100,11 @@ @endif - + {{ ctrans('texts.view') }} diff --git a/resources/views/portal/ninja2020/components/livewire/quotes-table.blade.php b/resources/views/portal/ninja2020/components/livewire/quotes-table.blade.php index abf0f70751..ab028ee688 100644 --- a/resources/views/portal/ninja2020/components/livewire/quotes-table.blade.php +++ b/resources/views/portal/ninja2020/components/livewire/quotes-table.blade.php @@ -91,7 +91,7 @@ - @lang('texts.view') + {{ ctrans('texts.view') }} @@ -118,4 +118,4 @@ @push('footer') -@endpush \ No newline at end of file +@endpush diff --git a/resources/views/portal/ninja2020/invoices/show/fullscreen.blade.php b/resources/views/portal/ninja2020/invoices/show/fullscreen.blade.php index 6499f3996e..5690fcedf2 100644 --- a/resources/views/portal/ninja2020/invoices/show/fullscreen.blade.php +++ b/resources/views/portal/ninja2020/invoices/show/fullscreen.blade.php @@ -5,21 +5,26 @@ @if($invoice->isPayable())
@csrf -
+

- {{ ctrans('texts.invoice_number_placeholder', ['invoice' => $invoice->number])}} - {{ ctrans('texts.unpaid') }} + {{ ctrans('texts.invoice_number_placeholder', ['invoice' => $invoice->number])}} + - {{ ctrans('texts.unpaid') }}

- {{ ctrans('texts.invoice_still_unpaid') }} - + {{ ctrans('texts.invoice_still_unpaid') }} +

+ + ← {{ ctrans('texts.client_portal') }} + +
@@ -31,17 +36,18 @@
@else -
-
-
-
-

- {{ ctrans('texts.invoice_number_placeholder', ['invoice' => $invoice->number])}} - {{ ctrans('texts.unpaid') }} -

+
+
+
+
+

+ {{ ctrans('texts.invoice_number_placeholder', ['invoice' => $invoice->number])}} + - {{ ctrans('texts.unpaid') }} +

+
+
-
-
@endif diff --git a/resources/views/portal/ninja2020/quotes/includes/actions.blade.php b/resources/views/portal/ninja2020/quotes/includes/actions.blade.php new file mode 100644 index 0000000000..eb0f2328e3 --- /dev/null +++ b/resources/views/portal/ninja2020/quotes/includes/actions.blade.php @@ -0,0 +1,31 @@ +
+ @csrf + + + +
+
+
+
+

+ {{ ctrans('texts.waiting_for_approval') }} +

+
+

+ {{ ctrans('texts.quote_still_not_approved') }} +

+
+
+ +
+ @yield('quote-not-approved-right-side') + +
+ + +
+
+
+
+
+
diff --git a/resources/views/portal/ninja2020/quotes/show.blade.php b/resources/views/portal/ninja2020/quotes/show.blade.php index b0fac3c64c..cc7232016a 100644 --- a/resources/views/portal/ninja2020/quotes/show.blade.php +++ b/resources/views/portal/ninja2020/quotes/show.blade.php @@ -15,50 +15,28 @@ @endif @if(!$quote->isApproved()) -
- @csrf - - -
-
-
-
-

- {{ ctrans('texts.waiting_for_approval') }} -

-
-

- {{ ctrans('texts.quote_still_not_approved') }} -

-
-
-
-
- - -
-
-
-
-
-
+
+ @include('portal.ninja2020.quotes.includes.actions', ['quote' => $quote]) +
@endif
- {{ ctrans('texts.page') }}: + {{ ctrans('texts.page') }}: {{ strtolower(ctrans('texts.of')) }} @@ -68,25 +46,48 @@ -
+
-
- diff --git a/resources/views/portal/ninja2020/quotes/show/fullscreen.blade.php b/resources/views/portal/ninja2020/quotes/show/fullscreen.blade.php index 98778a4a59..c5e08efa83 100644 --- a/resources/views/portal/ninja2020/quotes/show/fullscreen.blade.php +++ b/resources/views/portal/ninja2020/quotes/show/fullscreen.blade.php @@ -3,34 +3,14 @@ @section('body') @if(!$quote->isApproved()) -
- @csrf - - -
-
-
-
-

- {{ ctrans('texts.waiting_for_approval') }} -

-
-

- {{ ctrans('texts.quote_still_not_approved') }} -

-
-
-
-
- - -
-
-
-
-
-
+ @component('portal.ninja2020.quotes.includes.actions', ['quote' => $quote]) + @section('quote-not-approved-right-side') + + ← {{ ctrans('texts.client_portal') }} + + @endsection + @endcomponent @endif -@endsection \ No newline at end of file +@endsection