mirror of
https://github.com/DRYTRIX/TimeTracker.git
synced 2026-05-19 04:40:32 -05:00
b0dde80ba9
Add a support modal with usage stats, tier and license links, share control, and offline-safe outbound CTAs. Surface support from the header, sidebar, user menu, dashboard card, and settings "Support & Community" section without hiding entry points when a supporter license is active. Introduce UsageStatsService and a persisted users.support_stats_reports_generated counter incremented on key report exports and custom report views. Add SupportPromptService for session-scoped soft toasts (after export, dashboard milestones, long session via POST /donate/request-soft-prompt). Wire consent-aware track_event names support.* and mirror funnel rows in DonationInteraction; fix has_recent_donation_click to treat link_clicked as a recent click. Document events and SUPPORT_* / migration notes in docs. Tests: tests/test_support_services.py for prompt and usage stats behavior.
13 lines
472 B
Python
13 lines
472 B
Python
"""
|
|
Optional support/license visibility helpers.
|
|
|
|
Instance-level supporter state is represented by Settings.donate_ui_hidden
|
|
(set when a user verifies a license / supporter key). Non-blocking: no paywall
|
|
or feature gating; UI treats this as a supporter badge and softer prompts.
|
|
"""
|
|
|
|
|
|
def is_license_activated(settings) -> bool:
|
|
"""Return True if this instance has an activated supporter / license key."""
|
|
return bool(getattr(settings, "donate_ui_hidden", False))
|