Fix refresh button 404 and add clickable league names

- Added missing POST route for refresh button at /<username>/<week>/refresh
- Fixed 404 error by redirecting refresh POST to dashboard route
- Made league names clickable links to Sleeper league pages
- Added CSS styling for league name links with hover effects
- Sleeper URLs work on both web and mobile (app deep links)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
efigueroa 2025-09-06 23:04:55 -07:00
parent f329c944f8
commit 59265c7798
3 changed files with 23 additions and 1 deletions

6
app.py
View file

@ -95,6 +95,12 @@ def dashboard_week(username, week):
print(f"DEBUG: Dashboard week - username: '{username}', week: {week}", flush=True) print(f"DEBUG: Dashboard week - username: '{username}', week: {week}", flush=True)
return dashboard(username, week) return dashboard(username, week)
@app.route('/<username>/<int:week>/refresh', methods=['POST'])
def refresh_scores(username, week):
"""Server-side refresh scores - redirect back to dashboard"""
print(f"DEBUG: Refresh scores POST - username: '{username}', week: {week}", flush=True)
return redirect(url_for('dashboard_week', username=username, week=week))
def dashboard(username, week): def dashboard(username, week):
"""Main dashboard logic - fetch and display user's fantasy data""" """Main dashboard logic - fetch and display user's fantasy data"""
print(f"DEBUG: Dashboard function START - username: '{username}', week: {week}", flush=True) print(f"DEBUG: Dashboard function START - username: '{username}', week: {week}", flush=True)

View file

@ -255,6 +255,20 @@
font-size: 14px; font-size: 14px;
} }
.league-name-link {
text-decoration: none;
color: inherit;
transition: color 0.2s ease;
}
.league-name-link:hover {
color: var(--accent);
}
.league-name-link:hover .league-name {
color: var(--accent);
}
/* League color dots */ /* League color dots */
.league-dot { .league-dot {
width: 8px; width: 8px;

View file

@ -27,7 +27,9 @@
<div class="league-info"> <div class="league-info">
<!-- League color dot --> <!-- League color dot -->
<span class="league-dot" style="background-color: {{ league_info.league_color }};"></span> <span class="league-dot" style="background-color: {{ league_info.league_color }};"></span>
<a href="https://sleeper.com/leagues/{{ league_info.league.league_id }}" target="_blank" class="league-name-link">
<span class="league-name">{{ league_info.league.name }}</span> <span class="league-name">{{ league_info.league.name }}</span>
</a>
</div> </div>
<div class="score-compact"> <div class="score-compact">
<!-- Win/Loss indicator --> <!-- Win/Loss indicator -->