{% macro user_profile_link(user) -%} {{ user.get_display_name() }} {%- endmacro %} {% macro user_profile_link_short_name(user) -%} {{ user.get_short_name() }} {%- endmacro %} {% macro user_link_with_pict(user) -%} {{ user.get_mini_item()|safe }} {%- endmacro %} {% macro link_news_logo(news) -%} {% if news.club.logo -%} {{ news.club.logo.url }} {% else -%} {{ static("com/img/news.png") }} {% endif %} {%- endmacro %} {% macro gen_news_metatags(news) -%} {%- endmacro %} {% macro facebook_share(news) -%} {% trans %}Share on Facebook{% endtrans %} {%- endmacro %} {% macro tweet(news) -%} {% trans %}Tweet{% endtrans %} {%- endmacro %} {% macro fb_quick(news) -%} {%- endmacro %} {% macro tweet_quick(news) -%} {%- endmacro %} {% macro user_mini_profile(user) %}
{{ user.get_full_name() }}
{% if user.nick_name %}
« {{ user.nick_name }} »
{% endif %} {% if user.pronouns %}
{{ user.pronouns }}
{% endif %} {% if user.date_of_birth %}
{{ user.date_of_birth|date("d/m/Y") }} ({{ user.get_age() }})
{% endif %}
{% if user.promo and user.promo_has_logo() %}
Promo {{ user.promo }}
{% endif %}
{% if user.profile_pict %} {% trans %}Profile{% endtrans %} {% else %} {% trans %}Profile{% endtrans %} {% endif %}
{%- endmacro %} {% macro user_subscription(user) %} {% trans subscription_end=user.subscriptions.order_by('subscription_end').last().subscription_end %}Subscribed until {{ subscription_end }}{% endtrans %}
{% trans %}Account number: {% endtrans %}{{ user.customer.account_id }}
{%- endmacro %} {% macro show_slots(user) %} {% if user.slots.filter(start_date__gte=timezone.now()).exists() %}
{% trans %}Slot{% endtrans %}
{% endif %} {% endmacro %} {% macro show_tokens(user) %} {% if user.tokens.exists() %}
{% trans %}Tokens{% endtrans %}
{% endif %} {% endmacro %} {% macro delete_godfather(user, profile, godfather, is_father) %} {% if user == profile or user.is_root or user.is_board_member %} {% trans %}Delete{% endtrans %} {% endif %} {% endmacro %} {% macro paginate_alpine(page, nb_pages) %} {# Add pagination buttons for ajax based content with alpine Notes: This can only be used in the scope of your alpine datastore Notes: You might need to listen to the "popstate" event in your code to update the current page you are on when the user goes back in it's browser history with the back arrow Parameters: page (str): name of the alpine page variable in your datastore nb_page (str): call to a javascript function or variable returning the maximum number of pages to paginate #} {% endmacro %} {% macro paginate_jinja(current_page, paginator) %} {% endmacro %} {% macro paginate(page_obj, paginator, js_action) %} {% set js = js_action|default('') %} {% if page_obj.has_previous() or page_obj.has_next() %} {% if page_obj.has_previous() %} {% trans %}Previous{% endtrans %} {% else %} {% trans %}Previous{% endtrans %} {% endif %} {% for i in paginator.page_range %} {% if page_obj.number == i %} {{ i }} ({% trans %}current{% endtrans %}) {% else %} {{ i }} {% endif %} {% endfor %} {% if page_obj.has_next() %} {% trans %}Next{% endtrans %} {% else %} {% trans %}Next{% endtrans %} {% endif %} {% endif %} {% endmacro %} {% macro select_all_checkbox(form_id) %} {% endmacro %}