Improved sorting in various views.

This commit is contained in:
James Cole
2016-11-20 17:36:11 +01:00
parent 0b613c3b8c
commit c56f937521
16 changed files with 82 additions and 65 deletions

View File

@@ -104,8 +104,13 @@
{% endblock %}
{% block scripts %}
<script type="text/javascript">
var query = '{{ query }}';
</script>
{% endblock %}
{% block scripts %}
<script type="text/javascript" src="js/lib/bootstrap-sortable.js"></script>
<script type="text/javascript">
var query = '{{ query }}';
</script>
{% endblock %}
{% block styles %}
<link rel="stylesheet" href="css/bootstrap-sortable.css" type="text/css" media="all"/>
{% endblock %}

View File

@@ -2,10 +2,10 @@
<thead>
<tr>
<th class="hidden-sm hidden-xs" data-defaultsort="disabled">&nbsp;</th>
<th>{{ trans('list.name') }}</th>
<th class="hidden-sm hidden-xs">{{ trans('list.type') }}</th>
<th class="hidden-sm hidden-xs">{{ trans('list.role') }}</th>
<th class="hidden-sm hidden-xs">{{ trans('list.iban') }}</th>
<th data-defaultsign="az">{{ trans('list.name') }}</th>
<th data-defaultsign="az" class="hidden-sm hidden-xs">{{ trans('list.type') }}</th>
<th data-defaultsign="az" class="hidden-sm hidden-xs">{{ trans('list.role') }}</th>
<th data-defaultsign="az" class="hidden-sm hidden-xs">{{ trans('list.iban') }}</th>
</tr>
</thead>
<tbody>
@@ -17,7 +17,9 @@
<a class="btn btn-danger btn-xs" href="{{ route('accounts.delete',account.id) }}"><i class="fa fa-fw fa-trash-o"></i></a>
</div>
</td>
<td><a href="{{ route('accounts.show',account.id) }}">{{ account.name }}</a></td>
<td data-value="{{ account.name }}">
<a href="{{ route('accounts.show',account.id) }}">{{ account.name }}</a>
</td>
<td>{{ trans('firefly.'~account.accountType.type) }}</td>
<td class="hidden-sm hidden-xs">
{% for entry in account.accountmeta %}

View File

@@ -2,7 +2,7 @@
<thead>
<tr>
<th class="hidden-sm hidden-xs" data-defaultsort="disabled">&nbsp;</th>
<th>{{ trans('list.name') }}</th>
<th data-defaultsign="az">{{ trans('list.name') }}</th>
</tr>
</thead>
<tbody>
@@ -14,7 +14,9 @@
<a class="btn btn-danger btn-xs" href="{{ route('budgets.delete', budget.id) }}"><i class="fa fa-fw fa-trash-o"></i></a>
</div>
</td>
<td><a href="{{ route('budgets.show',budget.id) }}">{{ budget.name }}</a></td>
<td data-value="{{ budget.name }}">
<a href="{{ route('budgets.show',budget.id) }}">{{ budget.name }}</a>
</td>
</tr>
{% endfor %}
</tbody>

View File

@@ -2,7 +2,7 @@
<thead>
<tr>
<th class="hidden-sm hidden-xs" data-defaultsort="disabled">&nbsp;</th>
<th>{{ trans('list.name') }}</th>
<th data-defaultsign="az">{{ trans('list.name') }}</th>
</tr>
</thead>
<tbody>
@@ -14,7 +14,9 @@
<a class="btn btn-danger btn-xs" href="{{ route('categories.delete',category.id) }}"><i class="fa fa-fw fa-trash-o"></i></a>
</div>
</td>
<td><a href="{{ route('categories.show',category.id) }}">{{ category.name }}</a></td>
<td data-value="{{ category.name }}">
<a href="{{ route('categories.show',category.id) }}">{{ category.name }}</a>
</td>
</tr>
{% endfor %}
</tbody>

View File

@@ -2,8 +2,8 @@
<thead>
<tr>
<th class="hidden-sm hidden-xs" data-defaultsort="disabled">&nbsp;</th>
<th>{{ trans('list.name') }}</th>
<th>{{ trans('list.type') }}</th>
<th data-defaultsign="az">{{ trans('list.name') }}</th>
<th data-defaultsign="az">{{ trans('list.type') }}</th>
</tr>
</thead>
<tbody>
@@ -15,7 +15,9 @@
<a class="btn btn-danger btn-xs" href="{{ route('tags.delete', tag.id) }}"><i class="fa fa-fw fa-trash-o"></i></a>
</div>
</td>
<td><a href="{{ route('tags.show',tag.id) }}">{{ tag.tag }}</a></td>
<td data-value="{{ tag.tag }}">
<a href="{{ route('tags.show',tag.id) }}">{{ tag.tag }}</a><
/td>
<td>{{ ('tag'~tag.tagMode)|_ }}</td>
</tr>
{% endfor %}

View File

@@ -1,17 +1,17 @@
{{ journals.render|raw }}
<table class="table table-hover table-compressed {% if sorting %}sortable-table{% endif %}">
<table class="table table-hover table-compressed sortable">
<thead>
<tr class="ignore">
<th class="hidden-xs" colspan="2">&nbsp;</th>
<th>{{ trans('list.description') }}</th>
<th>{{ trans('list.amount') }}</th>
<th class="hidden-sm hidden-xs">{{ trans('list.date') }}</th>
<th data-defaultsort="disabled" class="hidden-xs" colspan="2">&nbsp;</th>
<th data-defaultsort="disabled">{{ trans('list.description') }}</th>
<th data-defaultsign="_19">{{ trans('list.amount') }}</th>
<th data-defaultsign="month" class="hidden-sm hidden-xs">{{ trans('list.date') }}</th>
</tr>
</thead>
<tbody>
{% for transaction in transactions %}
<tr class="drag" data-date="{{ transaction.date.format('Y-m-d') }}" data-id="{{ transaction.journal_id }}">
<tr>
<td class="hidden-xs">
<div class="btn-group btn-group-xs edit_buttons">
<a href="{{ route('transactions.edit',transaction.journal_id) }}" class="btn btn-xs btn-default"><i class="fa fa-fw fa-pencil"></i></a>
@@ -38,7 +38,7 @@
{% endif %}
</td>
<td>
<td data-value="{{ transaction.transaction_amount }}">
<!-- format amount of transaction -->
{{ formatAmountWithCode(transaction.transaction_amount, transaction.transaction_currency_code) }}
<!-- and then amount of journal itself. -->
@@ -47,7 +47,7 @@
</td>
<td class="hidden-sm hidden-xs">
<td class="hidden-sm hidden-xs" data-value="{{ transaction.date.format('Y-m-d H:i:s') }}">
{{ transaction.date.formatLocalized(monthAndDayFormat) }}
</td>
</tr>