mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Cleaning up.
This commit is contained in:
parent
0683c87e52
commit
db4adf399d
@ -26,6 +26,7 @@ class AccountController extends Controller
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
View::share('mainTitleIcon', 'fa-credit-card');
|
||||
View::share('title', 'Accounts');
|
||||
}
|
||||
|
@ -29,6 +29,7 @@ class BillController extends Controller
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
View::share('title', 'Bills');
|
||||
View::share('mainTitleIcon', 'fa-calendar-o');
|
||||
}
|
||||
|
@ -29,8 +29,10 @@ class BudgetController extends Controller
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
View::share('title', 'Budgets');
|
||||
View::share('mainTitleIcon', 'fa-tasks');
|
||||
View::share('hideBudgets', true);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -185,12 +187,11 @@ class BudgetController extends Controller
|
||||
return view('error')->with('message', 'Invalid selection.');
|
||||
}
|
||||
|
||||
$hideBudget = true; // used in transaction list.
|
||||
$journals = $repository->getJournals($budget, $repetition);
|
||||
$limits = !is_null($repetition->id) ? [$repetition->budgetLimit] : $repository->getBudgetLimits($budget);
|
||||
$subTitle = !is_null($repetition->id) ? e($budget->name) . ' in ' . $repetition->startdate->format('F Y') : e($budget->name);
|
||||
$journals = $repository->getJournals($budget, $repetition);
|
||||
$limits = !is_null($repetition->id) ? [$repetition->budgetLimit] : $repository->getBudgetLimits($budget);
|
||||
$subTitle = !is_null($repetition->id) ? e($budget->name) . ' in ' . $repetition->startdate->format('F Y') : e($budget->name);
|
||||
|
||||
return view('budgets.show', compact('limits', 'budget', 'repetition', 'journals', 'subTitle', 'hideBudget'));
|
||||
return view('budgets.show', compact('limits', 'budget', 'repetition', 'journals', 'subTitle'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -26,6 +26,7 @@ class CategoryController extends Controller
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
View::share('title', 'Categories');
|
||||
View::share('mainTitleIcon', 'fa-bar-chart');
|
||||
}
|
||||
|
@ -3,6 +3,7 @@
|
||||
use Illuminate\Foundation\Bus\DispatchesCommands;
|
||||
use Illuminate\Foundation\Validation\ValidatesRequests;
|
||||
use Illuminate\Routing\Controller as BaseController;
|
||||
use View;
|
||||
|
||||
/**
|
||||
* Class Controller
|
||||
@ -14,4 +15,14 @@ abstract class Controller extends BaseController
|
||||
|
||||
use DispatchesCommands, ValidatesRequests;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
View::share('hideBudgets', false);
|
||||
View::share('hideCategories', false);
|
||||
View::share('hideBills', false);
|
||||
View::share('hideTags', false);
|
||||
}
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ class CurrencyController extends Controller
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
parent::__construct();
|
||||
View::share('title', 'Currencies');
|
||||
View::share('mainTitleIcon', 'fa-usd');
|
||||
}
|
||||
|
@ -1,12 +1,8 @@
|
||||
<?php namespace FireflyIII\Http\Controllers;
|
||||
|
||||
use Cache;
|
||||
use ErrorException;
|
||||
use FireflyIII\Helpers\Help\HelpInterface;
|
||||
use League\CommonMark\CommonMarkConverter;
|
||||
use Log;
|
||||
use Response;
|
||||
use Route;
|
||||
|
||||
/**
|
||||
* Class HelpController
|
||||
|
@ -86,7 +86,7 @@ class HomeController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
return view('index', compact('count', 'title', 'savings', 'subTitle', 'mainTitleIcon', 'transactions', 'savingsTotal','piggyBankAccounts'));
|
||||
return view('index', compact('count', 'title', 'savings', 'subTitle', 'mainTitleIcon', 'transactions', 'savingsTotal', 'piggyBankAccounts'));
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
<?php namespace FireflyIII\Http\Controllers;
|
||||
|
||||
use Amount;
|
||||
use Auth;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Helpers\Report\ReportQueryInterface;
|
||||
use FireflyIII\Models\Account;
|
||||
@ -188,7 +187,7 @@ class JsonController extends Controller
|
||||
*/
|
||||
public function tags(TagRepositoryInterface $tagRepository)
|
||||
{
|
||||
$list = $tagRepository->get();
|
||||
$list = $tagRepository->get();
|
||||
$return = [];
|
||||
foreach ($list as $entry) {
|
||||
$return[] = $entry->tag;
|
||||
|
@ -32,6 +32,7 @@ class PiggyBankController extends Controller
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
View::share('title', 'Piggy banks');
|
||||
View::share('mainTitleIcon', 'fa-sort-amount-asc');
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ class PreferencesController extends Controller
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
parent::__construct();
|
||||
View::share('title', 'Preferences');
|
||||
View::share('mainTitleIcon', 'fa-gear');
|
||||
}
|
||||
|
@ -49,7 +49,8 @@ class ProfileController extends Controller
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function postDeleteAccount(DeleteAccountFormRequest $request) {
|
||||
public function postDeleteAccount(DeleteAccountFormRequest $request)
|
||||
{
|
||||
// old, new1, new2
|
||||
if (!Hash::check($request->get('password'), Auth::user()->password)) {
|
||||
Session::flash('error', 'Invalid password!');
|
||||
@ -60,11 +61,11 @@ class ProfileController extends Controller
|
||||
// DELETE!
|
||||
Auth::user()->delete();
|
||||
Session::flush();
|
||||
|
||||
return Redirect::route('index');
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\View\View
|
||||
*/
|
||||
|
@ -10,11 +10,11 @@ use FireflyIII\Models\Tag;
|
||||
use FireflyIII\Repositories\Tag\TagRepositoryInterface;
|
||||
use Input;
|
||||
use Preferences;
|
||||
use Redirect;
|
||||
use Response;
|
||||
use Session;
|
||||
use View;
|
||||
use URL;
|
||||
use Redirect;
|
||||
use View;
|
||||
|
||||
/**
|
||||
* Class TagController
|
||||
@ -31,7 +31,7 @@ class TagController extends Controller
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
parent::__construct();
|
||||
View::share('title', 'Tags');
|
||||
View::share('mainTitleIcon', 'fa-tags');
|
||||
$tagOptions = [
|
||||
@ -182,7 +182,7 @@ class TagController extends Controller
|
||||
];
|
||||
$repository->store($data);
|
||||
|
||||
Session::flash('success','The tag has been created!');
|
||||
Session::flash('success', 'The tag has been created!');
|
||||
|
||||
if (intval(Input::get('create_another')) === 1) {
|
||||
// set value so create routine will not overwrite URL:
|
||||
@ -199,7 +199,8 @@ class TagController extends Controller
|
||||
/**
|
||||
* @param Tag $tag
|
||||
*/
|
||||
public function update(Tag $tag, TagFormRequest $request, TagRepositoryInterface $repository) {
|
||||
public function update(Tag $tag, TagFormRequest $request, TagRepositoryInterface $repository)
|
||||
{
|
||||
if (Input::get('setTag') == 'true') {
|
||||
$latitude = strlen($request->get('latitude')) > 0 ? $request->get('latitude') : null;
|
||||
$longitude = strlen($request->get('longitude')) > 0 ? $request->get('longitude') : null;
|
||||
|
@ -28,6 +28,7 @@ class TransactionController extends Controller
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
View::share('title', 'Transactions');
|
||||
View::share('mainTitleIcon', 'fa-repeat');
|
||||
}
|
||||
@ -162,7 +163,7 @@ class TransactionController extends Controller
|
||||
$preFilled['account_from_id'] = $transactions[1]->account->id;
|
||||
$preFilled['account_to_id'] = $transactions[0]->account->id;
|
||||
|
||||
Session::flash('preFilled',$preFilled);
|
||||
Session::flash('preFilled', $preFilled);
|
||||
|
||||
// put previous url in session if not redirect from store (not "return_to_edit").
|
||||
if (Session::get('transactions.edit.fromUpdate') !== true) {
|
||||
|
@ -9,13 +9,18 @@
|
||||
<th>Date</th>
|
||||
<th>From</th>
|
||||
<th>To</th>
|
||||
@if(!isset($hideBudget) || (isset($hideBudget) && $hideBudget=== false))
|
||||
{{-- Hide budgets? --}}
|
||||
@if($hideBudgets)
|
||||
<th><i class="fa fa-tasks fa-fw" title="Budget"></i></th>
|
||||
@endif
|
||||
@if(!isset($hideCategory) || (isset($hideCategory) && $hideCategory=== false))
|
||||
|
||||
{{-- Hide categories? --}}
|
||||
@if($hideCategories)
|
||||
<th><i class="fa fa-bar-chart fa-fw" title="Category"></i></th>
|
||||
@endif
|
||||
@if(!isset($hideBill) || (isset($hideBill) && $hideBill=== false))
|
||||
|
||||
{{-- Hide bills? --}}
|
||||
@if(!$hideBills)
|
||||
<th><i class="fa fa-fw fa-rotate-right" title="Bill"></i></th>
|
||||
@endif
|
||||
</tr>
|
||||
@ -29,7 +34,7 @@
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>{{{$journal->description}}}</td>
|
||||
<td colspan="7"><em>Invalid journal: Found {{$journal->transactions()->count()}} transaction(s)</td>
|
||||
<td colspan="7"><em>Invalid journal: Found {{$journal->transactions()->count()}} transaction(s)</em></td>
|
||||
</tr>
|
||||
@else
|
||||
<tr class="drag" data-date="{{$journal->date->format('Y-m-d')}}" data-id="{{$journal->id}}">
|
||||
@ -60,14 +65,17 @@
|
||||
<a href="{{route('transactions.show',$journal->id)}}" title="{{{$journal->description}}}">{{{$journal->description}}}</a>
|
||||
</td>
|
||||
<td>
|
||||
@if($journal->transactiontype->type == 'Withdrawal')
|
||||
@if(!$hideTags)
|
||||
{{-- If relevant, refer to tag instead of amount. --}}
|
||||
<!--
|
||||
transaction can only have one advancePayment or balancingAct.
|
||||
Other attempts to put in such a tag are blocked.
|
||||
also show an error when editing a tag and it becomes either
|
||||
of these two types. Or rather, block editing of the tag.
|
||||
-->
|
||||
{!! Amount::formatJournal($journal) !!}
|
||||
@else
|
||||
{!! Amount::formatJournal($journal) !!}
|
||||
@endif
|
||||
@if($journal->transactiontype->type == 'Deposit')
|
||||
{!! Amount::formatJournal($journal) !!}
|
||||
@endif
|
||||
@if($journal->transactiontype->type == 'Transfer')
|
||||
<span class="text-info">{{Amount::formatTransaction($journal->transactions[1],false)}}</span>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@ -87,7 +95,9 @@
|
||||
<a href="{{route('accounts.show',$journal->transactions[1]->account_id)}}">{{{$journal->transactions[1]->account->name}}}</a>
|
||||
@endif
|
||||
</td>
|
||||
@if(!isset($hideBudget) || (isset($hideBudget) && $hideBudget=== false))
|
||||
|
||||
{{-- Do NOT hide the budget? --}}
|
||||
@if(!$hideBudgets)
|
||||
<td>
|
||||
<?php $budget = isset($journal->budgets[0]) ? $journal->budgets[0] : null; ?>
|
||||
@if($budget)
|
||||
@ -95,20 +105,24 @@
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
@if(!isset($hideCategory) || (isset($hideCategory) && $hideCategory=== false))
|
||||
<td>
|
||||
<?php $category = isset($journal->categories[0]) ? $journal->categories[0] : null; ?>
|
||||
@if($category)
|
||||
<a href="{{route('categories.show',$category->id)}}">{{{$category->name}}}</a>
|
||||
@endif
|
||||
</td>
|
||||
|
||||
{{-- Do NOT hide the category? --}}
|
||||
@if(!$hideCategories)
|
||||
<td>
|
||||
<?php $category = isset($journal->categories[0]) ? $journal->categories[0] : null; ?>
|
||||
@if($category)
|
||||
<a href="{{route('categories.show',$category->id)}}">{{{$category->name}}}</a>
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
@if(!isset($hideBill) || (isset($hideBill) && $hideBill=== false))
|
||||
<td>
|
||||
@if($journal->bill)
|
||||
<a href="{{route('bills.show',$journal->bill_id)}}">{{{$journal->bill->name}}}</a>
|
||||
@endif
|
||||
</td>
|
||||
|
||||
{{-- Do NOT hide the bill? --}}
|
||||
@if(!$hideBills)
|
||||
<td>
|
||||
@if($journal->bill)
|
||||
<a href="{{route('bills.show',$journal->bill_id)}}">{{{$journal->bill->name}}}</a>
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user