{% extends "core/base.jinja" %} {% from "core/macros.jinja" import show_slots, show_tokens, user_subscription %} {%- block additional_css -%} {%- endblock -%} {% block title %} {% trans user_name=profile.get_display_name() %}{{ user_name }}'s profile{% endtrans %} {% endblock %} {% block additional_js %} {% endblock %} {% block content %}

{{ profile.get_full_name() }}

{% if profile.nick_name %} {% endif %}
{% if user == profile or user.memberships.ongoing().exists() or user.is_board_member or user.is_in_group(name=settings.SITH_BAR_MANAGER_BOARD_GROUP) %} {# if the user is member of a club, he can view the subscription state #}
{% if profile.is_subscribed %} {% if user == profile or user.is_root or user.is_board_member %}
{{ user_subscription(profile) }}
{% endif %} {% if user == profile or user.is_root or user.is_board_member or user.is_launderette_manager %}
{# Shows tokens bought by the user #} {{ show_tokens(profile) }} {# Shows slots took by the user #} {{ show_slots(profile) }}
{% endif %} {% else %}
{% trans %}Not subscribed{% endtrans %} {% if user.is_board_member %} {% trans %}New subscription{% endtrans %} {% endif %} {% endif %}
{% endif %}
{% if profile.was_subscribed and (user == profile or user.can_read_subscription_history)%}
{% trans %}Subscription history{% endtrans %}
{% for sub in profile.subscriptions.all() %} {% endfor %}
{% trans %}Subscription start{% endtrans %} {% trans %}Subscription end{% endtrans %} {% trans %}Subscription type{% endtrans %} {% trans %}Payment method{% endtrans %}
{{ sub.subscription_start }} {{ sub.subscription_end }} {{ sub.subscription_type }} {{ sub.get_payment_method_display() }}
{% endif %}
{% if user.is_root or user.is_board_member %}
{% csrf_token %} {{ gift_form.label }} {{ gift_form.user }}
{% if profile.gifts.exists() %} {% set gifts = profile.gifts.order_by("-date")|list %}
{% trans %}Last given gift :{% endtrans %} {{ gifts[0] }}
    {% for gift in gifts %}
  • {{ gift }}
  • {% endfor %}
{% else %} {% trans %}No gift given yet{% endtrans %} {% endif %}
{% endif %}
{% endblock %} {% block script %} {{ super() }} {% endblock %}