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\Account;
|
||||||
use FireflyIII\Models\Preference;
|
use FireflyIII\Models\Preference;
|
||||||
use FireflyIII\Models\TransactionJournal;
|
use FireflyIII\Models\TransactionJournal;
|
||||||
|
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
||||||
use Session;
|
use Session;
|
||||||
use Steam;
|
use Steam;
|
||||||
use View;
|
use View;
|
||||||
@ -42,14 +43,26 @@ class ReportController extends Controller
|
|||||||
* @internal param ReportHelperInterface $helper
|
* @internal param ReportHelperInterface $helper
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function index()
|
public function index(AccountRepositoryInterface $repository)
|
||||||
{
|
{
|
||||||
$start = Session::get('first');
|
$start = Session::get('first');
|
||||||
$months = $this->helper->listOfMonths($start);
|
$months = $this->helper->listOfMonths($start);
|
||||||
$title = 'Reports';
|
$title = 'Reports';
|
||||||
$mainTitleIcon = 'fa-line-chart';
|
$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" %}
|
{% extends "./layout/default.twig" %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName) }}
|
{{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName) }}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-12 col-md-12 col-sm-12">
|
<div class="col-lg-12 col-md-12 col-sm-12">
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<i class="fa fa-calendar fa-fw"></i>
|
<i class="fa fa-calendar fa-fw"></i>
|
||||||
Reports
|
Reports for your own accounts
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
|
|
||||||
{% for year, entries in months %}
|
{% for year, entries in months %}
|
||||||
<h4><a href="{{route('reports.year',year)}}">{{ year }}</a></h4>
|
<h4><a href="{{route('reports.year',year)}}">{{ year }}</a></h4>
|
||||||
<ul class="list-inline">
|
<ul class="list-inline">
|
||||||
{% for month in entries %}
|
{% for month in entries %}
|
||||||
<li><a href="{{route('reports.month',[month.year, month.month])}}">{{ month.formatted}}</a></li>
|
<li><a href="{{route('reports.month',[month.year, month.month])}}">{{ month.formatted}}</a></li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</div>
|
||||||
{% endfor %}
|
</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>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block scripts %}
|
{% block scripts %}
|
||||||
|
Loading…
Reference in New Issue
Block a user