mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-18 12:28:46 +00:00
Some general cleaning up in the menu's and the various controllers. Added a new class (yet to be tested) and removed most of the "piggy bank"-implementation in anticipation of the ideas from issue #6. Fixed a bug in the default user seeder.
This commit is contained in:
@@ -20,7 +20,6 @@ class AccountController extends \BaseController
|
||||
{
|
||||
$this->_accounts = $accounts;
|
||||
$this->_repository = $repository;
|
||||
View::share('menu', 'accounts');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -21,7 +21,6 @@ class BudgetController extends BaseController
|
||||
{
|
||||
$this->_budgets = $budgets;
|
||||
$this->_repository = $repository;
|
||||
View::share('menu', 'budgets');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -19,7 +19,6 @@ class CategoryController extends BaseController
|
||||
{
|
||||
$this->_repository = $repository;
|
||||
$this->_category = $category;
|
||||
View::share('menu', 'categories');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -26,9 +26,6 @@ class HomeController extends BaseController
|
||||
$this->_preferences = $preferences;
|
||||
$this->_journal = $journal;
|
||||
$this->_budgets = $budgets;
|
||||
View::share('menu', 'home');
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -20,8 +20,6 @@ class LimitController extends BaseController
|
||||
{
|
||||
$this->_budgets = $budgets;
|
||||
$this->_limits = $limits;
|
||||
View::share('menu', 'budgets');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -20,8 +20,6 @@ class PiggybankController extends BaseController
|
||||
{
|
||||
$this->_repository = $repository;
|
||||
$this->_accounts = $accounts;
|
||||
View::share('menu', 'home');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -80,17 +78,7 @@ class PiggybankController extends BaseController
|
||||
// get accounts:
|
||||
foreach ($piggybanks as $piggyBank) {
|
||||
$account = $piggyBank->account;
|
||||
$piggyBank->pct = round(($piggyBank->amount / $piggyBank->target) * 100, 0) . '%';
|
||||
$id = $account->id;
|
||||
if (!isset($accounts[$id])) {
|
||||
$account->balance = $account->balance();
|
||||
$account->left = $account->balance - $piggyBank->amount;
|
||||
$account->total = $piggyBank->target;
|
||||
} else {
|
||||
$account->left -= $piggyBank->amount;
|
||||
$account->total += $piggyBank->target;
|
||||
|
||||
}
|
||||
$accounts[$id] = $account;
|
||||
}
|
||||
|
||||
@@ -105,7 +93,7 @@ class PiggybankController extends BaseController
|
||||
*/
|
||||
public function show(Piggybank $piggyBank)
|
||||
{
|
||||
return View::make('piggybanks.show')->with('piggyBank',$piggyBank);
|
||||
return View::make('piggybanks.show')->with('piggyBank', $piggyBank);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -20,7 +20,6 @@ class PreferencesController extends BaseController
|
||||
|
||||
$this->_accounts = $accounts;
|
||||
$this->_preferences = $preferences;
|
||||
View::share('menu', 'home');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -14,7 +14,6 @@ class ProfileController extends BaseController
|
||||
public function __construct(URI $user)
|
||||
{
|
||||
$this->user = $user;
|
||||
View::share('menu', 'home');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -15,7 +15,6 @@ class RecurringController extends BaseController
|
||||
public function __construct(RTR $repository)
|
||||
{
|
||||
$this->_repository = $repository;
|
||||
View::share('menu', 'home');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,7 +17,6 @@ class TransactionController extends BaseController
|
||||
public function __construct(TJRI $repository)
|
||||
{
|
||||
$this->_repository = $repository;
|
||||
View::share('menu', 'home');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -45,13 +45,13 @@ class UserController extends BaseController
|
||||
'email' => Input::get('email'),
|
||||
'password' => Input::get('password')
|
||||
];
|
||||
if (Auth::attempt($data, $rememberMe)) {
|
||||
$result = Auth::attempt($data, $rememberMe);
|
||||
if ($result) {
|
||||
Session::flash('success', 'Logged in!');
|
||||
|
||||
return Redirect::route('index');
|
||||
}
|
||||
Session::flash('error', 'No good!');
|
||||
|
||||
Session::flash('error', 'No good!');
|
||||
return View::make('user.login');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user