Files
firefly-iii/resources/views/popup/list/journals.twig
2016-05-14 23:14:49 +02:00

91 lines
3.1 KiB
Twig

<table class="table table-hover table-condensed">
<thead>
<tr>
<th>&nbsp;</th>
<th>{{ trans('list.description') }}</th>
<th>{{ trans('list.amount') }}</th>
<th class="hidden-sm hidden-xs">{{ trans('list.date') }}</th>
{% if not hideSource %}
<th class="hidden-xs">{{ trans('list.from') }}</th>
{% endif %}
{% if not hideDestination %}
<th class="hidden-xs">{{ trans('list.to') }}</th>
{% endif %}
<!-- Hide budgets? -->
{% if not hideBudget %}
<th class="hidden-xs"><i class="fa fa-tasks fa-fw" title="{{ trans('list.budget') }}"></i></th>
{% endif %}
<!-- Hide categories? -->
{% if not hideCategory %}
<th class="hidden-xs"><i class="fa fa-bar-chart fa-fw" title="{{ trans('list.category') }}"></i></th>
{% endif %}
</tr>
</thead>
<tbody>
<!--
Make sum:
{% set sum = 0 %}
-->
{% for journal in journals %}
<!-- add to sum
{% set sum = (sum + getAmount(journal) ) %}
-->
<tr class="drag" data-date="{{ journal.date.format('Y-m-d') }}" data-id="{{ journal.id }}">
<td class="hidden-xs">
{{ journal|typeIcon }}
</td>
<td>
<a href="{{ route('transactions.show',journal.id) }}" title="{{ journal.description }}">{{ journal.description }}</a>
</td>
<td>
{% if not accountPerspective %}
{{ journal|formatJournal }}
{% else %}
{{ formatPerspective(journal, accountPerspective)|raw }}
{% endif %}
</td>
<td class="hidden-sm hidden-xs">
{{ journal.date.formatLocalized(monthAndDayFormat) }}
</td>
{% if not hideSource %}
<td class="hidden-xs">
{{ sourceAccount(journal)|raw }}
</td>
{% endif %}
{% if not hideDestination %}
<td class="hidden-xs">
{{ destinationAccount(journal)|raw }}
</td>
{% endif %}
<!-- Do NOT hide the budget? -->
{% if not hideBudget %}
<td class="hidden-xs">
{% if journal.budgets[0] %}
<a href="{{ route('budgets.show',journal.budgets[0].id) }}">{{ journal.budgets[0].name }}</a>
{% endif %}
</td>
{% endif %}
<!-- Do NOT hide the category? -->
{% if not hideCategory %}
<td class="hidden-xs">
{% if journal.categories[0] %}
<a href="{{ route('categories.show',journal.categories[0].id) }}">{{ journal.categories[0].name }}</a>
{% endif %}
</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
<tfoot>
<tr>
<td colspan="2" style="text-align: right;"><em>{{ 'sum'|_ }}:</em></td>
<td>{{ sum|formatAmount }}</td>
</tr>
</tfoot>
</table>
{{ journals.render|raw }}