2024-08-24 18:23:27 +00:00
|
|
|
|
{{*
|
|
|
|
|
* Copyright (C) 2010-2024, the Friendica project
|
|
|
|
|
* SPDX-FileCopyrightText: 2010-2024 the Friendica project
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
|
*}}
|
2023-09-29 07:28:22 +00:00
|
|
|
|
{{* The padding-top height allocation trick only works if the <figure> fills its parent's width completely or with flex. 🤷♂️
|
|
|
|
|
As a result, we need to add a wrapping element for non-flex (non-image grid) environments, mostly single-image cases.
|
|
|
|
|
*}}
|
|
|
|
|
{{if $allocated_max_width}}
|
2024-03-26 16:33:45 +00:00
|
|
|
|
<div class="img-allocated-max-width" style="max-width: {{$allocated_max_width|default:"auto"}};">
|
2023-09-29 07:28:22 +00:00
|
|
|
|
{{/if}}
|
|
|
|
|
|
|
|
|
|
<figure class="img-allocated-height" style="width: {{$allocated_width|default:"auto"}}; padding-bottom: {{$allocated_height}}">
|
|
|
|
|
{{if $image->preview}}
|
|
|
|
|
<a data-fancybox="uri-id-{{$image->uriId}}" href="{{$image->url}}">
|
|
|
|
|
<img src="{{$image->preview}}" alt="{{$image->description}}" title="{{$image->description}}" loading="lazy">
|
|
|
|
|
</a>
|
|
|
|
|
{{else}}
|
|
|
|
|
<img src="{{$image->url}}" alt="{{$image->description}}" title="{{$image->description}}" loading="lazy">
|
2023-10-08 14:28:17 +00:00
|
|
|
|
{{if $image->description}}
|
|
|
|
|
<figcaption>{{$image->description}}</figcaption>
|
|
|
|
|
{{/if}}
|
2023-09-29 07:28:22 +00:00
|
|
|
|
{{/if}}
|
|
|
|
|
</figure>
|
|
|
|
|
|
|
|
|
|
{{if $allocated_max_width}}
|
|
|
|
|
</div>
|
|
|
|
|
{{/if}}
|