Multi year report move to AJAX.

Signed-off-by: James Cole <thegrumpydictator@gmail.com>
This commit is contained in:
James Cole
2016-11-02 20:08:11 +01:00
parent 2ddd4314f1
commit e24f5ec9f3
15 changed files with 267 additions and 272 deletions

View File

@@ -12,7 +12,7 @@
</div>
<div class="box-body table-responsive">
{% if domains|length > 0 %}
<table class="table table-condensed table-sortable">
<table class="table table-condensed sortable">
<thead>
<tr>
<th style="width:20%;">&nbsp;</th>
@@ -59,7 +59,7 @@
{{ 'all_domains_is_filtered'|_ }}
</p>
<table class="table table-condensed table-sortable">
<table class="table table-condensed sortable">
<thead>
<tr>
<th style="width:20%;">&nbsp;</th>
@@ -118,3 +118,9 @@
{% endblock %}
{% block styles %}
<link rel="stylesheet" href="css/bootstrap-sortable.css" type="text/css" media="all"/>
{% endblock %}
{% block scripts %}
<script type="text/javascript" src="js/lib/bootstrap-sortable.js"></script>
{% endblock %}

View File

@@ -11,7 +11,7 @@
<h3 class="box-title">{{ 'all_users'|_ }}</h3>
</div>
<div class="box-body table-responsive no-padding">
<table class="table table-condensed table-sortable">
<table class="table table-condensed sortable">
<thead>
<tr>
<th colspan="2">&nbsp;</th>
@@ -29,15 +29,15 @@
<tbody>
{% for user in users %}
<tr>
<td>
<td data-value="{{ user.id }}">
<div class="btn-group btn-group-xs">
<a class="btn btn-default" href="{{ route('admin.users.edit',user.id) }}"><i class="fa fa-pencil"></i></a>
</div>
</td>
<td>#{{ user.id }}</td>
<td>
<td data-value="{{ user.id }}">#{{ user.id }}</td>
<td data-value="{{ user.email }}">
<a href="{{ route('admin.users.show',user.id) }}">{{ user.email }}</a></td>
<td>
<td data-value="{{ user.created_at.format('Y-m-d-H-i-s') }}">
{{ user.created_at.formatLocalized(monthAndDayFormat) }}
{{ user.created_at.format('H:i') }}
</td>
@@ -47,28 +47,28 @@
<td>
{{ Preferences.getForUser(user,"confirmation_ip_address").data }}
</td>
<td>
<td data-value="{% if user.isAdmin %}1{% else %}0{% endif %}">
{% if user.isAdmin %}
<small class="text-success"><i class="fa fa-fw fa-check"></i></small>
{% else %}
<small class="text-danger"><i class="fa fa-fw fa-times"></i></small>
{% endif %}
</td>
<td>
<td data-value="{% if user.has2FA %}1{% else %}0{% endif %}">
{% if user.has2FA %}
<small class="text-success"><i class="fa fa-fw fa-check"></i></small>
{% else %}
<small class="text-danger"><i class="fa fa-fw fa-times"></i></small>
{% endif %}
</td>
<td>
<td data-value="{% if user.activated %}1{% else %}0{% endif %}">
{% if user.activated %}
<small class="text-success"><i class="fa fa-fw fa-check"></i></small>
{% else %}
<small class="text-danger"><i class="fa fa-fw fa-times"></i></small>
{% endif %}
</td>
<td>
<td data-value="{% if user.blocked %}1{% else %}0{% endif %}">
{% if user.blocked == 1 %}
<small class="text-danger"><i class="fa fa-fw fa-check" title="{{ 'yes'|_ }}"></i></small>
{% else %}
@@ -95,3 +95,9 @@
</div>
</div>
{% endblock %}
{% block styles %}
<link rel="stylesheet" href="css/bootstrap-sortable.css" type="text/css" media="all"/>
{% endblock %}
{% block scripts %}
<script type="text/javascript" src="js/lib/bootstrap-sortable.js"></script>
{% endblock %}

View File

@@ -91,40 +91,8 @@
<div class="box-header with-border">
<h3 class="box-title">{{ 'budgets'|_ }}</h3>
</div>
<div class="box-body no-padding table-responsive">
<table class="table table-hover sortable">
<thead>
<tr>
<th>{{ 'budget'|_ }}</th>
{% for year in years %}
<th>{{ year }}</th>
{% endfor %}
<th>{{ 'sum'|_ }}</th>
</tr>
</thead>
<tbody>
{% for id, info in budgetMultiYear %}
<tr>
<td>
{% if id == 0 %}
<a href="{{ route('budgets.noBudget') }}">{{ info.name }}</a>
<div class="box-body no-padding table-responsive loading" id="budgetMultiYear">
{% else %}
<a href="{{ route('budgets.show', id) }}">{{ info.name }}</a>
{% endif %}
</td>
{% for amount in info.entries %}
<td data-value="{{ amount }}">
{{ amount|formatAmount }}
</td>
{% endfor %}
<td data-value="{{ info.sum }}">
{{ info.sum|formatAmount }}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
@@ -152,6 +120,7 @@
<!-- some URL's -->
var accountReportUrl = '{{ route('reports.data.accountReport', [start.format('Ymd'), end.format('Ymd'), accountIds]) }}';
var inOutReportUrl = '{{ route('reports.data.inOutReport', [start.format('Ymd'), end.format('Ymd'), accountIds]) }}';
var budgetMultiUrl = '{{ route('reports.data.budgetMultiYear', [start.format('Ymd'), end.format('Ymd'), accountIds]) }}';
</script>
<script type="text/javascript" src="js/ff/reports/default/all.js"></script>

View File

@@ -0,0 +1,33 @@
<table class="table table-hover sortable">
<thead>
<tr>
<th>{{ 'budget'|_ }}</th>
{% for year in years %}
<th>{{ year }}</th>
{% endfor %}
<th>{{ 'sum'|_ }}</th>
</tr>
</thead>
<tbody>
{% for id, info in budgetMultiYear %}
<tr>
<td>
{% if id == 0 %}
<a href="{{ route('budgets.noBudget') }}">{{ info.name }}</a>
{% else %}
<a href="{{ route('budgets.show', id) }}">{{ info.name }}</a>
{% endif %}
</td>
{% for amount in info.entries %}
<td data-value="{{ amount }}">
{{ amount|formatAmount }}
</td>
{% endfor %}
<td data-value="{{ info.sum }}">
{{ info.sum|formatAmount }}
</td>
</tr>
{% endfor %}
</tbody>
</table>