1.1.0: Updated Profile
This commit is contained in:
@@ -11,10 +11,15 @@ def index():
|
||||
map_name = request.args.get('map')
|
||||
date_from = request.args.get('date_from')
|
||||
|
||||
# Fetch summary stats (for the dashboard)
|
||||
summary_stats = StatsService.get_team_stats_summary()
|
||||
|
||||
matches, total = StatsService.get_matches(page, Config.ITEMS_PER_PAGE, map_name, date_from)
|
||||
total_pages = (total + Config.ITEMS_PER_PAGE - 1) // Config.ITEMS_PER_PAGE
|
||||
|
||||
return render_template('matches/list.html', matches=matches, total=total, page=page, total_pages=total_pages)
|
||||
return render_template('matches/list.html',
|
||||
matches=matches, total=total, page=page, total_pages=total_pages,
|
||||
summary_stats=summary_stats)
|
||||
|
||||
@bp.route('/<match_id>')
|
||||
def detail(match_id):
|
||||
|
||||
@@ -118,11 +118,14 @@ def detail(steam_id):
|
||||
comments = WebService.get_comments('player', steam_id)
|
||||
metadata = WebService.get_player_metadata(steam_id)
|
||||
|
||||
# Roster Distribution Stats
|
||||
distribution = StatsService.get_roster_stats_distribution(steam_id)
|
||||
|
||||
# History for table (L2 Source) - Fetch ALL for history table/chart
|
||||
history_asc = StatsService.get_player_trend(steam_id, limit=1000)
|
||||
history = history_asc[::-1] if history_asc else []
|
||||
|
||||
return render_template('players/profile.html', player=player, features=features, comments=comments, metadata=metadata, history=history)
|
||||
return render_template('players/profile.html', player=player, features=features, comments=comments, metadata=metadata, history=history, distribution=distribution)
|
||||
|
||||
@bp.route('/comment/<int:comment_id>/like', methods=['POST'])
|
||||
def like_comment(comment_id):
|
||||
@@ -151,9 +154,14 @@ def charts_data(steam_id):
|
||||
|
||||
trend_labels = []
|
||||
trend_values = []
|
||||
for t in trends:
|
||||
dt = datetime.fromtimestamp(t['start_time']) if t['start_time'] else datetime.now()
|
||||
trend_labels.append(dt.strftime('%Y-%m-%d'))
|
||||
match_indices = []
|
||||
for i, row in enumerate(trends):
|
||||
t = dict(row) # Convert sqlite3.Row to dict
|
||||
# Format: Match #Index (Map)
|
||||
# Use backend-provided match_index if available, or just index + 1
|
||||
idx = t.get('match_index', i + 1)
|
||||
map_name = t.get('map_name', 'Unknown')
|
||||
trend_labels.append(f"#{idx} {map_name}")
|
||||
trend_values.append(t['rating'])
|
||||
|
||||
return jsonify({
|
||||
|
||||
Reference in New Issue
Block a user