mirror of
https://git.wownero.com/lza_menace/suchwow.git
synced 2024-08-15 01:03:19 +00:00
add stats to about page
This commit is contained in:
parent
a6aea485af
commit
faebd00fd5
2 changed files with 29 additions and 1 deletions
|
@ -3,6 +3,7 @@ from math import ceil
|
||||||
from flask import Blueprint, request, render_template, flash
|
from flask import Blueprint, request, render_template, flash
|
||||||
|
|
||||||
from suchwow._models import Post, User, TipReceived
|
from suchwow._models import Post, User, TipReceived
|
||||||
|
from suchwow.wownero import from_atomic
|
||||||
|
|
||||||
bp = Blueprint('main', 'main')
|
bp = Blueprint('main', 'main')
|
||||||
|
|
||||||
|
@ -50,4 +51,10 @@ def index():
|
||||||
@bp.route("/about")
|
@bp.route("/about")
|
||||||
def about():
|
def about():
|
||||||
mods = User.select().where(User.moderator == True)
|
mods = User.select().where(User.moderator == True)
|
||||||
return render_template("about.html", mods=mods)
|
return render_template(
|
||||||
|
"about.html",
|
||||||
|
mods=mods,
|
||||||
|
meme_count=Post.select().where(Post.approved == True).count(),
|
||||||
|
wow_received=round(from_atomic(sum([i.amount for i in TipReceived.select()])), 2),
|
||||||
|
memer_count=User.select().count(),
|
||||||
|
)
|
|
@ -2,6 +2,27 @@
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
|
<nav class="level" style="margin: 3em 0">
|
||||||
|
<div class="level-item has-text-centered">
|
||||||
|
<div>
|
||||||
|
<p class="heading">Memes</p>
|
||||||
|
<p class="title">{{ meme_count }}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="level-item has-text-centered">
|
||||||
|
<div>
|
||||||
|
<p class="heading">Tips</p>
|
||||||
|
<p class="title">{{ wow_received }} WOW</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="level-item has-text-centered">
|
||||||
|
<div>
|
||||||
|
<p class="heading">Memers</p>
|
||||||
|
<p class="title">{{ memer_count }}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
|
||||||
<div class="container" style="text-align:center;">
|
<div class="container" style="text-align:center;">
|
||||||
<div class="about content">
|
<div class="about content">
|
||||||
<h1>About</h1>
|
<h1>About</h1>
|
||||||
|
|
Loading…
Reference in a new issue