Piggies can have no target amount.

This commit is contained in:
James Cole
2022-03-27 18:30:46 +02:00
parent 980120f1bd
commit 8ee4c2ea11
9 changed files with 94 additions and 59 deletions

View File

@@ -57,6 +57,7 @@
</td>
<td class="hidden-sm hidden-xs piggyBar">
{% if null != piggy.percentage %}
<div class="progress progress" style="margin-bottom:0;">
<div
{% if piggy.percentage == 100 %}
@@ -71,17 +72,20 @@
{{ piggy.percentage }}%
</div>
</div>
{% endif %}
</td>
<td class="hidden-sm hidden-xs" style="width:40px;">
{% if piggy.left_to_save > 0 %}
{% if piggy.left_to_save > 0 or null == piggy.left_to_save %}
<a href="{{ route('piggy-banks.add-money', piggy.id) }}" class="btn btn-default btn-xs addMoney" data-id="{{ piggy.id }}">
<span data-id="{{ piggy.id }}" class="fa fa-plus"></span></a>
{% endif %}
</td>
<td class="hidden-sm hidden-xs" style="text-align:right;">
<span title="{{ 'target_amount'|_ }}">{{ formatAmountBySymbol(piggy.target_amount,piggy.currency_symbol,piggy.currency_decimal_places) }}</span>
{% if null != piggy.target_amount %}
<span title="{{ 'target_amount'|_ }}">{{ formatAmountBySymbol(piggy.target_amount,piggy.currency_symbol,piggy.currency_decimal_places) }}</span>
{% endif %}
</td>
<td class="hidden-sm hidden-xs" style="text-align:right;">
{% if piggy.left_to_save > 0 %}

View File

@@ -42,24 +42,28 @@
<td>{{ piggy.object_group_title }}</a></td>
</tr>
{% endif %}
{% if null != piggy.target_amount %}
<tr>
<td>{{ 'target_amount'|_ }}</td>
<td>
{{ formatAmountBySymbol(piggy.target_amount, piggy.currency_symbol, piggy.currency_decimal_places) }}
</td>
</tr>
{% endif %}
<tr>
<td>{{ 'saved_so_far'|_ }}</td>
<td>
{{ formatAmountBySymbol(piggy.current_amount, piggy.currency_symbol, piggy.currency_decimal_places) }}
</td>
</tr>
{% if null != piggy.left_to_save %}
<tr>
<td>{{ 'left_to_save'|_ }}</td>
<td>
{{ formatAmountBySymbol(piggy.left_to_save, piggy.currency_symbol, piggy.currency_decimal_places) }}
</td>
</tr>
{% endif %}
<tr>
<td>{{ 'start_date'|_ }}</td>
<td>