added stats page

This commit is contained in:
2020-12-14 23:21:19 +11:00
parent 4691e50811
commit 24210d365c
3 changed files with 44 additions and 0 deletions

View File

@@ -26,6 +26,7 @@
<div class="dropdown-menu" aria-labelledby="BookMenu">
<a class="dropdown-item" href="{{url_for('books')}}">Create</a>
<a class="dropdown-item" href="{{url_for('books')}}">Show All</a>
<a class="dropdown-item" href="{{url_for('stats')}}">Show Stats</a>
</div>
</div class="nav-item dropdown">
<div class="nav-item dropdown">

15
templates/stats.html Normal file
View File

@@ -0,0 +1,15 @@
{% extends "base.html" %}
{% block main_content %}
<h3>Stats</h3>
<table id="stats_table" class="table table-striped table-sm" data-toolbar="#toolbar" data-search="true">
<thead>
<tr class="thead-light"><th>Statistic</th><th>Value</th></tr>
</thead>
<tbody>
{% for s in stats %}
<tr><td>{{s.stat}}</td><td>{{s.value}}</tr>
{% endfor %}
</tbody>
</table>
{% endblock main_content %}