tre
This commit is contained in:
parent
d60ee252a0
commit
fbf86d553f
3 changed files with 9 additions and 9 deletions
|
@ -66,13 +66,10 @@ def sidebar(v):
|
||||||
|
|
||||||
@app.get("/stats")
|
@app.get("/stats")
|
||||||
@auth_required
|
@auth_required
|
||||||
|
@cache.memoize(timeout=86400)
|
||||||
def participation_stats(v):
|
def participation_stats(v):
|
||||||
|
|
||||||
return render_template("admin/content_stats.html", v=v, title="Content Statistics", data=stats(site=SITE))
|
|
||||||
|
|
||||||
|
|
||||||
@cache.memoize(timeout=86400)
|
|
||||||
def stats(site=None):
|
|
||||||
day = int(time.time()) - 86400
|
day = int(time.time()) - 86400
|
||||||
|
|
||||||
week = int(time.time()) - 604800
|
week = int(time.time()) - 604800
|
||||||
|
@ -203,7 +200,8 @@ def stats(site=None):
|
||||||
|
|
||||||
g.db.commit()
|
g.db.commit()
|
||||||
|
|
||||||
return stats
|
return render_template("admin/content_stats.html", v=v, title="Content Statistics", data=stats)
|
||||||
|
|
||||||
|
|
||||||
@app.get("/chart")
|
@app.get("/chart")
|
||||||
def chart():
|
def chart():
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{% extends "default.html" %}
|
{% extends "default.html" %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
<script src="/assets/js/sort_table.js?v=242"></script>
|
||||||
<pre>
|
<pre>
|
||||||
|
|
||||||
|
|
||||||
|
@ -11,15 +12,16 @@
|
||||||
|
|
||||||
|
|
||||||
</pre>
|
</pre>
|
||||||
<div class="overflow-x-auto"><table class="table table-striped mb-5">
|
<div class="overflow-x-auto">
|
||||||
|
<table id="sortable_table" class="table table-striped mb-5">
|
||||||
<thead class="bg-primary text-white">
|
<thead class="bg-primary text-white">
|
||||||
<tr>
|
<tr>
|
||||||
<th>#</th>
|
<th>#</th>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th>Image</th>
|
<th>Image</th>
|
||||||
<th>Description</th>
|
<th>Description</th>
|
||||||
<th>#</th>
|
<th role="button" onclick="sort_table(4)">#</th>
|
||||||
<th>Rarity</th>
|
<th role="button" onclick="sort_table(5)">Rarity</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
{% for badge in badges %}
|
{% for badge in badges %}
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
<th>#</th>
|
<th>#</th>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th role="button" onclick="sort_table(2)">Posts</th>
|
<th role="button" onclick="sort_table(2)">Posts</th>
|
||||||
<th role="button" onclick="sort_table(4)">Blockers</th>
|
<th role="button" onclick="sort_table(3)">Blockers</th>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue