{% import 'macros/form.html' as f with context %} {% if request.endpoint.endswith('new') %} {% set endpoint = 'admin.users_new' %} {% set form_kwargs = {} %} {% set legend = 'Add a new user' %} {% set button = 'Add' %} {% else %} {% set endpoint = 'admin.users_edit' %} {% set form_kwargs = {'id': user.id} %} {% set legend = 'Update this user' %} {% set button = 'Save' %} {% endif %}
{% call f.form_tag(endpoint, **form_kwargs) %}

{{ legend }}

{{ user.email }}

{% if user.last_bet_on %} {% else %} N/A {% endif %}

{% call f.form_group(form.coins, autofocus='autofocus') %}{% endcall %} {% call f.form_group(form.username) %}{% endcall %} {% call f.form_group(form.role) %}{% endcall %} {% call f.form_group(form.active) %}{% endcall %}
{% endcall %}

Billing details

{% if user.subscription and user.credit_card %}
Subscribed
( View billing details )
Plan
{{ user.subscription.plan | title }} {% if user.subscription.coupon %} (coupon: {{ user.subscription.coupon }}) {% endif %}
Credit card
{{ user.name }}
{{ user.credit_card.brand }} {{ user.credit_card.last4 }} ({{ user.credit_card.exp_date.strftime('%m/%Y') }})
{% call f.form_tag('admin.users_cancel_subscription') %} {% endcall %} {% else %} {% if user.cancelled_subscription_on %}
Cancelled
{% if user.invoices %} ( View billing details ) {% endif %}
{% else %}

This user is not subscribed. {% if user.invoices %} ( View billing details ) {% endif %}

{% endif %} {% endif %}

Login activity

Sign in count
{{ user.sign_in_count }}
Current sign in date
{% if user.current_sign_in_on %} {% endif %}
Current sign in IP address
{{ user.current_sign_in_ip }}
Previous sign in date
{% if user.last_sign_in_on %} {% endif %}
Previous sign in IP address
{{ user.last_sign_in_ip }}