~fabrixxm/activist

eeb99f190b7c61373498253f173dd33efc847f61 — fabrixxm a month ago d5d1866
ui: lazy load post imaages
M activist/templates/f/avatar.tpl.j2 => activist/templates/f/avatar.tpl.j2 +1 -1
@@ 10,7 10,7 @@
		{% if not actordata.icon %}data-initial="{{ actordata.name|initials }}"{% endif %} 
		title="{{ actordata.name }} - {{ actor|acct }}">
	{% if actordata.icon %}
		<img src="{{ actordata.icon.url }}" alt="{{ actordata.name}}'s avatar">
		<img src="{{ actordata.icon.url }}" alt="{{ actordata.name}}'s avatar" loading="lazy">
	{% endif %}
	</figure>
	</a>

M activist/templates/f/object-small.tpl.j2 => activist/templates/f/object-small.tpl.j2 +2 -2
@@ 20,14 20,14 @@
            {% set attachments = obj.data.attachment %}
            {% for a in attachments  %}
                {# TODO: check type and mediaType #}
                <img src="{{ a.url }}" class="img-responsive" title="{{ a.name|escape }}">
                <img src="{{ a.url }}" class="img-responsive" title="{{ a.name|escape }}" loading="lazy">
            {% endfor %}

        </div>

        {% if obj.data.url and obj.data.mediaType and obj.data.mediaType.startswith("image/") %}
        <div class="smaller-tile-image">
            <img src="{{ obj.data.url }}" class="img-responsive" title="{{ obj.data.name }}">
            <img src="{{ obj.data.url }}" class="img-responsive" title="{{ obj.data.name }}" loading="lazy">
        </div>
        {% endif %}


M activist/templates/f/object.tpl.j2 => activist/templates/f/object.tpl.j2 +2 -2
@@ 44,14 44,14 @@
		<div class="img-grid img-grid-{{acount}} img-grid-{{ 'odd' if isodd else 'even' }}">
		{% for a in attachments  %}
			{# TODO: check type and mediaType #}
			<img src="{{ a.url }}" class="img-responsive img-area-{{ loop.index }}">
			<img src="{{ a.url }}" class="img-responsive img-area-{{ loop.index }}" loading="lazy">
		{% endfor %}
		</div>
	</div>

    {% if obj.data.url and obj.data.mediaType and obj.data.mediaType.startswith("image/") %}
    <div class="card-image">
        <img src="{{ obj.data.url }}" class="img-responsive" title="{{ obj.data.name }}">
        <img src="{{ obj.data.url }}" class="img-responsive" title="{{ obj.data.name }}" loading="lazy">
    </div>
    {% endif %}