Added /renew endpoint to redirect to Blender Store renewal URL.
This commit is contained in:
@@ -187,6 +187,11 @@ def join():
|
|||||||
return redirect('https://store.blender.org/product/membership/')
|
return redirect('https://store.blender.org/product/membership/')
|
||||||
|
|
||||||
|
|
||||||
|
@blueprint.route('/renew')
|
||||||
|
def renew_subscription():
|
||||||
|
return render_template('renew_subscription.html')
|
||||||
|
|
||||||
|
|
||||||
def get_projects(category):
|
def get_projects(category):
|
||||||
"""Utility to get projects based on category. Should be moved on the API
|
"""Utility to get projects based on category. Should be moved on the API
|
||||||
and improved with more extensive filtering capabilities.
|
and improved with more extensive filtering capabilities.
|
||||||
|
28
src/templates/renew_subscription.pug
Normal file
28
src/templates/renew_subscription.pug
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
| {% extends "errors/layout.html" %}
|
||||||
|
| {% block title %}Renew | Blender Cloud{% endblock %}
|
||||||
|
| {% block head %}
|
||||||
|
noscript
|
||||||
|
meta(http-equiv="refresh", content="2; url=https://store.blender.org/renew-my-subscription.php")
|
||||||
|
| {% endblock %}
|
||||||
|
| {% block body %}
|
||||||
|
#error-container(class="error-404")
|
||||||
|
#error-box
|
||||||
|
.error-top-container
|
||||||
|
.error-title
|
||||||
|
i.pi-heart
|
||||||
|
| Renew your Blender Cloud subscription
|
||||||
|
.error-lead
|
||||||
|
p
|
||||||
|
='You are being forwarded to '
|
||||||
|
a(href='https://store.blender.org/renew-my-subscription.php') the Blender Store
|
||||||
|
=' to renew your subscription.'
|
||||||
|
|
||||||
|
.error-lead.extra
|
||||||
|
p
|
||||||
|
="If you aren't forwarded in a few seconds, use "
|
||||||
|
a(href="https://store.blender.org/renew-my-subscription.php") this direct link
|
||||||
|
=' instead.'
|
||||||
|
script.
|
||||||
|
// Use replace() so that the back button doesn't even visit this page.
|
||||||
|
window.location.replace('https://store.blender.org/renew-my-subscription.php');
|
||||||
|
| {% endblock %}
|
@@ -6,6 +6,7 @@ style(type='text/css').
|
|||||||
}
|
}
|
||||||
| {% endblock %}
|
| {% endblock %}
|
||||||
| {% block body %}
|
| {% block body %}
|
||||||
|
| {% set renew_url = url_for('cloud.renew_subscription') %}
|
||||||
.container
|
.container
|
||||||
#settings
|
#settings
|
||||||
| {% include 'users/settings/_sidebar.html'%}
|
| {% include 'users/settings/_sidebar.html'%}
|
||||||
@@ -15,19 +16,28 @@ style(type='text/css').
|
|||||||
|
|
||||||
.settings-content
|
.settings-content
|
||||||
|
|
||||||
| {% if current_user.has_role('subscriber') %}
|
| {% if current_user.has_cap('has-subscription') %}
|
||||||
|
| {% if current_user.has_cap('subscriber') %}
|
||||||
h3.subscription-active
|
h3.subscription-active
|
||||||
i.pi-check
|
i.pi-check
|
||||||
| Your subscription is active
|
| Your subscription is active
|
||||||
h4 Thank you for supporting us!
|
h4 Thank you for supporting us!
|
||||||
|
|
||||||
hr
|
hr
|
||||||
|
|
||||||
p Subscription expires on: <strong>{{ store_user['expiration_date'][:10] }}</strong>
|
p Subscription expires on: <strong>{{ store_user['expiration_date'][:10] }}</strong>
|
||||||
a(href="https://store.blender.org/my-account/subscriptions/") Manage your subscription on Blender Store
|
|
||||||
| {% else %}
|
| {% else %}
|
||||||
|
h3.subscription-missing
|
||||||
|
i.pi-info
|
||||||
|
a(href="{{renew_url}}") Your subscription can be renewed
|
||||||
|
hr
|
||||||
|
p.text-danger Subscription expired on: <strong>{{ store_user['expiration_date'][:10] }}</strong>
|
||||||
|
p
|
||||||
|
a.btn.btn-success(href="{{renew_url}}") Renew now
|
||||||
|
| {% endif %}
|
||||||
|
|
||||||
| {% if 'demo' in groups %}
|
p
|
||||||
|
a(href="https://store.blender.org/my-account/subscriptions/") Manage your subscription on Blender Store
|
||||||
|
|
||||||
|
| {% elif 'demo' in groups %}
|
||||||
h3.subscription-demo
|
h3.subscription-demo
|
||||||
i.pi-heart-filled
|
i.pi-heart-filled
|
||||||
| You have a free account
|
| You have a free account
|
||||||
@@ -44,11 +54,9 @@ style(type='text/css').
|
|||||||
a(href="https://store.blender.org/product/membership/") Get full access to Blender Cloud now!
|
a(href="https://store.blender.org/product/membership/") Get full access to Blender Cloud now!
|
||||||
| {% endif %}
|
| {% endif %}
|
||||||
|
|
||||||
| {% endif %}
|
hr
|
||||||
|
|
||||||
p
|
p
|
||||||
button#recheck_subscription.btn.btn-default(onclick="javascript:recheck_subscription(this)") Re-check my subscription
|
button#recheck_subscription.btn.btn-default(onclick="javascript:recheck_subscription(this)") Re-check my subscription
|
||||||
hr
|
|
||||||
|
|
||||||
|
|
||||||
script.
|
script.
|
||||||
|
Reference in New Issue
Block a user