From ab9c991530e56edcbe591d5115b93c076181a6a9 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 7 Feb 2016 08:31:21 +0100 Subject: [PATCH] Better flashes (also translated) [skip ci] --- app/Http/Controllers/HomeController.php | 14 +++-- resources/lang/en_US/firefly.php | 7 +++ resources/views/partials/flashes.twig | 68 ++++++++++++++++--------- 3 files changed, 57 insertions(+), 32 deletions(-) diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 2f605947fe..61967435fb 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -6,7 +6,6 @@ use Config; use FireflyIII\Models\Tag; use FireflyIII\Repositories\Account\AccountRepositoryInterface as ARI; use Input; -use Log; use Preferences; use Session; use Steam; @@ -76,7 +75,6 @@ class HomeController extends Controller */ public function index(ARI $repository) { - Log::debug('You are at index.'); $types = Config::get('firefly.accountTypesByIdentifier.asset'); $count = $repository->countAccounts($types); bcscale(2); @@ -85,13 +83,13 @@ class HomeController extends Controller return redirect(route('new-user.index')); } - $title = 'Firefly'; - $subTitle = trans('firefly.welcomeBack'); - $mainTitleIcon = 'fa-fire'; - $transactions = []; - $frontPage = Preferences::get('frontPageAccounts', []); + $title = 'Firefly'; + $subTitle = trans('firefly.welcomeBack'); + $mainTitleIcon = 'fa-fire'; + $transactions = []; + $frontPage = Preferences::get('frontPageAccounts', []); /** @var Carbon $start */ - $start = session('start', Carbon::now()->startOfMonth()); + $start = session('start', Carbon::now()->startOfMonth()); /** @var Carbon $end */ $end = session('end', Carbon::now()->endOfMonth()); $showTour = Preferences::get('tour', true)->data; diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.php index 6d090a6714..926f2fd235 100644 --- a/resources/lang/en_US/firefly.php +++ b/resources/lang/en_US/firefly.php @@ -38,6 +38,13 @@ return [ 'new_budget' => 'New budget', 'new_bill' => 'New bill', 'block_account_logout' => 'You have been logged out. Blocked accounts cannot use this site. Did you register with a valid email address?', + 'flash_success' => 'Success!', + 'flash_info' => 'Message', + 'flash_warning' => 'Warning!', + 'flash_error' => 'Error!', + 'flash_info_multiple' => 'There is one message|There are :count messages', + 'flash_error_multiple' => 'There is one error|There are :count errors', + // export data: 'import_and_export' => 'Import and export', diff --git a/resources/views/partials/flashes.twig b/resources/views/partials/flashes.twig index f62c45ce61..c80789ed0e 100644 --- a/resources/views/partials/flashes.twig +++ b/resources/views/partials/flashes.twig @@ -1,61 +1,81 @@ + {% if Session.has('success') %} {% endif %} + {% if Session.has('info') %} - {% endif %} + {% if Session.has('warning') %} {% endif %} + {% if Session.has('error') %}