Parent: [af0189] (diff)

Child: [dd6eef] (diff)

Download this file

lib.html    35 lines (34 with data), 1.5 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
{% macro gravatar(user, size) -%}
{% if user.preferences.email_address %}
{% if size %}
<img src="{{g.gravatar(user.preferences.email_address, default=g.url('/u/'+user.username.replace('_', '-')+'/user_icon'))}}"
alt="{{user.display_name}}"
title="{{user.display_name}}"
height="{{size}}"
width="{{size}}"/>
{% else %}
<img src="{{g.gravatar(user.preferences.email_address, default=g.url('/u/'+user.username.replace('_', '-')+'/user_icon'))}}"
alt="{{user.display_name}}"
title="{{user.display_name}}"/>
{% endif %}
{% else %}
{% if size %}
<img src="{{'/u/'+user.username.replace('_', '-')+'/user_icon'}}"
alt="{{user.display_name}}"
title="{{user.display_name}}"
height="{{size}}"
width="{{size}}"/>
{% else %}
<img src="{{'/u/'+user.username.replace('_', '-')+'/user_icon'}}"
alt="{{user.display_name}}"
title="{{user.display_name}}"/>
{% endif %}
{% endif %}
{%- endmacro %}
{% macro email_gravatar(email, title=None, size=None) -%}
{% if email %}
<img src="{{g.gravatar(email, size=size)}}" alt="{{title or email}}" title="{{title or email}}"{% if size %} width="{{size}}" height="{{size}}"{% endif %}/>
{% else %}
<img src="{{g.forge_static('images/user.png')}}" alt="{{title}}" title="{{title}}"{% if size %} width="{{size}}" height="{{size}}"{% endif %}/>
{% endif %}
{%- endmacro %}