From 3836c10c2d3b01639a76418736a969e2630704fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0lhan=20Suba=C5=9F=C4=B1?= Date: Wed, 25 Dec 2019 17:44:36 +0300 Subject: [PATCH 1/4] Bulgarian usage is like this: 1 234 567,89 Also see https://en.wikipedia.org/wiki/Decimal_separator --- config/money.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/money.php b/config/money.php index d5e337b5a..fdacd0f39 100644 --- a/config/money.php +++ b/config/money.php @@ -152,8 +152,8 @@ return [ 'subunit' => 100, 'symbol' => 'лв', 'symbol_first' => false, - 'decimal_mark' => '.', - 'thousands_separator' => ',', + 'decimal_mark' => ',', + 'thousands_separator' => ' ', ], 'BHD' => [ From d279ff4764b25ed6580c9e3c27a06362b76dafeb Mon Sep 17 00:00:00 2001 From: denisdulici Date: Thu, 26 Dec 2019 09:43:39 +0300 Subject: [PATCH 2/4] formatting --- resources/views/layouts/admin.blade.php | 22 +++---- resources/views/layouts/auth.blade.php | 74 +++++++++++------------ resources/views/layouts/modules.blade.php | 22 +++---- resources/views/layouts/portal.blade.php | 22 +++---- resources/views/layouts/print.blade.php | 4 +- resources/views/layouts/signed.blade.php | 10 ++- resources/views/layouts/wizard.blade.php | 9 +-- 7 files changed, 74 insertions(+), 89 deletions(-) diff --git a/resources/views/layouts/admin.blade.php b/resources/views/layouts/admin.blade.php index 8ebd6fd74..28c39b831 100644 --- a/resources/views/layouts/admin.blade.php +++ b/resources/views/layouts/admin.blade.php @@ -3,35 +3,33 @@ @include('partials.admin.head') - @stack('body_start') - @include('partials.admin.menu') + @include('partials.admin.menu') -
+
- @include('partials.admin.navbar') + @include('partials.admin.navbar') -
+
- @include('partials.admin.header') + @include('partials.admin.header') -
+
- @include('partials.admin.content') + @include('partials.admin.content') - @include('partials.admin.footer') - -
+ @include('partials.admin.footer')
+
+ @stack('body_end') @include('partials.admin.scripts') - diff --git a/resources/views/layouts/auth.blade.php b/resources/views/layouts/auth.blade.php index 3c9d85685..e13164003 100644 --- a/resources/views/layouts/auth.blade.php +++ b/resources/views/layouts/auth.blade.php @@ -3,69 +3,67 @@ @include('partials.auth.head') - @stack('body_start') -
-
-
-
-
-
- Akaunting -
+
+
+
+
+
+
+ Akaunting
+
- @stack('login_box_start') -
-
-
- @stack('body_end') @include('partials.auth.scripts') - diff --git a/resources/views/layouts/modules.blade.php b/resources/views/layouts/modules.blade.php index 92c912d61..27798483e 100644 --- a/resources/views/layouts/modules.blade.php +++ b/resources/views/layouts/modules.blade.php @@ -3,35 +3,33 @@ @include('partials.modules.head') - @stack('body_start') - @include('partials.admin.menu') + @include('partials.admin.menu') -
+
- @include('partials.admin.navbar') + @include('partials.admin.navbar') -
+
- @include('partials.admin.header') + @include('partials.admin.header') -
+
- @include('partials.admin.content') + @include('partials.admin.content') - @include('partials.admin.footer') - -
+ @include('partials.admin.footer')
+
+ @stack('body_end') @include('partials.admin.scripts') - diff --git a/resources/views/layouts/portal.blade.php b/resources/views/layouts/portal.blade.php index 37a1fd6db..303d98910 100644 --- a/resources/views/layouts/portal.blade.php +++ b/resources/views/layouts/portal.blade.php @@ -3,35 +3,33 @@ @include('partials.portal.head') - @stack('body_start') - @include('partials.portal.menu') + @include('partials.portal.menu') -
+
- @include('partials.portal.navbar') + @include('partials.portal.navbar') -
+
- @include('partials.portal.header') + @include('partials.portal.header') -
+
- @include('partials.portal.content') + @include('partials.portal.content') - @include('partials.portal.footer') - -
+ @include('partials.portal.footer')
+
+ @stack('body_end') @include('partials.portal.scripts') - diff --git a/resources/views/layouts/print.blade.php b/resources/views/layouts/print.blade.php index b0140ff23..7d4b2e7cb 100644 --- a/resources/views/layouts/print.blade.php +++ b/resources/views/layouts/print.blade.php @@ -9,13 +9,11 @@ - @stack('body_start') - @yield('content') + @yield('content') @stack('body_end') - diff --git a/resources/views/layouts/signed.blade.php b/resources/views/layouts/signed.blade.php index ff12b1d42..2d3401c3b 100644 --- a/resources/views/layouts/signed.blade.php +++ b/resources/views/layouts/signed.blade.php @@ -2,19 +2,17 @@ @include('partials.signed.head') - @stack('body_start') -
+
- @include('partials.signed.content') + @include('partials.signed.content') - @include('partials.signed.footer') + @include('partials.signed.footer') -
+
@stack('body_end') - diff --git a/resources/views/layouts/wizard.blade.php b/resources/views/layouts/wizard.blade.php index 4db760932..720fe0c4d 100644 --- a/resources/views/layouts/wizard.blade.php +++ b/resources/views/layouts/wizard.blade.php @@ -4,21 +4,18 @@
- @stack('body_start') -
+
- @include('partials.wizard.content') + @include('partials.wizard.content') -
+
@stack('body_end') -
@include('partials.wizard.scripts') - From ef95a33648a031ab61ab7b18815b47cdd06bfa50 Mon Sep 17 00:00:00 2001 From: denisdulici Date: Thu, 26 Dec 2019 09:49:36 +0300 Subject: [PATCH 3/4] formatting --- resources/views/partials/admin/menu.blade.php | 78 +++++++++---------- .../views/partials/portal/menu.blade.php | 44 +++++------ 2 files changed, 61 insertions(+), 61 deletions(-) diff --git a/resources/views/partials/admin/menu.blade.php b/resources/views/partials/admin/menu.blade.php index e849710c0..49927200c 100644 --- a/resources/views/partials/admin/menu.blade.php +++ b/resources/views/partials/admin/menu.blade.php @@ -1,46 +1,46 @@ @stack('menu_start') - @stack('menu_end') diff --git a/resources/views/partials/portal/menu.blade.php b/resources/views/partials/portal/menu.blade.php index 180ee7b46..2c114a673 100644 --- a/resources/views/partials/portal/menu.blade.php +++ b/resources/views/partials/portal/menu.blade.php @@ -1,28 +1,28 @@ @stack('menu_start') - @stack('menu_end') From 6f7d94e67648c519f92d54974c79227f4ffa9bdb Mon Sep 17 00:00:00 2001 From: denisdulici Date: Thu, 26 Dec 2019 10:53:50 +0300 Subject: [PATCH 4/4] fixed error pages --- app/Http/ViewComposers/Header.php | 64 +-- app/Http/ViewComposers/Notifications.php | 2 +- app/Http/ViewComposers/Suggestions.php | 32 +- resources/lang/en-GB/errors.php | 29 +- resources/views/errors/403.blade.php | 10 +- resources/views/errors/404.blade.php | 10 +- resources/views/errors/500.blade.php | 11 +- resources/views/layouts/error.blade.php | 31 ++ .../views/partials/admin/header.blade.php | 44 +- .../views/partials/admin/navbar.blade.php | 456 +++++++++--------- .../views/partials/portal/header.blade.php | 26 +- 11 files changed, 374 insertions(+), 341 deletions(-) create mode 100644 resources/views/layouts/error.blade.php diff --git a/app/Http/ViewComposers/Header.php b/app/Http/ViewComposers/Header.php index 6a2e91032..4446f9176 100644 --- a/app/Http/ViewComposers/Header.php +++ b/app/Http/ViewComposers/Header.php @@ -2,7 +2,6 @@ namespace App\Http\ViewComposers; -use Auth; use App\Utilities\Updater; use Illuminate\View\View; use App\Traits\Modules as RemoteModules; @@ -21,42 +20,43 @@ class Header { $user = user(); - $bills = []; - $invoices = []; - $notifications = 0; + $invoices = $bills = []; + $updates = $notifications = 0; $company = null; - // Get customer company - if ($user->can('read-client-portal')) { - $company = (object) [ - 'company_name' => setting('company.name'), - 'company_email' => setting('company.email'), - 'company_address' => setting('company.address'), - 'company_logo' => setting('company.logo'), - ]; - } - - $undereads = $user->unreadNotifications; - - foreach ($undereads as $underead) { - $data = $underead->getAttribute('data'); - - switch ($underead->getAttribute('type')) { - case 'App\Notifications\Expense\Bill': - $bills[$data['bill_id']] = $data['amount']; - $notifications++; - break; - case 'App\Notifications\Income\Invoice': - $invoices[$data['invoice_id']] = $data['amount']; - $notifications++; - break; + if (!empty($user)) { + // Get customer company + if ($user->can('read-client-portal')) { + $company = (object) [ + 'company_name' => setting('company.name'), + 'company_email' => setting('company.email'), + 'company_address' => setting('company.address'), + 'company_logo' => setting('company.logo'), + ]; } + + $undereads = $user->unreadNotifications; + + foreach ($undereads as $underead) { + $data = $underead->getAttribute('data'); + + switch ($underead->getAttribute('type')) { + case 'App\Notifications\Expense\Bill': + $bills[$data['bill_id']] = $data['amount']; + $notifications++; + break; + case 'App\Notifications\Income\Invoice': + $invoices[$data['invoice_id']] = $data['amount']; + $notifications++; + break; + } + } + + $updates = count(Updater::all()); + + $this->loadSuggestions(); } - $updates = count(Updater::all()); - - $this->loadSuggestions(); - $view->with([ 'user' => $user, 'notifications' => $notifications, diff --git a/app/Http/ViewComposers/Notifications.php b/app/Http/ViewComposers/Notifications.php index 1d8383894..da0d56f10 100644 --- a/app/Http/ViewComposers/Notifications.php +++ b/app/Http/ViewComposers/Notifications.php @@ -19,7 +19,7 @@ class Notifications public function compose(View $view) { // No need to add suggestions in console - if (app()->runningInConsole() || !env('APP_INSTALLED')) { + if (app()->runningInConsole() || !env('APP_INSTALLED') || !user()) { return; } diff --git a/app/Http/ViewComposers/Suggestions.php b/app/Http/ViewComposers/Suggestions.php index f665daf8e..25c568e34 100644 --- a/app/Http/ViewComposers/Suggestions.php +++ b/app/Http/ViewComposers/Suggestions.php @@ -26,26 +26,28 @@ class Suggestions $modules = false; - $path = Route::current()->uri(); + if (user()) { + $path = Route::current()->uri(); - if ($path) { - $suggestions = $this->getSuggestions($path); + if ($path) { + $suggestions = $this->getSuggestions($path); + + if ($suggestions) { + $suggestion_modules = $suggestions->modules; + + foreach ($suggestion_modules as $key => $module) { + $installed = Module::where('company_id', session('company_id'))->where('alias', $module->alias)->first(); - if ($suggestions) { - $suggestion_modules = $suggestions->modules; - - foreach ($suggestion_modules as $key => $module) { - $installed = Module::where('company_id', '=', session('company_id'))->where('alias', '=', $module->alias)->first(); - - if ($installed) { - unset($suggestion_modules[$key]); + if ($installed) { + unset($suggestion_modules[$key]); + } } - } - if ($suggestion_modules) { - shuffle($suggestion_modules); + if ($suggestion_modules) { + shuffle($suggestion_modules); - $modules[] = $suggestion_modules[0]; + $modules[] = $suggestion_modules[0]; + } } } } diff --git a/resources/lang/en-GB/errors.php b/resources/lang/en-GB/errors.php index e773681ec..c72a47530 100644 --- a/resources/lang/en-GB/errors.php +++ b/resources/lang/en-GB/errors.php @@ -2,23 +2,22 @@ return [ - 'forbidden_access' => 'Forbidden Access', - 'error_page' => 'Error Page', - 'page_not_found' => 'Page Not Found', - - 'body' => [ - 'forbidden_access' => 'Oops! Forbidden Access.', - 'error_page' => 'Oops! Something went wrong.', - 'page_not_found' => 'Oops! Page not found.', + 'title' => [ + '403' => 'Oops! Forbidden Access', + '404' => 'Oops! Page not found', + '500' => 'Oops! Something went wrong', ], - 'messages' => [ - 'forbidden_access' => 'You can not access this page. - Meanwhile, you may return to dashboard.', - 'error_page' => 'We will work on fixing that right away. - Meanwhile, you may return to dashboard.', - 'page_not_found' => 'We could not find the page you were looking for. - Meanwhile, you may return to dashboard.', + 'header' => [ + '403' => '403 Forbidden', + '404' => '404 Not Found', + '500' => '500 Internal Server Error', + ], + + 'message' => [ + '403' => 'You can not access this page.', + '404' => 'We could not find the page you were looking for.', + '500' => 'We will work on fixing that right away.', ], ]; diff --git a/resources/views/errors/403.blade.php b/resources/views/errors/403.blade.php index ff39c43ac..9632c4f06 100644 --- a/resources/views/errors/403.blade.php +++ b/resources/views/errors/403.blade.php @@ -1,16 +1,16 @@ -@extends('layouts.admin') +@extends('layouts.error') -@section('title', trans('errors.forbidden_access')) +@section('title', trans('errors.title.403')) @section('content')
-

403 Forbidden

+

  {{ trans('errors.header.403') }}

-

{{ trans('errors.body.forbidden_access') }}

+

{{ trans('errors.message.403') }}

-

{!! trans('errors.messages.forbidden_access', ['link' => url('/') ]) !!}

+  {{ trans('general.go_to', ['name' => trans('general.dashboard')]) }}
@endsection diff --git a/resources/views/errors/404.blade.php b/resources/views/errors/404.blade.php index 11455d446..a141d73bc 100644 --- a/resources/views/errors/404.blade.php +++ b/resources/views/errors/404.blade.php @@ -1,16 +1,16 @@ -@extends('layouts.admin') +@extends('layouts.error') -@section('title', trans('errors.page_not_found')) +@section('title', trans('errors.title.404')) @section('content')
-

404 Not Found

+

  {{ trans('errors.header.404') }}

-

{{ trans('errors.body.page_not_found') }}

+

{{ trans('errors.message.404') }}

-

{!! trans('errors.messages.page_not_found', ['link' => url('/')]) !!}

+  {{ trans('general.go_to', ['name' => trans('general.dashboard')]) }}
@endsection diff --git a/resources/views/errors/500.blade.php b/resources/views/errors/500.blade.php index f8fef083e..5cc19ff69 100644 --- a/resources/views/errors/500.blade.php +++ b/resources/views/errors/500.blade.php @@ -1,16 +1,17 @@ -@extends('layouts.admin') +@extends('layouts.error') -@section('title', trans('errors.error_page')) +@section('title', trans('errors.title.500')) @section('content')
-

500 Internal Server Error

+

  {{ trans('errors.header.500') }}

-

{{ trans('errors.body.error_page') }}

+

{{ trans('errors.message.500') }}

-

{!! trans('errors.messages.error_page', ['link' => url('/') ]) !!}

+  {{ trans('general.go_to', ['name' => trans('general.dashboard')]) }}
@endsection + diff --git a/resources/views/layouts/error.blade.php b/resources/views/layouts/error.blade.php new file mode 100644 index 000000000..cc1484d73 --- /dev/null +++ b/resources/views/layouts/error.blade.php @@ -0,0 +1,31 @@ + + + @include('partials.admin.head') + + + @stack('body_start') + +
+ +
+ + @include('partials.admin.header') + +
+ + @include('partials.admin.content') + + @include('partials.admin.footer') + +
+ +
+ +
+ + @stack('body_end') + + @include('partials.admin.scripts') + + + diff --git a/resources/views/partials/admin/header.blade.php b/resources/views/partials/admin/header.blade.php index 24ad9c02b..fdd24aa91 100644 --- a/resources/views/partials/admin/header.blade.php +++ b/resources/views/partials/admin/header.blade.php @@ -1,31 +1,31 @@ @stack('header_start') -