{% extends 'base.html' %} {% block meta %} {# TODO: For translated pages the following code generates: Function call 'get_section' failed, Section `` not found #} {# set latestStr = resource.subsections | sort | last #} {# set latestSection = get_section(path=latestStr) #} {# set latestPage = latestSection.pages | first #} {% set latestPage = section.pages | first %} {% endblock meta %} {% block content %}

{{ resource.title }}

{# Iterate and use en sections by default and use localized versions only if they are present #} {% set enNewsSectionTranslation = section.translations | filter(attribute='lang', value='en') | first %} {% set enNewsSection = get_section(path=enNewsSectionTranslation.path) %} {% for sectionStr in enNewsSection.subsections | sort | reverse %} {% set section = get_section(path=sectionStr) %} {% for page in section.pages %} {% set translatedPage = page.translations | filter(attribute='lang', value=lang) | first %} {% if translatedPage %} {# set page = get_page(path=translatedPage.path) #} {% endif %}
{# Display wide images below the text instead of to the right. #} {% set_global noflex = '' %} {% for photo in page.assets %} {% set meta = get_image_metadata(path=photo) %} {% if meta.width > meta.height %} {% set_global noflex = '_noflex' %} {% break %} {% endif %} {% endfor %} {% if page.assets %} {% for photo in page.assets | sort %} {% endfor %} {% else %} {% endif %} {% if page.title %}

{{ page.title | safe }}

{% endif %}
{{ page.date | date(format='%B %e, %Y') }}
{{ trans(key='news_title', lang=lang) }}
{% if page.description %}

{{ page.description | safe }}

{% endif %} {{ trans(key='more_title', lang=lang) }}
{% endfor %} {% endfor %}
{% endblock content %}