mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-18 07:38:29 +00:00
Generic code cleanup.
This commit is contained in:
@@ -15,14 +15,12 @@ namespace FireflyIII\Http\Controllers;
|
|||||||
|
|
||||||
use FireflyIII\Helpers\Collector\JournalCollector;
|
use FireflyIII\Helpers\Collector\JournalCollector;
|
||||||
use FireflyIII\Http\Requests\TagFormRequest;
|
use FireflyIII\Http\Requests\TagFormRequest;
|
||||||
use FireflyIII\Models\Preference;
|
|
||||||
use FireflyIII\Models\Tag;
|
use FireflyIII\Models\Tag;
|
||||||
use FireflyIII\Models\Transaction;
|
use FireflyIII\Models\Transaction;
|
||||||
use FireflyIII\Repositories\Tag\TagRepositoryInterface;
|
use FireflyIII\Repositories\Tag\TagRepositoryInterface;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
use Input;
|
use Input;
|
||||||
use Preferences;
|
use Preferences;
|
||||||
use Response;
|
|
||||||
use Session;
|
use Session;
|
||||||
use URL;
|
use URL;
|
||||||
use View;
|
use View;
|
||||||
@@ -170,33 +168,14 @@ class TagController extends Controller
|
|||||||
return view('tags.edit', compact('tag', 'subTitle', 'subTitleIcon', 'tagOptions'));
|
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()
|
public function index()
|
||||||
{
|
{
|
||||||
/** @var Preference $helpHiddenPref */
|
$title = 'Tags';
|
||||||
$helpHiddenPref = Preferences::get('hideTagHelp', false);
|
$mainTitleIcon = 'fa-tags';
|
||||||
$title = 'Tags';
|
$types = ['nothing', 'balancingAct', 'advancePayment'];
|
||||||
$mainTitleIcon = 'fa-tags';
|
|
||||||
$helpHidden = $helpHiddenPref->data;
|
|
||||||
|
|
||||||
// group years.
|
|
||||||
$types = ['nothing', 'balancingAct', 'advancePayment'];
|
|
||||||
|
|
||||||
// loop each types and get the tags, group them by year.
|
// loop each types and get the tags, group them by year.
|
||||||
$collection = [];
|
$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'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user