39 lines
975 B
Python
39 lines
975 B
Python
import requests
|
|
from flask import (
|
|
g, Blueprint, render_template, abort, current_app, redirect,
|
|
redirect, request, url_for, session, flash, jsonify
|
|
)
|
|
from jinja2 import TemplateNotFound
|
|
from wotstats.openid import oid
|
|
|
|
from wotstats.log import log
|
|
from wotstats.database import db
|
|
from wotstats.models import User
|
|
from wotstats.lib import parse_wargaming_openid_url
|
|
|
|
pages_stats = Blueprint(
|
|
'stats', __name__, url_prefix='/stats', template_folder='templates')
|
|
|
|
@pages_stats.route('/')
|
|
def index():
|
|
"""Summary statistics"""
|
|
if not g.user:
|
|
return redirect(url_for('pages_home.index'))
|
|
|
|
# TODO: total accounts
|
|
#
|
|
account_statistics = __get_player_personal_data()
|
|
|
|
return render_template(
|
|
'pages/account/index.html',
|
|
account_statistics=account_statistics
|
|
)
|
|
|
|
@pages_stats.route('/summary.json')
|
|
def json_summary():
|
|
return jsonify()
|
|
|
|
|
|
@pages_stats.route('/account.json')
|
|
def json_account():
|
|
return jsonify()
|