apply filters to community list

This commit is contained in:
Hendrik Langer 2024-06-28 22:41:42 +02:00
parent a82950fd03
commit 76bd91e559

View file

@ -86,7 +86,11 @@
</thead>
<tbody>
{% for community in communities.items -%}
<tr class="">
{% set content_blocked = (current_user.hide_nsfw == 3 and community.nsfw)
or (current_user.hide_nsfl == 3 and community.nsfl) -%}
{% set blur_content = (current_user.hide_nsfw == 2 and community.nsfw)
or (current_user.hide_nsfl == 2 and community.nsfl) -%}
<tr class="{{ 'blocked' if content_blocked }}{{ 'blur' if blur_content }}">
<td width="70">{% if current_user.is_authenticated -%}
{% if community_membership(current_user, community) in [SUBSCRIPTION_MEMBER, SUBSCRIPTION_MODERATOR, SUBSCRIPTION_OWNER] -%}
<a class="btn btn-primary btn-sm" href="/community/{{ community.link() }}/unsubscribe" rel="nofollow" aria-label="{{ _('Leave %(name)s', name=community.display_name()) }}">{{ _('Leave') }}</a>