| {% extends 'menus/user_base.html' %}

| {% if current_user.has_role('demo') %}
| {% set subscription = 'demo' %}
| {% elif current_user.has_cap('subscriber') %}
| {% set subscription = 'subscriber' %}
| {% else %}
| {% set subscription = 'none' %}
| {% endif %}

| {% block menu_avatar %}
a.navbar-item.dropdown-toggle(href="#", data-toggle="dropdown", title="{{ current_user.email }}")
	img.gravatar(
	src="{{ current_user.gravatar }}",
	class="{{ subscription }}",
	alt="Avatar")
	.special(class="{{ subscription }}")
		| {% if subscription == 'subscriber' %}
		i.pi-check
		| {% elif subscription == 'demo' %}
		i.pi-heart-filled
		| {% else %}
		i.pi-attention
		| {% endif %}
| {% endblock menu_avatar %}


| {% block menu_list %}
li.subscription-status(class="{{ subscription }}")
	| {% if subscription == 'subscriber' %}
	a.navbar-item(
	href="{{url_for('settings.billing')}}"
	title="View subscription info")
		i.pi-grin
		span Your subscription is active!
	| {% elif subscription == 'demo' %}
	a.navbar-item(
	href="{{url_for('settings.billing')}}"
	title="View subscription info")
		i.pi-heart-filled
		span You have a free account.
	| {% elif current_user.has_cap('can-renew-subscription') %}
	a.navbar-item(target='_blank', href="/renew", title="Renew subscription")
		i.pi-heart
		span.info Your subscription is not active.
			span.renew Click here to renew.
	| {% else %}
	a.navbar-item(
	href="https://store.blender.org/product/membership/"
	title="Renew subscription")
		i.pi-unhappy
		span.info Your subscription is not active.
			span.renew Click here to renew.
	| {% endif %}

| {{ super() }}

li
	a.navbar-item(
	href="{{ url_for('settings.billing') }}"
	title="Billing")
		i.pi-credit-card
		| Subscription
| {% endblock menu_list %}
