{% macro vital(addon, type) %}
{% if type in ('updated', 'created') %} {% if type == 'updated' %} {# L10n: {0} is a date. #} {{ _('Updated {0}')|f(addon.last_updated|datetime) }} {% else %} {# L10n: {0} is a date. #} {{ _('Added {0}')|f(addon.created|datetime) }} {% endif %} {% elif type == 'rating' %} {{ impala_reviews_link(addon, link_to_list=True) }} {% elif type in ('downloads', 'adu') %} {% if type == 'downloads' %} {% trans cnt=addon.weekly_downloads, num=addon.weekly_downloads|numberfmt %} {{ num }} weekly download {% pluralize %} {{ num }} weekly downloads {% endtrans %} {% else %} {% set adu=addon.persona.popularity if addon.is_persona() else addon.average_daily_users %} {% trans cnt=adu, num=adu|numberfmt %} {{ num }} user {% pluralize %} {{ num }} users {% endtrans %} {% endif %} {% endif %}
{% endmacro %} {% macro addon_heading(addon, version) %} {{ addon.name }} {% if version %} {{ version.version }} {% endif %} {% endmacro %} {% macro sort_vital(addon, field) %} {% if field in ('popular', 'downloads') or not addon.show_adu() %}
{% with num=addon.weekly_downloads %} {# L10n: {0} is the number of downloads. #} {{ ngettext('{0} weekly download', '{0} weekly downloads', num)|f(num|numberfmt) }} {% endwith %}
{% else %}
{% with num=addon.average_daily_users %} {# L10n: {0} is the number of users. #} {{ ngettext('{0} user', '{0} users', num)|f(num|numberfmt) }} {% endwith %}
{% endif %} {% if field in ('created', 'updated') %}
{% if field == 'created' %} {# L10n: {0} is a date. #} {{ _('Added {0}')|f(addon.created|datetime) }} {% else %} {# L10n: {0} is a date. #} {{ _('Updated {0}')|f(addon.last_updated|datetime) }} {% endif %}
{% endif %} {% endmacro %}