blur nsfw and nsfl thumbnails when viewed outside of a nsfw/l community

This commit is contained in:
rimu 2024-02-26 21:45:47 +13:00
parent 684d4f741d
commit 75c4ece82f
3 changed files with 9 additions and 4 deletions

View file

@ -654,6 +654,9 @@ fieldset legend {
width: 133px;
}
}
.post_list .post_teaser .thumbnail img.blur {
filter: blur(3px);
}
.post_list .post_teaser .thumbnail.lbw .fe {
background: none;
}

View file

@ -268,7 +268,9 @@ html {
@include breakpoint(tablet) {
height: 70px;
width: 133px;
}
&.blur {
filter: blur(3px);
}
}

View file

@ -24,15 +24,15 @@
{% else %}
{% if post.type == POST_TYPE_LINK %}
<a href="{{ post.url }}" rel="nofollow ugc" target="_blank" aria-label="{{ _('Read article') }}"><span class="fe fe-external"></span><img src="{{ post.image.thumbnail_url() }}"
alt="{{ post.image.alt_text if post.image.alt_text else '' }}" loading="lazy" /></a>
alt="{{ post.image.alt_text if post.image.alt_text else '' }}" loading="lazy" class="{{ 'blur' if (post.nsfw and not post.community.nsfw) or (post.nsfl and not post.community.nsfl) }}" /></a>
{% elif post.type == POST_TYPE_IMAGE %}
{% if post.image_id %}
<a href="{{ post.image.view_url() }}" rel="nofollow ugc" aria-label="{{ _('View image') }}" target="_blank"><span class="fe fe-magnify"></span><img src="{{ post.image.thumbnail_url() }}"
alt="{{ post.image.alt_text if post.image.alt_text else '' }}" loading="lazy" /></a>
alt="{{ post.image.alt_text if post.image.alt_text else '' }}" loading="lazy" class="{{ 'blur' if (post.nsfw and not post.community.nsfw) or (post.nsfl and not post.community.nsfl) }}" /></a>
{% endif %}
{% else %}
<a href="{{ url_for('activitypub.post_ap', post_id=post.id) }}" aria-label="{{ _('Read post') }}"><span class="fe fe-reply"></span><img src="{{ post.image.thumbnail_url() }}"
alt="{{ post.image.alt_text if post.image.alt_text else '' }}" loading="lazy" /></a>
alt="{{ post.image.alt_text if post.image.alt_text else '' }}" loading="lazy" class="{{ 'blur' if (post.nsfw and not post.community.nsfw) or (post.nsfl and not post.community.nsfl) }}" /></a>
{% endif %}
{% endif %}
</div>