Show user current plan in settings
This commit is contained in:
parent
368c4a48ee
commit
77baf60ca4
|
@ -145,20 +145,27 @@
|
|||
</div>
|
||||
|
||||
|
||||
{% if current_user.get_subscription() %}
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="card-title">Billing
|
||||
<div class="small-text mt-1 mb-3">
|
||||
Manage your current subscription.
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-title mb-3">Current Plan</div>
|
||||
|
||||
{% if current_user.get_subscription() %}
|
||||
You are on the {{ current_user.get_subscription().plan_name() }} plan. <br>
|
||||
<a href="{{ url_for('dashboard.billing') }}" class="btn btn-outline-primary">
|
||||
Manage Billing
|
||||
Manage Subscription
|
||||
</a>
|
||||
</div>
|
||||
</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>
|
||||
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
|
|
|
@ -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,
|
||||
)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue