diff --git a/rstat_tool/dashboard.py b/rstat_tool/dashboard.py index 293a71d..89e5974 100644 --- a/rstat_tool/dashboard.py +++ b/rstat_tool/dashboard.py @@ -37,7 +37,6 @@ def inject_subreddits(): def overall_dashboard(): """Handler for the main, overall dashboard.""" view_type = request.args.get('view', 'daily') - is_image_mode = request.args.get('image') == 'true' if view_type == 'weekly': @@ -57,19 +56,19 @@ def overall_dashboard(): tickers=tickers, view_type=view_type, subreddit_name=None, - is_image_mode=is_image_mode + is_image_mode=is_image_mode, + base_url="/" ) @app.route("/subreddit/") def subreddit_dashboard(name): """Handler for per-subreddit dashboards.""" view_type = request.args.get('view', 'daily') - is_image_mode = request.args.get('image') == 'true' - + if view_type == 'weekly': today = datetime.now(timezone.utc) - target_date = today - timedelta(days=7) # Default to last week + target_date = today - timedelta(days=7) tickers, start, end = get_weekly_summary_for_subreddit(name, target_date) date_string = f"{start.strftime('%b %d')} - {end.strftime('%b %d, %Y')}" subtitle = f"r/{name} - Top 10 Weekly" @@ -86,7 +85,8 @@ def subreddit_dashboard(name): tickers=tickers, view_type=view_type, subreddit_name=name, - is_image_mode=is_image_mode + is_image_mode=is_image_mode, + base_url=f"/subreddit/{name}" ) @app.route("/deep-dive/") diff --git a/templates/dashboard_base.html b/templates/dashboard_base.html index de735de..eb4a4b9 100644 --- a/templates/dashboard_base.html +++ b/templates/dashboard_base.html @@ -67,6 +67,18 @@ } .image-container { width: 750px; background: linear-gradient(145deg, #2d3748, #1a202c); color: #ffffff; border-radius: 16px; padding: 2.5rem; box-shadow: 0 10px 30px rgba(0,0,0,0.5); text-align: center; } header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 2rem; } + .header-action { + display: flex; + align-items: center; + gap: 1rem; + } + .header-action .icon-link svg { + color: #a0aec0; + transition: color 0.2s; + } + .header-action .icon-link:hover svg { + color: #ffffff; + } .title-block { text-align: left; } .title-block h1 { font-size: 2.5rem; font-weight: 800; margin: 0; line-height: 1; } .title-block h2 { font-size: 1.25rem; font-weight: 600; margin: 0.5rem 0 0; color: #a0aec0; } diff --git a/templates/dashboard_view.html b/templates/dashboard_view.html index 00ccc85..3b3a3c3 100644 --- a/templates/dashboard_view.html +++ b/templates/dashboard_view.html @@ -9,7 +9,20 @@

Reddit Ticker Mentions

{{ subtitle }}

-
{{ date_string }}
+ +
+
{{ date_string }}
+ + + {% if not is_image_mode %} + + + + + + + {% endif %} +