mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Piggy supports view of attachments #2828
This commit is contained in:
parent
1f919b6d0e
commit
64683647bd
@ -247,9 +247,10 @@ class PiggyBankController extends Controller
|
||||
$accountTransformer->setParameters($parameters);
|
||||
/** @var PiggyBank $piggy */
|
||||
foreach ($collection as $piggy) {
|
||||
$array = $transformer->transform($piggy);
|
||||
$account = $accountTransformer->transform($piggy->account);
|
||||
$accountId = (int) $account['id'];
|
||||
$array = $transformer->transform($piggy);
|
||||
$account = $accountTransformer->transform($piggy->account);
|
||||
$accountId = (int) $account['id'];
|
||||
$array['attachments'] = $this->piggyRepos->getAttachments($piggy);
|
||||
if (!isset($accounts[$accountId])) {
|
||||
// create new:
|
||||
$accounts[$accountId] = $account;
|
||||
@ -426,11 +427,12 @@ class PiggyBankController extends Controller
|
||||
/** @var PiggyBankTransformer $transformer */
|
||||
$transformer = app(PiggyBankTransformer::class);
|
||||
$transformer->setParameters($parameters);
|
||||
$piggy = $transformer->transform($piggyBank);
|
||||
$events = $this->piggyRepos->getEvents($piggyBank);
|
||||
$subTitle = $piggyBank->name;
|
||||
$piggy = $transformer->transform($piggyBank);
|
||||
$events = $this->piggyRepos->getEvents($piggyBank);
|
||||
$subTitle = $piggyBank->name;
|
||||
$attachments = $this->piggyRepos->getAttachments($piggyBank);
|
||||
|
||||
return view('piggy-banks.show', compact('piggyBank', 'events', 'subTitle', 'piggy'));
|
||||
return view('piggy-banks.show', compact('piggyBank', 'events', 'subTitle', 'piggy', 'attachments'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -37,6 +37,10 @@
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{ route('piggy-banks.show', piggy.id) }}" title="{{ piggy.account_name }}">{{ piggy.name }}</a>
|
||||
{% if piggy.attachments.count > 0 %}
|
||||
<i class="fa fa-fw fa-paperclip"></i>
|
||||
{% endif %}
|
||||
|
||||
</td>
|
||||
<td style="text-align: right;" class="piggySaved">
|
||||
<span title="Saved so far" style="text-align:right;">{{ formatAmountBySymbol(piggy.current_amount,piggy.currency_symbol,piggy.currency_decimal_places) }}</span>
|
||||
|
@ -20,8 +20,6 @@
|
||||
<div class="box">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{{ 'details'|_ }}</h3>
|
||||
|
||||
|
||||
<div class="box-tools pull-right">
|
||||
<div class="btn-group">
|
||||
<button class="btn btn-box-tool dropdown-toggle" data-toggle="dropdown"><i class="fa fa-ellipsis-v"></i></button>
|
||||
@ -98,10 +96,10 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
{% if piggy.notes %}
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
||||
{% if piggy.notes %}
|
||||
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
|
||||
|
||||
<div class="box">
|
||||
<div class="box-header with-border">
|
||||
@ -112,8 +110,22 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if attachments.count > 0 %}
|
||||
<div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
|
||||
<div class="box">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">
|
||||
{{ 'attachments'|_ }}
|
||||
</h3>
|
||||
</div>
|
||||
<div class="box-body table-responsive no-padding">
|
||||
{% include 'list.attachments' %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block scripts %}
|
||||
|
Loading…
Reference in New Issue
Block a user