{% 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 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.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_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) %} {# Add pagination buttons for pages without Alpine. This must be coupled with a view that handles pagination with the Django Paginator object. Parameters: current_page (django.core.paginator.Page): the current page object paginator (django.core.paginator.Paginator): the paginator object #} {{ paginate_server_side(current_page, paginator, False) }} {% endmacro %} {% macro paginate_htmx(current_page, paginator) %} {# Add pagination buttons for pages without Alpine but supporting fragments. This must be coupled with a view that handles pagination with the Django Paginator object and supports fragments. The replaced fragment will be #content so make sure you are calling this macro inside your content block. Parameters: current_page (django.core.paginator.Page): the current page object paginator (django.core.paginator.Paginator): the paginator object #} {{ paginate_server_side(current_page, paginator, True) }} {% endmacro %} {% macro paginate_server_side(current_page, paginator, use_htmx) %} {% endmacro %} {% macro select_all_checkbox(form_id) %} {% endmacro %}