mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-02-02 16:21:32 -08:00
lightbox on masonry communities
This commit is contained in:
parent
5fc07c6604
commit
3afd77cd31
3 changed files with 8 additions and 4 deletions
1
app/static/js/fslightbox.js
Normal file
1
app/static/js/fslightbox.js
Normal file
File diff suppressed because one or more lines are too long
|
@ -238,6 +238,9 @@
|
|||
<script type="text/javascript" src="{{ url_for('static', filename='js/htmx.min.js') }}"></script>
|
||||
<script type="text/javascript" src="{{ url_for('static', filename='js/scripts.js', changed=getmtime('js/scripts.js')) }}"></script>
|
||||
{% if not low_bandwidth %}
|
||||
{% if post_layout == 'masonry' or post_layout == 'masonry_wide' %}
|
||||
<script type="text/javascript" src="{{ url_for('static', filename='js/fslightbox.js') }}"></script>
|
||||
{% endif %}
|
||||
<script type="text/javascript" src="{{ url_for('static', filename='js/markdown/downarea.js') }}"></script>
|
||||
{% endif %}
|
||||
{% if theme() and file_exists('app/templates/themes/' + theme() + '/scripts.js') %}
|
||||
|
|
|
@ -13,17 +13,17 @@
|
|||
<div class="masonry_thumb" title="{{ post.title }}">
|
||||
{% if post.type == POST_TYPE_LINK %}
|
||||
{% if post.image.medium_url() %}
|
||||
<a href="{{ post.url }}" rel="nofollow ugc" target="_blank" aria-label="{{ _('View image') }}"><img src="{{ post.image.medium_url() }}"
|
||||
<a href="{{ post.url }}" rel="nofollow ugc" target="_blank" data-fslightbox aria-label="{{ _('View image') }}"><img src="{{ post.image.medium_url() }}"
|
||||
alt="{{ post.image.alt_text if post.image.alt_text else '' }}" loading="lazy" width="{{ post.image.width }}" height="{{ post.image.height }}" /></a>
|
||||
{% elif post.image.source_url %}
|
||||
<a href="{{ post.url }}" rel="nofollow ugc" target="_blank" aria-label="{{ _('View image') }}"><img src="{{ post.image.source_url }}"
|
||||
<a href="{{ post.url }}" rel="nofollow ugc" target="_blank" data-fslightbox aria-label="{{ _('View image') }}"><img src="{{ post.image.source_url }}"
|
||||
alt="{{ post.title }}" loading="lazy" /></a>
|
||||
{% else %}
|
||||
<a href="{{ post.url }}" rel="nofollow ugc" target="_blank" aria-label="{{ _('View image') }}"><img src="{{ post.url }}"
|
||||
<a href="{{ post.url }}" rel="nofollow ugc" target="_blank" data-fslightbox aria-label="{{ _('View image') }}"><img src="{{ post.url }}"
|
||||
alt="{{ post.title }}" loading="{{ 'lazy' if low_bandwidth else 'eager' }}" /></a>
|
||||
{% endif %}
|
||||
{% elif post.type == POST_TYPE_IMAGE %}
|
||||
<a href="{{ post.image.view_url() }}" rel="nofollow ugc" target="_blank"><img src="{{ post.image.medium_url() }}"
|
||||
<a href="{{ post.image.view_url() }}" rel="nofollow ugc" data-fslightbox target="_blank"><img src="{{ post.image.medium_url() }}"
|
||||
alt="{{ post.image.alt_text if post.image.alt_text else '' }}" loading="lazy" width="{{ post.image.width }}" height="{{ post.image.height }}" /></a>
|
||||
{% else %}
|
||||
<a href="{{ url_for('activitypub.post_ap', post_id=post.id) }}"><img src="{{ post.image.thumbnail_url() }}"
|
||||
|
|
Loading…
Add table
Reference in a new issue