mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Some more layout changes.
This commit is contained in:
parent
f0f5ada7de
commit
aede03d8b2
@ -6,6 +6,7 @@ use FireflyIII\Helpers\Report\ReportQueryInterface;
|
||||
use FireflyIII\Models\Account;
|
||||
use FireflyIII\Models\Preference;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
||||
use Session;
|
||||
use Steam;
|
||||
use View;
|
||||
@ -42,14 +43,26 @@ class ReportController extends Controller
|
||||
* @internal param ReportHelperInterface $helper
|
||||
*
|
||||
*/
|
||||
public function index()
|
||||
public function index(AccountRepositoryInterface $repository)
|
||||
{
|
||||
$start = Session::get('first');
|
||||
$months = $this->helper->listOfMonths($start);
|
||||
$title = 'Reports';
|
||||
$mainTitleIcon = 'fa-line-chart';
|
||||
|
||||
return view('reports.index', compact('months', 'title', 'mainTitleIcon'));
|
||||
// does the user have shared accounts?
|
||||
$accounts = $repository->getAccounts(['Default account', 'Asset account']);
|
||||
$hasShared = false;
|
||||
|
||||
/** @var Account $account */
|
||||
foreach ($accounts as $account) {
|
||||
if ($account->getMeta('accountRole') == 'sharedAsset') {
|
||||
$hasShared = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return view('reports.index', compact('months', 'title', 'mainTitleIcon', 'hasShared'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,27 +1,49 @@
|
||||
{% extends "./layout/default.twig" %}
|
||||
{% block content %}
|
||||
{{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName) }}
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<i class="fa fa-calendar fa-fw"></i>
|
||||
Reports
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<i class="fa fa-calendar fa-fw"></i>
|
||||
Reports for your own accounts
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
|
||||
{% for year, entries in months %}
|
||||
<h4><a href="{{route('reports.year',year)}}">{{ year }}</a></h4>
|
||||
<ul class="list-inline">
|
||||
{% for month in entries %}
|
||||
<li><a href="{{route('reports.month',[month.year, month.month])}}">{{ month.formatted}}</a></li>
|
||||
{% for year, entries in months %}
|
||||
<h4><a href="{{route('reports.year',year)}}">{{ year }}</a></h4>
|
||||
<ul class="list-inline">
|
||||
{% for month in entries %}
|
||||
<li><a href="{{route('reports.month',[month.year, month.month])}}">{{ month.formatted}}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<i class="fa fa-calendar fa-fw"></i>
|
||||
Reports for your own accounts and shared accounts
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
|
||||
{% for year, entries in months %}
|
||||
<h4><a href="{{route('reports.year',[year, 'shared'])}}">{{ year }}</a></h4>
|
||||
<ul class="list-inline">
|
||||
{% for month in entries %}
|
||||
<li><a href="{{route('reports.month',[month.year, month.month,'shared'])}}">{{ month.formatted}}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block scripts %}
|
||||
|
Loading…
Reference in New Issue
Block a user