{% 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) }} {{ price(addon) }} {% 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 %} {% trans cnt=addon.average_daily_users, num=addon.average_daily_users|numberfmt %} {{ num }} user {% pluralize %} {{ num }} users {% endtrans %} {% endif %} {% endif %}
{% endmacro %} {% macro addon_heading(addon, version) %} {{ addon.name }} {% if version and not addon.is_selfhosted() %} {{ version.version }} {% endif %} {% endmacro %} {% macro price(addon) %} {% if waffle.switch('marketplace') %} {% if not addon.is_free() %} {{ addon.premium.get_price_locale() }} {% else %} {{ _('FREE') }} {% endif %} {% endif %} {% endmacro %} {% macro refund_info(amo, addon, contributions) %} {% set contributions = contributions.get(addon.pk, []) %} {% if contributions %} {% 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 %}