2.0.0-rc2: Achievements Refactored & Admin improved.
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
from flask import Blueprint, render_template, request
|
||||
|
||||
from web.services.discovery_service import DiscoveryService
|
||||
|
||||
|
||||
bp = Blueprint('discover', __name__, url_prefix='/discover')
|
||||
|
||||
|
||||
@bp.route('/')
|
||||
def index():
|
||||
tone = request.args.get('tone')
|
||||
dimension = request.args.get('dimension')
|
||||
if dimension not in {'map', 'elo'}:
|
||||
dimension = None
|
||||
return render_template(
|
||||
'discover/index.html',
|
||||
insights=DiscoveryService.get_insights(tone),
|
||||
medals=DiscoveryService.get_medals(dimension),
|
||||
leaderboard=DiscoveryService.get_medal_leaderboard(),
|
||||
tone=tone,
|
||||
dimension=dimension,
|
||||
tone_labels=DiscoveryService.TONE_LABELS,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user