diff --git a/cloud/routes.py b/cloud/routes.py
index 5006896..750e9c1 100644
--- a/cloud/routes.py
+++ b/cloud/routes.py
@@ -187,6 +187,11 @@ def join():
return redirect('https://store.blender.org/product/membership/')
+@blueprint.route('/renew')
+def renew_subscription():
+ return render_template('renew_subscription.html')
+
+
def get_projects(category):
"""Utility to get projects based on category. Should be moved on the API
and improved with more extensive filtering capabilities.
diff --git a/src/templates/renew_subscription.pug b/src/templates/renew_subscription.pug
new file mode 100644
index 0000000..d0a612c
--- /dev/null
+++ b/src/templates/renew_subscription.pug
@@ -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 %}
diff --git a/src/templates/users/settings/billing.pug b/src/templates/users/settings/billing.pug
index e1e5959..bd3c695 100644
--- a/src/templates/users/settings/billing.pug
+++ b/src/templates/users/settings/billing.pug
@@ -6,6 +6,7 @@ style(type='text/css').
}
| {% endblock %}
| {% block body %}
+| {% set renew_url = url_for('cloud.renew_subscription') %}
.container
#settings
| {% include 'users/settings/_sidebar.html'%}
@@ -15,19 +16,28 @@ style(type='text/css').
.settings-content
- | {% if current_user.has_role('subscriber') %}
+ | {% if current_user.has_cap('has-subscription') %}
+ | {% if current_user.has_cap('subscriber') %}
h3.subscription-active
i.pi-check
| Your subscription is active
h4 Thank you for supporting us!
-
hr
-
p Subscription expires on: {{ store_user['expiration_date'][:10] }}
- a(href="https://store.blender.org/my-account/subscriptions/") Manage your subscription on Blender Store
| {% else %}
+ h3.subscription-missing
+ i.pi-info
+ a(href="{{renew_url}}") Your subscription can be renewed
+ hr
+ p.text-danger Subscription expired on: {{ store_user['expiration_date'][:10] }}
+ 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
i.pi-heart-filled
| 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!
| {% endif %}
- | {% endif %}
-
+ hr
p
button#recheck_subscription.btn.btn-default(onclick="javascript:recheck_subscription(this)") Re-check my subscription
- hr
script.