From aac0c9ab98992c7ac189de748ec9755351faca70 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 16 Sep 2016 13:29:56 +0200 Subject: [PATCH] Various layout updates and tiny upgrade fixes [skip ci] --- app/Http/Controllers/Auth/LoginController.php | 7 +++++-- .../Controllers/Auth/RegisterController.php | 6 ++++-- app/Repositories/Bill/BillRepository.php | 20 +++++++++++++++++-- public/js/ff/import/status.js | 2 +- public/js/ff/reports/default/all.js | 2 +- resources/views/auth/login.twig | 4 ++-- resources/views/auth/register.twig | 2 +- 7 files changed, 32 insertions(+), 11 deletions(-) diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index 4347728d38..891785c676 100755 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -104,7 +104,7 @@ class LoginController extends Controller * * @return \Illuminate\Http\Response */ - public function showLoginForm() + public function showLoginForm(Request $request) { // is allowed to? $singleUserMode = FireflyConfig::get('single_user_mode', Config::get('firefly.configuration.single_user_mode'))->data; @@ -114,7 +114,10 @@ class LoginController extends Controller $allowRegistration = false; } - return view('auth.login', compact('allowRegistration')); + $email = $request->old('email'); + $remember = $request->old('remember'); + + return view('auth.login', compact('allowRegistration', 'email', 'remember')); } /** diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index fd82eb0588..73b9b0edcf 100755 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -109,7 +109,7 @@ class RegisterController extends Controller * * @return \Illuminate\Http\Response */ - public function showRegistrationForm() + public function showRegistrationForm(Request $request) { // TODO move to FireflyConfig $showDemoWarning = env('SHOW_DEMO_WARNING', false); @@ -123,7 +123,9 @@ class RegisterController extends Controller return view('error', compact('message')); } - return view('auth.register', compact('showDemoWarning')); + $email = $request->old('email'); + + return view('auth.register', compact('showDemoWarning', 'email')); } /** diff --git a/app/Repositories/Bill/BillRepository.php b/app/Repositories/Bill/BillRepository.php index aee6e0e42c..eef4b62769 100644 --- a/app/Repositories/Bill/BillRepository.php +++ b/app/Repositories/Bill/BillRepository.php @@ -173,6 +173,22 @@ class BillRepository implements BillRepositoryInterface */ public function getBillsForAccounts(Collection $accounts): Collection { + $fields = ['bills.id', + 'bills.created_at', + 'bills.updated_at', + 'bills.deleted_at', + 'bills.user_id', + 'bills.name', + 'bills.match', + 'bills.amount_min', + 'bills.amount_max', + 'bills.date', + 'bills.repeat_freq', + 'bills.skip', + 'bills.automatch', + 'bills.active', + 'bills.name_encrypted', + 'bills.match_encrypted']; $ids = $accounts->pluck('id')->toArray(); $set = $this->user->bills() ->leftJoin( @@ -187,8 +203,8 @@ class BillRepository implements BillRepositoryInterface ) ->whereIn('transactions.account_id', $ids) ->whereNull('transaction_journals.deleted_at') - ->groupBy('bills.id') - ->get(['bills.*']); + ->groupBy($fields) + ->get($fields); $set = $set->sortBy( function (Bill $bill) { diff --git a/public/js/ff/import/status.js b/public/js/ff/import/status.js index 4ffd4c3bb5..2084858131 100644 --- a/public/js/ff/import/status.js +++ b/public/js/ff/import/status.js @@ -29,7 +29,7 @@ $(function () { function checkImportStatus() { "use strict"; console.log('checkImportStatus()'); - $.getJSON(jobImportUrl).success(reportOnJobImport).fail(failedJobImport); + $.getJSON(jobImportUrl).done(reportOnJobImport).fail(failedJobImport); } function importComplete(data) { diff --git a/public/js/ff/reports/default/all.js b/public/js/ff/reports/default/all.js index 357c91b7d6..30810842eb 100644 --- a/public/js/ff/reports/default/all.js +++ b/public/js/ff/reports/default/all.js @@ -34,7 +34,7 @@ function clickInfoButton(e) { attributes.reportType = reportType; attributes.accounts = accountIds; - $.getJSON('popup/report', {attributes: attributes}).success(respondInfoButton).fail(errorInfoButton); + $.getJSON('popup/report', {attributes: attributes}).done(respondInfoButton).fail(errorInfoButton); } function errorInfoButton(data) { diff --git a/resources/views/auth/login.twig b/resources/views/auth/login.twig index 24a4accb89..435870685a 100644 --- a/resources/views/auth/login.twig +++ b/resources/views/auth/login.twig @@ -33,7 +33,7 @@
- +
@@ -42,7 +42,7 @@
diff --git a/resources/views/auth/register.twig b/resources/views/auth/register.twig index eafefc2609..e627e6691d 100644 --- a/resources/views/auth/register.twig +++ b/resources/views/auth/register.twig @@ -26,7 +26,7 @@
- + {% if showDemoWarning %}

You will receive an email from Firefly III. If your email address is incorrect, your account may not work.