-
Billing
-
- Manage your current subscription.
-
-
+
+
+
Current Plan
+
+ {% if current_user.get_subscription() %}
+ You are on the {{ current_user.get_subscription().plan_name() }} plan.
- Manage Billing
+ Manage Subscription
-
+ {% elif manual_sub %}
+ You are on the Premium plan. The plan ends {{ manual_sub.end_at | dt }}.
+ {% elif current_user.lifetime %}
+ You have the lifetime licence.
+ {% elif current_user.in_trial() %}
+ You are in the trial period. The trial ends {{ current_user.trial_end | dt }}.
+ {% else %}
+ You are on the Free plan.
+ {% endif %}
- {% endif %}
+
diff --git a/app/dashboard/views/setting.py b/app/dashboard/views/setting.py
index 632b7bd1..22f0fdd4 100644
--- a/app/dashboard/views/setting.py
+++ b/app/dashboard/views/setting.py
@@ -26,6 +26,7 @@ from app.models import (
CustomDomain,
Client,
AliasGeneratorEnum,
+ ManualSubscription,
)
from app.utils import random_string
@@ -183,6 +184,7 @@ def setting():
headers={"Content-Disposition": "attachment;filename=data.json"},
)
+ manual_sub = ManualSubscription.get_by(user_id=current_user.id)
return render_template(
"dashboard/setting.html",
form=form,
@@ -191,6 +193,7 @@ def setting():
change_email_form=change_email_form,
pending_email=pending_email,
AliasGeneratorEnum=AliasGeneratorEnum,
+ manual_sub=manual_sub,
)