Use Jinja2 inheritance to render user settings pages.
This requires Pillar e55d38261b36756a2850716a453c08c9ee6be9e2 or newer.
This commit is contained in:
@@ -1,20 +0,0 @@
|
|||||||
#settings-sidebar
|
|
||||||
.settings-header
|
|
||||||
.settings-title Settings
|
|
||||||
.settings-content
|
|
||||||
ul
|
|
||||||
a(class="{% if title == 'profile' %}active{% endif %}",
|
|
||||||
href="{{ url_for('settings.profile') }}")
|
|
||||||
li
|
|
||||||
i.pi-vcard
|
|
||||||
| Profile
|
|
||||||
a(class="{% if title == 'emails' %}active{% endif %}",
|
|
||||||
href="{{ url_for('settings.emails') }}")
|
|
||||||
li
|
|
||||||
i.pi-email
|
|
||||||
| Emails
|
|
||||||
a(class="{% if title == 'billing' %}active{% endif %}",
|
|
||||||
href="{{ url_for('settings.billing') }}")
|
|
||||||
li
|
|
||||||
i.pi-credit-card
|
|
||||||
| Subscription
|
|
@@ -1,62 +1,58 @@
|
|||||||
| {% extends 'layout.html' %}
|
| {% extends 'users/settings/page.html' %}
|
||||||
| {% block head %}
|
| {% block head %}
|
||||||
|
| {{ super() }}
|
||||||
style(type='text/css').
|
style(type='text/css').
|
||||||
button#recheck_subscription {
|
button#recheck_subscription {
|
||||||
margin-top: 1em;
|
margin-top: 1em;
|
||||||
}
|
}
|
||||||
| {% endblock %}
|
| {% endblock %}
|
||||||
| {% block body %}
|
|
||||||
|
| {% block settings_page_title %}Subscription{% endblock %}
|
||||||
|
| {% block settings_page_content %}
|
||||||
| {% set renew_url = url_for('cloud.renew_subscription') %}
|
| {% set renew_url = url_for('cloud.renew_subscription') %}
|
||||||
.container
|
| {% if current_user.has_cap('can-renew-subscription') %}
|
||||||
#settings
|
| {% if current_user.has_cap('subscriber') %}
|
||||||
| {% include 'users/settings/_sidebar.html'%}
|
h3.subscription-active
|
||||||
#settings-container
|
i.pi-check
|
||||||
.settings-header
|
| Your subscription is active
|
||||||
.settings-title Subscription
|
h4 Thank you for supporting us!
|
||||||
|
hr
|
||||||
|
p Subscription expires on: <strong>{{ expiration_date }}</strong>
|
||||||
|
| {% else %}
|
||||||
|
h3.subscription-missing
|
||||||
|
i.pi-info
|
||||||
|
a(href="{{renew_url}}") Your subscription can be renewed
|
||||||
|
hr
|
||||||
|
p.text-danger Subscription expired on: <strong>{{ expiration_date }}</strong>
|
||||||
|
p
|
||||||
|
a.btn.btn-success(href="{{renew_url}}") Renew now
|
||||||
|
| {% endif %}
|
||||||
|
|
||||||
.settings-content
|
p
|
||||||
| {% if current_user.has_cap('can-renew-subscription') %}
|
a(href="{{ config['EXTERNAL_SUBSCRIPTIONS_MANAGEMENT_SERVER'] | urljoin('my-account/subscriptions/') }}") Manage your subscription on Blender Store
|
||||||
| {% 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: <strong>{{ expiration_date }}</strong>
|
|
||||||
| {% else %}
|
|
||||||
h3.subscription-missing
|
|
||||||
i.pi-info
|
|
||||||
a(href="{{renew_url}}") Your subscription can be renewed
|
|
||||||
hr
|
|
||||||
p.text-danger Subscription expired on: <strong>{{ expiration_date }}</strong>
|
|
||||||
p
|
|
||||||
a.btn.btn-success(href="{{renew_url}}") Renew now
|
|
||||||
| {% endif %}
|
|
||||||
|
|
||||||
p
|
| {% elif 'demo' in groups %}
|
||||||
a(href="{{ config['EXTERNAL_SUBSCRIPTIONS_MANAGEMENT_SERVER'] | urljoin('my-account/subscriptions/') }}") Manage your subscription on Blender Store
|
h3.subscription-demo
|
||||||
|
i.pi-heart-filled
|
||||||
|
| You have a free account
|
||||||
|
|
||||||
| {% elif 'demo' in groups %}
|
hr
|
||||||
h3.subscription-demo
|
|
||||||
i.pi-heart-filled
|
|
||||||
| You have a free account
|
|
||||||
|
|
||||||
hr
|
p You have full access to the Blender Cloud, provided by the Blender Institute. This account is meant for free evaluation of the service. Get in touch with #[a(href="mailto:cloudsupport@blender.org") cloudsupport@blender.org] if you have any questions.
|
||||||
|
|
||||||
p You have full access to the Blender Cloud, provided by the Blender Institute. This account is meant for free evaluation of the service. Get in touch with #[a(href="mailto:cloudsupport@blender.org") cloudsupport@blender.org] if you have any questions.
|
| {% else %}
|
||||||
|
h3.subscription-missing
|
||||||
|
i.pi-info
|
||||||
|
| You do not have an active subscription.
|
||||||
|
h3
|
||||||
|
a(href="https://store.blender.org/product/membership/") Get full access to Blender Cloud now!
|
||||||
|
| {% endif %}
|
||||||
|
|
||||||
| {% else %}
|
hr
|
||||||
h3.subscription-missing
|
p
|
||||||
i.pi-info
|
button#recheck_subscription.btn.btn-default(onclick="javascript:recheck_subscription(this)") Re-check my subscription
|
||||||
| You do not have an active subscription.
|
|
||||||
h3
|
|
||||||
a(href="https://store.blender.org/product/membership/") Get full access to Blender Cloud now!
|
|
||||||
| {% endif %}
|
|
||||||
|
|
||||||
hr
|
|
||||||
p
|
|
||||||
button#recheck_subscription.btn.btn-default(onclick="javascript:recheck_subscription(this)") Re-check my subscription
|
|
||||||
|
|
||||||
|
hr
|
||||||
|
|
||||||
script.
|
script.
|
||||||
function recheck_subscription(button) {
|
function recheck_subscription(button) {
|
||||||
|
@@ -1,27 +1,17 @@
|
|||||||
| {% extends 'layout.html' %}
|
| {% extends 'users/settings/page.html' %}
|
||||||
| {% block body %}
|
| {% block settings_page_title %}Emails{% endblock %}
|
||||||
.container
|
| {% block settings_page_content %}
|
||||||
#settings
|
.settings-form
|
||||||
| {% include 'users/settings/_sidebar.html'%}
|
form#settings-form(method='POST', action="{{url_for('settings.emails')}}")
|
||||||
#settings-container
|
| {{ form.csrf_token }}
|
||||||
.settings-header
|
| {% for subfield in form.email_communications %}
|
||||||
.settings-title Emails
|
.form-group.
|
||||||
|
{{ subfield }}
|
||||||
.settings-content
|
{{ subfield.label }}
|
||||||
|
| {% endfor %}
|
||||||
.settings-form
|
|
||||||
form#settings-form(method='POST', action="{{url_for('settings.emails')}}")
|
|
||||||
| {{ form.csrf_token }}
|
|
||||||
| {% for subfield in form.email_communications %}
|
|
||||||
.form-group.
|
|
||||||
{{ subfield }}
|
|
||||||
{{ subfield.label }}
|
|
||||||
| {% endfor %}
|
|
||||||
|
|
||||||
.buttons
|
|
||||||
button.btn.btn-default.button-submit(type='submit')
|
|
||||||
i.pi-check
|
|
||||||
| Save Changes
|
|
||||||
|
|
||||||
|
|
||||||
|
.buttons
|
||||||
|
button.btn.btn-default.button-submit(type='submit')
|
||||||
|
i.pi-check
|
||||||
|
| Save Changes
|
||||||
| {% endblock %}
|
| {% endblock %}
|
||||||
|
14
src/templates/users/settings/page.pug
Normal file
14
src/templates/users/settings/page.pug
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
| {% extends 'users/settings/base.html' %}
|
||||||
|
| {% block settings_sidebar_menu %}
|
||||||
|
| {{ super() }}
|
||||||
|
a(class="{% if title == 'emails' %}active{% endif %}",
|
||||||
|
href="{{ url_for('settings.emails') }}")
|
||||||
|
li
|
||||||
|
i.pi-email
|
||||||
|
| Emails
|
||||||
|
a(class="{% if title == 'billing' %}active{% endif %}",
|
||||||
|
href="{{ url_for('settings.billing') }}")
|
||||||
|
li
|
||||||
|
i.pi-credit-card
|
||||||
|
| Subscription
|
||||||
|
| {% endblock %}
|
Reference in New Issue
Block a user