Fix reports

Add currency report
make reports use json storage
Make tables nicer
This commit is contained in:
Aaron Kimbre
2022-01-16 20:24:47 -06:00
parent 1a5531eb19
commit b2af6d967a
17 changed files with 197 additions and 67 deletions

View File

@@ -9,7 +9,7 @@
{% endblock content_before %}
{% block content %}
<table class="table" id="accounts_table">
<table class="table table-dark table-striped table-bordered table-hover" id="accounts_table">
<thead>
<tr>
<th>Actions</th>

View File

@@ -9,7 +9,7 @@
{% endblock content_before %}
{% block content %}
<table class="table" id="accounts_table">
<table class="table table-dark table-striped table-bordered table-hover" id="accounts_table">
<thead>
<tr>
<th>Actions</th>

View File

@@ -17,7 +17,7 @@
</div>
<br/>
{% endif %}
<table class="table" id="characters_table">
<table class="table table-dark table-striped table-bordered table-hover" id="characters_table">
<thead>
<tr>
<th>Actions</th>

View File

@@ -47,7 +47,7 @@
{% endif %}
{% if current_user.is_authenticated and current_user.gm_level >= 2 %}
<a id='report-index' class='nav-link' href='{{ url_for('reports.index') }}'>Reports</a>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">Tools</a>
<div class="dropdown-menu">

View File

@@ -17,7 +17,7 @@
</div>
<br/>
{% endif %}
<table class="table" id="command_table">
<table class="table table-dark table-striped table-bordered table-hover" id="command_table">
<thead>
<tr>
<th>ID</th>

View File

@@ -17,7 +17,7 @@
</div>
<br/>
{% endif %}
<table class="table" id="activity_table">
<table class="table table-dark table-striped table-bordered table-hover" id="activity_table">
<thead>
<tr>
<th>ID</th>

View File

@@ -49,10 +49,10 @@
<div class="row">
<div class="col text-right">
TODO: add more Contributors
Developer:
</div>
<div class="col">
Add more
Jett.
</div>
</div>
@@ -62,7 +62,7 @@
Source
</div>
<div class="col">
<a href="https://github.com/DarkflameUniverse/AccountManager">
<a href="https://github.com/DarkflameUniverse/NexusDashboard">
Github
</a>
</div>

View File

@@ -11,7 +11,7 @@
{% block content %}
<h4> Characters </h4>
<hr class="bg-primary"/>
<table class="table" id="character_table">
<table class="table table-dark table-striped table-bordered table-hover" id="character_table">
<thead>
<tr>
<th>Actions</th>
@@ -28,7 +28,7 @@
<br/>
<h4> Pets </h4>
<hr class="bg-primary"/>
<table class="table" id="pet_table">
<table class="table table-dark table-striped table-bordered table-hover" id="pet_table">
<thead>
<tr>
<th>Actions</th>
@@ -41,7 +41,7 @@
<br/>
<h4> Properties </h4>
<hr class="bg-primary"/>
<table class="table" id="property_table">
<table class="table table-dark table-striped table-bordered table-hover" id="property_table">
<thead>
<tr>
<th>Actions</th>

View File

@@ -26,7 +26,7 @@
Bulk Create Play Keys
</a>
<hr class="bg-primary"/>
<table class="table" id="play_key_table">
<table class="table table-dark table-striped table-bordered table-hover" id="play_key_table">
<thead>
<tr>
<th>Actions</th>

View File

@@ -17,7 +17,7 @@
</div>
<br/>
{% endif %}
<table class="table" id="properties_table">
<table class="table table-dark table-striped table-bordered table-hover" id="properties_table">
<thead>
<tr>
<th>Actions</th>

View 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 %}

View File

@@ -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>

View File

@@ -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 %}