mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-01-23 23:13:18 -06:00
Generic code cleanup.
This commit is contained in:
parent
779f461491
commit
6a58dbb207
@ -15,14 +15,12 @@ namespace FireflyIII\Http\Controllers;
|
||||
|
||||
use FireflyIII\Helpers\Collector\JournalCollector;
|
||||
use FireflyIII\Http\Requests\TagFormRequest;
|
||||
use FireflyIII\Models\Preference;
|
||||
use FireflyIII\Models\Tag;
|
||||
use FireflyIII\Models\Transaction;
|
||||
use FireflyIII\Repositories\Tag\TagRepositoryInterface;
|
||||
use Illuminate\Support\Collection;
|
||||
use Input;
|
||||
use Preferences;
|
||||
use Response;
|
||||
use Session;
|
||||
use URL;
|
||||
use View;
|
||||
@ -170,33 +168,14 @@ class TagController extends Controller
|
||||
return view('tags.edit', compact('tag', 'subTitle', 'subTitleIcon', 'tagOptions'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $state
|
||||
*
|
||||
* @return \Symfony\Component\HttpFoundation\Response
|
||||
*/
|
||||
public function hideTagHelp(string $state)
|
||||
{
|
||||
|
||||
$newState = $state == 'true' ? true : false;
|
||||
Preferences::set('hideTagHelp', $newState);
|
||||
|
||||
return Response::json([true]);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
/** @var Preference $helpHiddenPref */
|
||||
$helpHiddenPref = Preferences::get('hideTagHelp', false);
|
||||
$title = 'Tags';
|
||||
$mainTitleIcon = 'fa-tags';
|
||||
$helpHidden = $helpHiddenPref->data;
|
||||
|
||||
// group years.
|
||||
$types = ['nothing', 'balancingAct', 'advancePayment'];
|
||||
$title = 'Tags';
|
||||
$mainTitleIcon = 'fa-tags';
|
||||
$types = ['nothing', 'balancingAct', 'advancePayment'];
|
||||
|
||||
// loop each types and get the tags, group them by year.
|
||||
$collection = [];
|
||||
@ -223,7 +202,7 @@ class TagController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
return view('tags.index', compact('title', 'mainTitleIcon', 'types', 'helpHidden', 'collection'));
|
||||
return view('tags.index', compact('title', 'mainTitleIcon', 'types', 'collection'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user