{% load wagtailimages_tags wagtailcore_tags my %}
{% if request.user_agent.is_pc and value.bg_desktop %}
{% for media in value.bg_desktop %}
= 2 and not amp or forloop.counter0 > 0 and not amp %}data-src="{{ media.value.url }}"{% else %}style="background-image: url({{ media.value.url }})"{% endif %} {% elif media.block_type == 'image' %} {% image media.value width-1920 as img %} {% if block_num >= 2 and not amp or forloop.counter0 > 0 and not amp %}data-src="{{ img.url }}"{% else %}style="background-image: url({{ img.url }})"{% endif %} {% endif %} >
{% endfor %}
{% endif %} {% if not request.user_agent.is_pc and value.bg_mobile %}
{% for media in value.bg_mobile %}
= 2 and not amp or forloop.counter0 > 0 and not amp %}data-src="{{ media.value.url }}"{% else %}style="background-image: url({{ media.value.url }})"{% endif %} {% elif media.block_type == 'image' %} {% image media.value width-600 as img %} {% if block_num >= 2 and not amp or forloop.counter0 > 0 and not amp %}data-src="{{ img.url }}"{% else %}style="background-image: url({{ img.url }})"{% endif %} {% endif %} >
{% endfor %}
{% endif %}
{% block block_content %} {% endblock %}
{% comment %} {% if request.user_agent.is_pc %} {% if media %} {% if media.block_type == 'svg' %} {% if block_num >= 2 and not amp %}data-src="{{ media.value.url }}"{% else %}style="background-image: url({{ media.value.url }})"{% endif %} {% elif media.block_type == 'image' %} {% image media.value fill-1920x1080 as img %} {% if block_num >= 2 and not amp %}data-src="{{ img.url }}"{% else %}style="background-image: url({{ img.url }})"{% endif %} {% endif %} {% endif %} {% if value.bg_desktop|length > 1 %} data-bgslide='{% for media in value.bg_desktop %}"{% if media.block_type == 'svg' %}{{ media.value.url }}{% else %}{% image media.value fill-1920x1080 as img %}{{ img.url }}{% endif %}"{% if not forloop.last %},{% endif %}{% endfor %}' {% endif %} {% endif %} {% if not request.user_agent.is_pc %} {% for media in value.bg_mobile %} {% if media.block_type == 'svg' %} {% if block_num >= 2 and not amp %}data-src="{{ media.value.url }}"{% else %}style="background-image: url({{ media.value.url }})"{% endif %} {% elif media.block_type == 'image' %} {% image media.value fill-1920x1080 as img %} {% if block_num >= 2 and not amp %}data-src="{{ img.url }}"{% else %}style="background-image: url({{ img.url }})"{% endif %} {% endif %} {% endfor %} {% endif %}{% endcomment %}