pyfedi/app/templates/community/_community_nav.html

35 lines
2.1 KiB
HTML
Raw Normal View History

2024-01-28 18:11:32 +13:00
{% if community %}
{% 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">
<a class="btn btn-primary" href="/community/{{ community.link() }}/submit">{{ _('Create post') }}</a>
</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">
{{ _('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>
{% endif %}