{% defer (url=endpoint, pluck='content_ratings') %}
{% if this.rating %}
{{ _('Content Rating') }}
{# Content rating. #}
{# Content descriptors as a list of text.
Only shown if there are not any descriptor icons (i.e. non-PEGI bodies). #}
{% if this.descriptors and not iarc.descriptor_icons[this.body] %}
{% else %}
{# If not showing descriptor text, show the rating name to fill in space. #}
{{ iarc_names.ratings[this.body][this.rating] }}
{% endif %}
{% set desc_icons = iarc.descriptor_icons[this.body] %}
{% if desc_icons %}
{# Content descriptors as a grid of icons.
Only shown if there are descriptor icons (i.e. PEGI-only). #}
{% for descriptor in this.descriptors %}
{% set icon_src = desc_icons[descriptor] %}
{% if icon_src %}
{% endif %}
{% endfor %}
{% elif this.interactives %}
{% set interactive_icons = iarc.interactive_icons[this.body] %}
{% for interactive in this.interactives %}
{% if interactive_icons %}
{# Interactive elements as a row of icons (ESRB only). #}
{% set icon_src = interactive_icons[interactive] %}
{% if icon_src %}
{% endif %}
{% else %}
{# Interactive elements as a column of text (non-PEGI/ESRB bodies). #}