{% extends "base.html" %} {% block content %}

{{ page.title }}

Species: {{ page.species }}
Generated at: {{ page.generated_at }}


{% for sec in sections %}

{{ sec.id }}. {{ sec.title }}

{# Loop over each block in this section #} {% for b in sec.blocks %} {% if b.type == "text" %}

{{ b.text.title }}

{% if b.text.as_markdown %} {{ b.text.content | safe }} {% else %}
{{ b.text.content }}
{% endif %}
{% elif b.type == "figure" %}
{% set ext = b.href.split('.')[-1]|lower %} {% if ext in ['png','jpg','jpeg','svg'] %} {{ b.label }} {% elif ext == 'pdf' %}

PDF preview unavailable: {{ b.label }}

{% endif %}
{{ b.label }}
{% elif b.type == "table" %}

{{ b.table.title }}

{% for h in b.table.headers %} {% endfor %} {% for r in b.table.rows %} {% for c in r %} {% endfor %} {% endfor %}
{{ h }}
{{ c }}
{% elif b.type == "kpi" %}

{{ b.kpi.title or 'Key performance indicators' }}

{% endif %} {% endfor %} {# render subsections recursively if present #} {% if sec.subsections %} {% for sub in sec.subsections %}

{{ sub.id }} {{ sub.title }}

{% for b in sub.blocks %} {% if b.type == "figure" %}
{% set ext = b.href.split('.')[-1]|lower %} {% if ext in ['png','jpg','jpeg','svg'] %} {{ b.label }} {% elif ext == 'pdf' %}

PDF preview unavailable: {{ b.label }}

{% endif %}
{{ b.label }}
{% elif b.type == "table" %}

{{ b.table.title }}

{% for h in b.table.headers %} {% endfor %} {% for r in b.table.rows %} {% for c in r %} {% endfor %} {% endfor %}
{{ h }}
{{ c }}
{% elif b.type == "text" %}
{{ b.text.content }}
{% endif %} {% endfor %}
{% endfor %} {% endif %}

{% endfor %}
{% endblock %}