2024-01-28 18:11:32 +13:00
{% if community %}
2024-04-15 12:54:27 +01:00
{% if not community.restricted_to_mods or (community.restricted_to_mods and current_user.is_authenticated and community_membership(current_user, community) in [SUBSCRIPTION_MODERATOR, SUBSCRIPTION_OWNER]) %}
< div class = "mobile_create_post d-md-none mt-1" >
2025-01-01 12:01:51 +13:00
< div class = "dropdown" >
< button class = "btn btn-primary btn-sm dropdown-toggle" type = "button" data-bs-toggle = "dropdown" aria-expanded = "false" >
{{ _('Actions') }}
< / button >
< ul class = "dropdown-menu" >
< li > < a class = "dropdown-item" href = "/community/{{ community.link() }}/submit" > {{ _('Create post') }}< / a > < / li >
< li > < a class = "dropdown-item" href = "#search_community" > {{ _('Search') }}< / a > < / li >
< li > < a class = "dropdown-item" href = "#about_community" > {{ _('About community') }}< / a > < / li >
< div class = "dropdown-divider" > < / div >
{% if current_user.is_authenticated and community_membership(current_user, community) in [SUBSCRIPTION_MEMBER, SUBSCRIPTION_MODERATOR, SUBSCRIPTION_OWNER] -%}
< li > < a class = "dropdown-item" href = "/community/{{ community.link() }}/unsubscribe" rel = "nofollow" > {{ _('Leave') }}< / a > < / li >
{% elif current_user.is_authenticated and community_membership(current_user, community) == SUBSCRIPTION_PENDING -%}
< li > < a class = "dropdown-item" href = "/community/{{ community.link() }}/unsubscribe" rel = "nofollow" > {{ _('Pending') }}< / a > < / li >
{% else -%}
< li > < a class = "dropdown-item" href = "/community/{{ community.link() }}/subscribe" rel = "nofollow" > {{ _('Join') }}< / a > < / li >
{% endif -%}
{% if is_moderator or is_owner or is_admin -%}
< div class = "dropdown-divider" > < / div >
< li > < a class = "dropdown-item" href = "/community/{{ community.link() }}/moderate" > {{ _('Moderate') }}< / a > < / li >
{% endif -%}
{% if is_owner or is_admin -%}
< li > < a class = "dropdown-item" href = "{{ url_for('community.community_edit', community_id=community.id) }}" > {{ _('Settings') }}< / a > < / li >
{% endif -%}
< / ul >
< / div >
2024-04-15 12:54:27 +01:00
< / div >
{% endif %}
2024-01-28 18:11:32 +13:00
{% endif %}
2024-01-03 20:14:39 +13:00
< div class = "btn-group mt-1 mb-2" >
2024-02-26 21:26:19 +13:00
< a href = "?sort=hot&layout={{ post_layout }}" aria-label = "{{ _('Sort by hot') }}" class = "btn {{ 'btn-primary' if sort == '' or sort == 'hot' else 'btn-outline-secondary' }}" rel = "nofollow noindex" >
2024-01-03 20:14:39 +13:00
{{ _('Hot') }}
< / a >
2024-02-26 21:26:19 +13:00
< a href = "?sort=top&layout={{ post_layout }}" aria-label = "{{ _('Sort by top') }}" class = "btn {{ 'btn-primary' if sort == 'top' else 'btn-outline-secondary' }}" rel = "nofollow noindex" >
2024-01-03 20:14:39 +13:00
{{ _('Top') }}
< / a >
2024-02-26 21:26:19 +13:00
< a href = "?sort=new&layout={{ post_layout }}" aria-label = "{{ _('Sort by new') }}" class = "btn {{ 'btn-primary' if sort == 'new' else 'btn-outline-secondary' }}" rel = "nofollow noindex" >
2024-01-03 20:14:39 +13:00
{{ _('New') }}
< / a >
2024-02-26 21:26:19 +13:00
< a href = "?sort=active&layout={{ post_layout }}" aria-label = "{{ _('Sort by active') }}" class = "btn {{ 'btn-primary' if sort == 'active' else 'btn-outline-secondary' }}" rel = "nofollow noindex" >
2024-01-15 18:26:22 +13:00
{{ _('Active') }}
< / a >
2024-01-21 15:44:13 +13:00
< / div >
2024-01-21 17:12:38 +13:00
{% if post_layout != '' and post_layout is not none %}
2024-01-21 15:44:13 +13:00
< div class = "btn-group mt-1 mb-2 layout_switcher" >
2024-02-13 19:14:51 +13:00
< a href = "?layout=list&sort={{ sort }}" class = "btn {{ 'btn-primary' if post_layout == '' or post_layout == 'list' else 'btn-outline-secondary' }}" rel = "nofollow noindex" >
2024-01-21 15:44:13 +13:00
{{ _('List') }}
< / a >
2024-02-13 19:14:51 +13:00
< a href = "?layout=masonry&sort={{ sort }}" class = "btn {{ 'btn-primary' if post_layout == 'masonry' else 'btn-outline-secondary' }}" rel = "nofollow noindex" >
2024-01-21 15:44:13 +13:00
{{ _('Tile') }}
< / a >
2024-02-13 19:14:51 +13:00
< a href = "?layout=masonry_wide&sort={{ sort }}" class = "btn {{ 'btn-primary' if post_layout == 'masonry_wide' else 'btn-outline-secondary' }}" rel = "nofollow noindex" >
2024-01-21 15:44:13 +13:00
{{ _('Wide tile') }}
< / a >
< / div >
2024-04-15 12:54:27 +01:00
{% endif %}