Updated code for #384

This commit is contained in:
James Cole
2017-12-10 20:03:10 +01:00
parent b1b6fe553a
commit 0c529cb7e7
6 changed files with 177 additions and 38 deletions

View File

@@ -0,0 +1,31 @@
<table class="table table-hover sortable">
<thead>
<tr>
<th style="width:50%;" data-defaultsign="az">{{ 'budget'|_ }}</th>
<th style="width:50%;text-align: right;" data-defaultsort="disabled">{{ 'spent'|_ }}</th>
</tr>
</thead>
<tbody>
{% for budgetId, entry in together %}
<tr>
<td style="width:50%;" data-value="{% if entry.budget.name|length ==0 %}{{ 'no_budget_squared'|_ }}{% else %}{{ entry.budget.name }}{% endif %}">
{% if entry.budget.name|length ==0 %}
<a href="{{ route('budgets.no-budget') }}">{{ 'no_budget_squared'|_ }}</a>
{% else %}
<a href="{{ route('budgets.show', budgetId) }}">{{ entry.budget.name }}</a>
{% endif %}
</td>
<td style="text-align: right;">
{% if entry.spent|length ==0 %}
{{ '0'|formatAmount }}
{% else %}
{% for expense in entry.spent %}
{{ formatAmountBySymbol(expense.sum, expense.currency.symbol, expense.currency.dp) }}<br />
{% endfor %}
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>

View File

@@ -1,16 +1,20 @@
<table class="table table-hover sortable">
<thead>
<tr>
<th data-defaultsign="az">{{ 'category'|_ }}</th>
<th style="text-align: right;">{{ 'spent'|_ }}</th>
<th style="text-align: right;">{{ 'earned'|_ }}</th>
<th style="width:50%;" data-defaultsign="az">{{ 'category'|_ }}</th>
<th style="width:25%;text-align: right;" data-defaultsort="disabled">{{ 'spent'|_ }}</th>
<th style="width:25%;text-align: right;" data-defaultsort="disabled">{{ 'earned'|_ }}</th>
</tr>
</thead>
<tbody>
{% for categoryId, entry in together %}
<tr>
<td data-value="{% if entry.category.name|length ==0 %}{{ 'noCategory'|_ }}{% else %}{{ entry.category.name }}{% endif %}">
<a href="{{ route('categories.show', categoryId) }}">{% if entry.category.name|length ==0 %}{{ 'noCategory'|_ }}{% else %}{{ entry.category.name }}{% endif %}</a>
<td style="width:50%;" data-value="{% if entry.category.name|length ==0 %}{{ 'noCategory'|_ }}{% else %}{{ entry.category.name }}{% endif %}">
{% if entry.category.name|length ==0 %}
<a href="{{ route('categories.no-category') }}">{{ 'noCategory'|_ }}</a>
{% else %}
<a href="{{ route('categories.show', categoryId) }}">{{ entry.category.name }}</a>
{% endif %}
</td>
<td style="text-align: right;">
{% if entry.spent|length ==0 %}

View File

@@ -1,10 +1,10 @@
<table class="table table-hover sortable">
<thead>
<tr>
<th data-defaultsign="az">{{ 'name'|_ }}</th>
<th data-defaultsign="az">{{ 'period'|_ }}</th>
<th class="hidden-xs" style="text-align: right;" data-defaultsort="disabled">{{ 'spent'|_ }}</th>
<th class="hidden-xs" style="text-align: right;" data-defaultsort="disabled">{{ 'earned'|_ }}</th>
<th style="width:40%;" data-defaultsign="az">{{ 'name'|_ }}</th>
<th style="width:20%;" data-defaultsign="az">{{ 'period'|_ }}</th>
<th class="hidden-xs" style="width:20%;text-align: right;" data-defaultsort="disabled">{{ 'spent'|_ }}</th>
<th class="hidden-xs" style="width:20%;text-align: right;" data-defaultsort="disabled">{{ 'earned'|_ }}</th>
</tr>
</thead>
<tbody>

View File

@@ -1,9 +1,9 @@
<table class="table table-hover sortable">
<thead>
<tr>
<th data-defaultsign="az">{{ 'name'|_ }}</th>
<th class="hidden-xs" style="text-align: right;" data-defaultsort="disabled">{{ 'spent'|_ }}</th>
<th class="hidden-xs" style="text-align: right;" data-defaultsort="disabled">{{ 'earned'|_ }}</th>
<th style="width:50%;" data-defaultsign="az">{{ 'name'|_ }}</th>
<th style="width:25%;text-align:right;" class="hidden-xs" style="text-align: right;" data-defaultsort="disabled">{{ 'spent'|_ }}</th>
<th style="width:25%;text-align:right;" class="hidden-xs" style="text-align: right;" data-defaultsort="disabled">{{ 'earned'|_ }}</th>
</tr>
</thead>
<tbody>