forked from mozilla/zamboni
/
macros.html
46 lines (44 loc) · 1.54 KB
/
macros.html
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
36
37
38
39
40
41
42
43
44
45
46
{% macro heading(addon, collection) %}
<h3>
{% if collection %}
{% set collection_path = "?src=collection&collection_id=" + collection.uuid %}
{% else %}
{% set collection_path = "" %}
{% endif %}
<a href="{{ addon.get_url_path() + collection_path }}">
<img class="icon" width="32" height="32" src="{{ addon.icon_url }}">
{{ addon.name }}</a>
<span>
{% trans users=users_list(addon.listed_authors, size=2) %}
by {{ users }}
{% endtrans %}
</span>
</h3>
{% endmacro %}
{% macro item_info(addon, amo, show_date, show_downloads=False) %}
{{ reviews_link(addon) }}
<p class="downloads">
{% if show_downloads or addon.type == amo.ADDON_SEARCH %}
{% with num=addon.weekly_downloads %}
{# L10n: {0} is the number of downloads. #}
{{ ngettext("<strong>{0}</strong> weekly download",
"<strong>{0}</strong> weekly downloads",
num)|f(num|numberfmt)|safe }}
{% endwith %}
{% else %}
{% with num=addon.average_daily_users %}
{# L10n: {0} is the number of users. #}
{{ ngettext("<strong>{0}</strong> user",
"<strong>{0}</strong> users",
num)|f(num|numberfmt)|safe }}
{% endwith %}
{% endif %}
</p>
<p class="updated">
{% if show_date in ['created', 'new', 'newest'] %}
{{ _('Added {0}')|f(addon.created|datetime) }}
{% elif show_date == 'updated' %}
{{ _('Updated {0}')|f(addon.last_updated|datetime) }}
{% endif %}
</p>
{% endmacro %}