macros.jinja 1.35 KB
Newer Older
Skia's avatar
Skia committed
1
2
3
{% macro user_profile_link(user) -%}
<a href="{{ url("core:user_profile", user_id=user.id) }}">{{ user.get_display_name() }}</a>
{%- endmacro %}
Skia's avatar
Skia committed
4
5
6
7
8
9
10
11
12
13
14
15
16

{% macro user_link_with_pict(user) -%}
<a href="{{ url("core:user_profile", user_id=user.id) }}" class="mini_profile_link" >
    <span>
    {% if user.profile_pict %}
    <img src="{{ user.profile_pict.get_download_url() }}" alt="{% trans %}Profile{% endtrans %}" />
    {% else %}
    <img src="{{ static('core/img/na.gif') }}" alt="{% trans %}Profile{% endtrans %}" />
    {% endif %}
    </span>
    <em>{{ user.get_display_name() }}</em>
    </a>
{%- endmacro %}
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37

{% macro user_mini_profile(user) %}
<div id="user_profile">
    <div id="pictures">
        {% if user.profile_pict %}
        <img src="{{ user.profile_pict.get_download_url() }}" alt="{% trans %}Profile{% endtrans %}" />
        {% endif %}
    </div>
    <p>{{ user.get_full_name() }}</p>
    {% if user.nick_name %}
    <p id="nickname">&laquo; {{ user.nick_name }} &raquo;</p>
    {% endif %}
    {% if user.date_of_birth %}
    <p>{% trans %}Born: {% endtrans %}{{ user.date_of_birth|date("d/m/Y") }}</p>
    {% endif %}
    {% if user.promo %}
    <p><img src="{{ static('core/img/promo_%02d.png' % user.promo) }}" alt="Promo {{ user.promo }}" class="promo_pict" />
    {% trans %}Promo: {% endtrans %}{{ user.promo }}</p>
    {% endif %}
</div>
{%- endmacro %}