{% from "_macros/stars.html" import stars %} {% from "_macros/market_button.html" import market_button %} {% macro preview_tray(app, src) %}
{% for preview in app.previews %} {% endfor %}
{% endmacro %} {% macro market_tile(app, link=False, src=None, classes=None, data_attrs=None, tray=True, description=False) %} {% set tag = 'a' if link and app.slug else 'div' %} {% set classes = classes or [] %} <{{ tag }} class="product mkt-tile {{ classes|join(' ') }}" {% if link %} href="{{ app.url or url('app', [app.slug])|urlparams(src=src) }}"{% endif %} {{ data_attrs|make_data_attrs }} data-slug="{{ app.slug }}" data-id="{{ app.id }}" {% if link %}itemscope itemtype="http://schema.org/SoftwareApplication"{% endif %}> {% if not imgAlreadyDeferred(app.icons['64']) %} {# Defer image loading. #} {% else %} {% endif %}

{{ app.name|translate(app) }}

{% if app.author %} {# TODO: When we get user profiles, update this to be a proper Person itemprop #}
{{ app.author }}
{% endif %} {% if app.content_ratings.rating %}
{% if app.content_ratings.body != 'generic' %} {# L10n: the IARC rating body/system followed by a name/description of the rating (e.g. "ESRB: Everyone" or "PEGI: For ages 3+"). #} {{ _('{rating_body}: {rating}', rating_body=iarc_names.bodies[app.content_ratings.body], rating=iarc_names.ratings[app.content_ratings.body][app.content_ratings.rating]) }} {% else %} {# Don't show "Generic:" as the body since that doesn't mean much. #} {{ iarc_names.ratings[app.content_ratings.body][app.content_ratings.rating] }} {% endif %}
{% endif %}
{{ app.price_locale if app.payment_required else _('Free') }}
{% if not link %} {% endif %} {{ stars(app.ratings.average) }} {% if app.ratings.count %} {{ _('({n})', n='' + app.ratings.count + '') }} {{ _plural('{n} Review', '{n} Reviews', n=app.ratings.count) }} {% else %} {# L10n: "(0)" means "0 reviews." #} {{ _('(0)') }} {{ _('Not yet rated') }} {% endif %} {% if not link %}{% endif %}
{{ market_button(app, classes=(['paid'] if app.payment_required), data_attrs={'manifest_url': app.manifest_url, 'slug': app.slug}) if app.slug }}
{% for notice in app_incompat(app) %}
{{ notice }}
{% endfor %} {% if description %} {{ app.description|translate(app)|summarise('market-tile-description', false)|safe }} {% endif %} {% if tray and len(app.previews) %}
{{ preview_tray(app, src) }}
{% endif %} {% endmacro %}