2016-07-27 15:23:02 +00:00
{% macro user_profile_link ( user ) -%}
<a href=" {{ url ( "core:user_profile" , user_id = user .id ) }} "> {{ user .get_display_name ( ) }} </a>
{% - endmacro %}
2016-08-19 00:53:44 +00:00
2017-05-31 21:56:47 +00:00
{% macro user_profile_link_short_name ( user ) -%}
<a href=" {{ url ( "core:user_profile" , user_id = user .id ) }} "> {{ user .get_short_name ( ) }} </a>
{% - endmacro %}
2016-08-19 00:53:44 +00:00
{% macro user_link_with_pict ( user ) -%}
<a href=" {{ url ( "core:user_profile" , user_id = user .id ) }} " class="mini_profile_link" >
2016-08-20 00:55:48 +00:00
{{ user .get_mini_item ( ) | safe }}
</a>
2016-08-19 00:53:44 +00:00
{% - endmacro %}
2016-08-19 21:24:23 +00:00
2017-09-29 15:18:06 +00:00
{% 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 ) -%}
<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content=" {{ settings .SITH_TWITTER }} " />
<meta name="twitter:creator" content= " {{ settings .SITH_TWITTER }} " />
<meta property="og:url" content=" {{ news .get_full_url ( ) }} " />
<meta property="og:type" content="article" />
<meta property="og:title" content=" {{ news .title }} " />
<meta property="og:description" content=" {{ news .summary }} " />
<meta property="og:image" content=" {{ "https://%s%s" % ( settings .SITH_URL , link_news_logo ( news ) ) }} " />
{% - endmacro %}
2017-09-12 14:40:28 +00:00
{% macro facebook_share ( news ) -%}
2017-09-29 15:18:06 +00:00
<a rel="nofollow" target="#" class="share_button facebook" href="https://www.facebook.com/sharer/sharer.php?u= {{ news .get_full_url ( ) }} "> {% trans %} Share on Facebook {% endtrans %} </a>
2017-09-12 17:11:52 +00:00
{% - endmacro %}
{% macro tweet ( news ) -%}
2017-09-29 15:18:06 +00:00
<a rel="nofollow" target="#" class="share_button twitter" href="https://twitter.com/intent/tweet?text= {{ news .get_full_url ( ) }} "> {% trans %} Tweet {% endtrans %} </a>
{% - endmacro %}
{% macro fb_quick ( news ) -%}
<a rel="nofollow" target="#" href="https://www.facebook.com/sharer/sharer.php?u= {{ news .get_full_url ( ) }} " class="fb fa fa-facebook-square fa-2x"></a>
{% - endmacro %}
{% macro tweet_quick ( news ) -%}
<a rel="nofollow" target="#" href="https://twitter.com/intent/tweet?text= {{ news .get_full_url ( ) }} " class="twitter fa fa-twitter-square fa-2x"></a>
2017-09-12 14:40:28 +00:00
{% - endmacro %}
2016-08-19 21:24:23 +00:00
{% macro user_mini_profile ( user ) %}
2018-06-05 22:25:27 +00:00
<div class="user_mini_profile">
<div class="user_mini_profile_infos">
<div class="user_mini_profile_infos_text">
<div class="user_mini_profile_name"> {{ user .get_full_name ( ) }} </div>
{% if user .nick_name %}
<div class="user_mini_profile_nick">« {{ user .nick_name }} »</div>
{% endif %}
{% if user .date_of_birth %}
<div class="user_mini_profile_dob">
{{ user .date_of_birth | date ( "d/m/Y" ) }} ( {{ user .get_age ( ) }} )
</div>
2016-08-20 11:57:27 +00:00
{% endif %}
</div>
{% if user .promo %}
2018-06-05 22:25:27 +00:00
<div class="user_mini_profile_promo">
<img src=" {{ static ( 'core/img/promo_%02d.png' % user .promo ) }} " title="Promo {{ user .promo }} " alt="Promo {{ user .promo }} " class="promo_pict" />
</div>
2016-08-19 21:24:23 +00:00
{% endif %}
</div>
2018-06-05 22:25:27 +00:00
<div class="user_mini_profile_picture">
{% if user .profile_pict %}
<img src=" {{ user .profile_pict .get_download_url ( ) }} " alt=" {% trans %} Profile {% endtrans %} " />
{% else %}
<img src=" {{ static ( 'core/img/unknown.jpg' ) }} " alt=" {% trans %} Profile {% endtrans %} "
title=" {% trans %} Profile {% endtrans %} " />
{% endif %}
</div>
2016-08-19 21:24:23 +00:00
</div>
{% - endmacro %}
2016-09-07 21:06:38 +00:00
2016-10-08 21:07:10 +00:00
{% macro user_subscription ( user ) %}
2017-10-24 11:08:18 +00:00
{% trans subscription_end = user .subscriptions .order_by ( 'subscription_end' ) .last ( ) .subscription_end %} Subscribed until {{ subscription_end }} {% endtrans %} <br/>
2016-10-08 21:07:10 +00:00
{% trans %} Account number: {% endtrans %} {{ user .customer .account_id }} <br/>
{% - endmacro %}
2016-09-07 21:06:38 +00:00
{% macro show_slots ( user ) %}
2016-12-10 00:58:30 +00:00
{% if user .slots .filter ( start_date__gte = timezone .now ( ) ) .exists ( ) %}
2016-09-07 21:06:38 +00:00
<h5> {% trans %} Slot {% endtrans %} </h5>
<ul>
2016-12-10 00:58:30 +00:00
{% for i in user .slots .filter ( start_date__gte = timezone .now ( ) .replace ( tzinfo = None ) ) .all ( ) %}
2016-12-15 15:11:43 +00:00
<li> {{ i .get_type_display ( ) }} - {{ i .machine .launderette }} , {{ i .start_date | date ( "l j" ) }} :
{{ i .start_date | time ( DATETIME_FORMAT ) }} |
<a href=" {{ url ( 'launderette:delete_slot' , slot_id = i .id ) }} "> {% trans %} Delete {% endtrans %} </a></li>
2016-09-07 21:06:38 +00:00
{% endfor %}
</ul>
{% endif %}
{% endmacro %}
{% macro show_tokens ( user ) %}
2016-12-10 00:58:30 +00:00
{% if user .tokens .exists ( ) %}
2016-09-07 21:06:38 +00:00
<h5> {% trans %} Tokens {% endtrans %} </h5>
<ul>
2016-12-10 00:58:30 +00:00
{% for i in user .tokens .all ( ) %}
2016-09-07 21:06:38 +00:00
<li> {{ i }} </li>
{% endfor %}
</ul>
{% endif %}
2016-09-11 17:00:12 +00:00
{% endmacro %}
2016-09-29 13:04:43 +00:00
{% macro delete_godfather ( user , profile , godfather , is_father ) %}
{% if user == profile or user .is_root or user .is_board_member %}
<a href=" {{ url ( "core:user_godfathers_delete" , user_id = profile .id , godfather_id = godfather .id , is_father = is_father ) }} "> {% trans %} Delete {% endtrans %} </a>
{% endif %}
2016-12-10 00:58:30 +00:00
{% endmacro %}
2017-06-07 14:43:50 +00:00
{% macro paginate ( page_obj , paginator ) %}
{% if page_obj .has_previous ( ) %}
<a href="?page= {{ page_obj .previous_page_number ( ) }} "> {% trans %} Previous {% endtrans %} </a>
{% else %}
<span class="disabled"> {% trans %} Previous {% endtrans %} </span>
{% endif %}
{% for i in paginator .page_range %}
{% if page_obj .number == i %}
<span class="active"> {{ i }} <span class="sr-only">( {% trans %} current {% endtrans %} )</span></span>
{% else %}
<a href="?page= {{ i }} "> {{ i }} </a>
{% endif %}
{% endfor %}
{% if page_obj .has_next ( ) %}
<a href="?page= {{ page_obj .next_page_number ( ) }} "> {% trans %} Next {% endtrans %} </a>
{% else %}
<span class="disabled"> {% trans %} Next {% endtrans %} </span>
{% endif %}
2017-10-01 18:52:29 +00:00
{% endmacro %}