Show user current plan in settings
This commit is contained in:
parent
368c4a48ee
commit
77baf60ca4
|
@ -145,20 +145,27 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
{% if current_user.get_subscription() %}
|
<div class="card">
|
||||||
<div class="card">
|
<div class="card-body">
|
||||||
<div class="card-body">
|
<div class="card-title mb-3">Current Plan</div>
|
||||||
<div class="card-title">Billing
|
|
||||||
<div class="small-text mt-1 mb-3">
|
{% if current_user.get_subscription() %}
|
||||||
Manage your current subscription.
|
You are on the {{ current_user.get_subscription().plan_name() }} plan. <br>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<a href="{{ url_for('dashboard.billing') }}" class="btn btn-outline-primary">
|
<a href="{{ url_for('dashboard.billing') }}" class="btn btn-outline-primary">
|
||||||
Manage Billing
|
Manage Subscription
|
||||||
</a>
|
</a>
|
||||||
</div>
|
{% 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 %}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
|
|
|
@ -26,6 +26,7 @@ from app.models import (
|
||||||
CustomDomain,
|
CustomDomain,
|
||||||
Client,
|
Client,
|
||||||
AliasGeneratorEnum,
|
AliasGeneratorEnum,
|
||||||
|
ManualSubscription,
|
||||||
)
|
)
|
||||||
from app.utils import random_string
|
from app.utils import random_string
|
||||||
|
|
||||||
|
@ -183,6 +184,7 @@ def setting():
|
||||||
headers={"Content-Disposition": "attachment;filename=data.json"},
|
headers={"Content-Disposition": "attachment;filename=data.json"},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
manual_sub = ManualSubscription.get_by(user_id=current_user.id)
|
||||||
return render_template(
|
return render_template(
|
||||||
"dashboard/setting.html",
|
"dashboard/setting.html",
|
||||||
form=form,
|
form=form,
|
||||||
|
@ -191,6 +193,7 @@ def setting():
|
||||||
change_email_form=change_email_form,
|
change_email_form=change_email_form,
|
||||||
pending_email=pending_email,
|
pending_email=pending_email,
|
||||||
AliasGeneratorEnum=AliasGeneratorEnum,
|
AliasGeneratorEnum=AliasGeneratorEnum,
|
||||||
|
manual_sub=manual_sub,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue