Fix reports
Add currency report make reports use json storage Make tables nicer
This commit is contained in:
51
app/templates/reports/currency/by_date.html.j2
Normal file
51
app/templates/reports/currency/by_date.html.j2
Normal file
@@ -0,0 +1,51 @@
|
||||
{% extends 'base.html.j2' %}
|
||||
|
||||
{% block title %}
|
||||
Currency on {{ date }}
|
||||
{% endblock title %}
|
||||
|
||||
{% block content_before %}
|
||||
Currency on {{ date }}
|
||||
{% endblock content_before %}
|
||||
|
||||
{% block content %}
|
||||
<div class='table-responsive'>
|
||||
<table class="table table-dark table-striped table-bordered table-hover"
|
||||
id="currency_by_date"
|
||||
data-order='[[ 1, "desc" ]]'>
|
||||
<thead>
|
||||
<th scope="col">
|
||||
Character
|
||||
</th>
|
||||
<th scope="col">
|
||||
currency
|
||||
</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for name, currency in data.items() %}
|
||||
<tr>
|
||||
<td>
|
||||
{{ name }}
|
||||
</td>
|
||||
<td>
|
||||
{{ currency }}
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block js %}
|
||||
{{ super () }}
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
let currency_by_date = $('#currency_by_date').DataTable({
|
||||
"processing": false,
|
||||
"serverSide": false,
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
@@ -12,14 +12,21 @@
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
Items: <br/>
|
||||
{% for item in items %}
|
||||
{% for report in reports %}
|
||||
<a role="button" class="btn btn-primary btn btn-block"
|
||||
href='{{url_for('reports.items_by_date', date=item.date)}}'>
|
||||
{{item.date}}
|
||||
href='{{url_for('reports.items_by_date', date=report.date)}}'>
|
||||
{{report.date}}
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="col">
|
||||
Currency: <br/>
|
||||
{% for report in reports %}
|
||||
<a role="button" class="btn btn-primary btn btn-block"
|
||||
href='{{url_for('reports.currency_by_date', date=report.date)}}'>
|
||||
{{report.date}}
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="col">
|
||||
</div>
|
||||
|
@@ -11,9 +11,8 @@
|
||||
{% block content %}
|
||||
<div class='table-responsive'>
|
||||
<table class="table table-dark table-striped table-bordered table-hover"
|
||||
id="two_weeks"
|
||||
data-order='[[ 1, "asc" ]]'
|
||||
data-page-length='25'>
|
||||
id="items_by_date"
|
||||
data-order='[[ 1, "desc" ]]'>
|
||||
<thead>
|
||||
<th scope="col">
|
||||
Item
|
||||
@@ -26,16 +25,16 @@
|
||||
</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for item in items %}
|
||||
{% for lot, count in data.items() %}
|
||||
<tr>
|
||||
<td>
|
||||
{{ item.item|get_lot_name }}
|
||||
{{ lot|get_lot_name }}
|
||||
</td>
|
||||
<td>
|
||||
{{ item.count }}
|
||||
{{ count }}
|
||||
</td>
|
||||
<td>
|
||||
{{ item.item|get_lot_rarity }}
|
||||
{{ lot|get_lot_rarity }}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
@@ -44,3 +43,14 @@
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block js %}
|
||||
{{ super () }}
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
let items_by_date = $('#items_by_date').DataTable({
|
||||
"processing": false,
|
||||
"serverSide": false,
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
Reference in New Issue
Block a user