2024-05-30 21:54:25 +12:00
{% if theme() and file_exists('app/templates/themes/' + theme() + '/base.html') -%}
{% extends 'themes/' + theme() + '/base.html' -%}
{% else -%}
{% extends "base.html" -%}
{% endif -%} -%}
{% from 'bootstrap/form.html' import render_form -%}
2023-08-29 22:01:06 +12:00
2024-05-30 21:54:25 +12:00
{% block app_content -%}
2023-08-29 22:01:06 +12:00
< div class = "row" >
2023-11-09 21:32:29 +13:00
< div class = "col-12 col-md-8 position-relative main_pane" >
2024-05-30 21:54:25 +12:00
{% if community.header_image() != '' and not low_bandwidth -%}
2023-12-22 14:05:39 +13:00
< div class = "community_header" style = "background-image: url({{ community.header_image() }});" >
2023-10-03 22:29:13 +13:00
< nav aria-label = "breadcrumb" id = "breadcrumb_nav" title = "Navigation" >
< ol class = "breadcrumb" >
2024-05-30 21:54:25 +12:00
{% for breadcrumb in breadcrumbs -%}
< li class = "breadcrumb-item" > {% if breadcrumb.url -%}< a href = "{{ breadcrumb.url }}" > {% endif -%}{{ breadcrumb.text }}{% if breadcrumb.url -%}< / a > {% endif -%}< / li >
{% endfor -%}
2024-02-14 09:50:13 +13:00
< li class = "breadcrumb-item active" > {{ (community.title + '@' + community.ap_domain)|shorten }}< / li >
2023-10-03 22:29:13 +13:00
< / ol >
< / nav >
< / div >
2024-01-23 19:17:05 +13:00
< img class = "community_icon_big bump_up rounded-circle" src = "{{ community.icon_image() }}" alt = "Community icon" / >
2024-02-26 21:26:19 +13:00
< h1 class = "mt-2" aria-live = "assertive" > {{ community.title }}
2024-05-30 21:54:25 +12:00
{% if current_user.is_authenticated -%}
{% include 'community/_notification_toggle.html' -%}
{% endif -%}
{% if community.nsfw -%}< span class = "warning_badge nsfw" title = "{{ _('Not safe for work') }}" > nsfw< / span > {% endif -%}
{% if community.nsfl -%}< span class = "warning_badge nsfl" title = "{{ _('Not safe for life') }}" > nsfl< / span > {% endif -%}
2024-01-07 12:47:06 +13:00
< / h1 >
2024-05-30 21:54:25 +12:00
{% elif community.icon_id and not low_bandwidth -%}
2023-08-29 22:01:06 +12:00
< div class = "row" >
2024-01-06 15:30:50 +13:00
< nav aria-label = "breadcrumb" id = "breadcrumb_nav" title = "Navigation" >
< ol class = "breadcrumb" >
2024-05-30 21:54:25 +12:00
{% for breadcrumb in breadcrumbs -%}
< li class = "breadcrumb-item" > {% if breadcrumb.url -%}< a href = "{{ breadcrumb.url }}" > {% endif -%}{{ breadcrumb.text }}{% if breadcrumb.url -%}< / a > {% endif -%}< / li >
{% endfor -%}
2024-02-14 09:50:13 +13:00
< li class = "breadcrumb-item active" > {{ (community.title + '@' + community.ap_domain)|shorten }}< / li >
2024-01-06 15:30:50 +13:00
< / ol >
< / nav >
2023-08-29 22:01:06 +12:00
< div class = "col-2" >
2024-01-23 19:17:05 +13:00
< img class = "community_icon_big rounded-circle" src = "{{ community.icon_image() }}" alt = "Community icon" / >
2023-08-29 22:01:06 +12:00
< / div >
< div class = "col-10" >
2024-01-07 12:47:06 +13:00
< h1 class = "mt-3" > {{ community.title }}
2024-05-30 21:54:25 +12:00
{% if current_user.is_authenticated -%}
{% include 'community/_notification_toggle.html' -%}
{% endif -%}
{% if community.nsfw -%}< span class = "warning_badge nsfw" title = "{{ _('Not safe for work') }}" > nsfw< / span > {% endif -%}
{% if community.nsfl -%}< span class = "warning_badge nsfl" title = "{{ _('Not safe for life') }}" > nsfl< / span > {% endif -%}
2024-01-07 12:47:06 +13:00
< / h1 >
2023-08-29 22:01:06 +12:00
< / div >
< / div >
2024-05-30 21:54:25 +12:00
{% else -%}
2023-10-03 22:29:13 +13:00
< nav aria-label = "breadcrumb" id = "breadcrumb_nav" title = "Navigation" >
< ol class = "breadcrumb" >
2024-05-30 21:54:25 +12:00
{% for breadcrumb in breadcrumbs -%}
< li class = "breadcrumb-item" > {% if breadcrumb.url -%}< a href = "{{ breadcrumb.url }}" > {% endif -%}{{ breadcrumb.text }}{% if breadcrumb.url -%}< / a > {% endif -%}< / li >
{% endfor -%}
2024-02-14 09:50:13 +13:00
< li class = "breadcrumb-item active" > {{ (community.title + '@' + community.ap_domain)|shorten }}< / li >
2023-10-03 22:29:13 +13:00
< / ol >
< / nav >
2024-01-07 12:47:06 +13:00
< h1 class = "mt-2" > {{ community.title }}
2024-05-30 21:54:25 +12:00
{% if current_user.is_authenticated -%}
{% include 'community/_notification_toggle.html' -%}
{% endif -%}
{% if community.nsfw -%}< span class = "warning_badge nsfw" title = "{{ _('Not safe for work') }}" > nsfw< / span > {% endif -%}
{% if community.nsfl -%}< span class = "warning_badge nsfl" title = "{{ _('Not safe for life') }}" > nsfl< / span > {% endif -%}
2024-01-07 12:47:06 +13:00
< / h1 >
2024-05-30 21:54:25 +12:00
{% endif -%}
{% include "community/_community_nav.html" -%}
{% if post_layout == 'masonry' or post_layout == 'masonry_wide' -%}
2024-04-24 17:32:07 +12:00
< div class = "masonry" id = "masonry" >
<!-- Masonry columns will be added here -->
2024-01-21 15:44:13 +13:00
< / div >
2024-04-24 17:32:07 +12:00
< script nonce = "{{ session['nonce'] }}" >
document.addEventListener("DOMContentLoaded", function() {
const masonry = document.getElementById('masonry');
const htmlSnippets = [
2024-05-30 21:54:25 +12:00
{% for post in posts.items -%}
{% raw -%}`{% endraw -%}{% include 'post/_post_teaser_masonry.html' -%}{% raw -%}`{% endraw -%},
{% endfor -%}
2024-04-24 17:32:07 +12:00
];
renderMasonry(masonry, htmlSnippets);
});
< / script >
2024-05-30 21:54:25 +12:00
{% else -%}
2024-01-21 15:44:13 +13:00
< div class = "post_list" >
2024-05-30 21:54:25 +12:00
{% for post in posts.items -%}
{% include 'post/_post_teaser.html' -%}
{% else -%}
2024-01-21 15:44:13 +13:00
< p > {{ _('No posts in this community yet.') }}< / p >
2024-05-30 21:54:25 +12:00
{% endfor -%}
2024-01-21 15:44:13 +13:00
< / div >
2024-05-30 21:54:25 +12:00
{% endif -%}
2023-12-15 17:35:11 +13:00
2024-01-23 19:17:05 +13:00
< nav aria-label = "Pagination" class = "mt-4" role = "navigation" >
2024-05-30 21:54:25 +12:00
{% if prev_url -%}
2024-01-03 20:14:39 +13:00
< a href = "{{ prev_url }}" class = "btn btn-primary" rel = 'nofollow' >
2023-12-15 17:35:11 +13:00
< span aria-hidden = "true" > ← < / span > {{ _('Previous page') }}
< / a >
2024-05-30 21:54:25 +12:00
{% endif -%}
{% if next_url -%}
2024-01-03 20:14:39 +13:00
< a href = "{{ next_url }}" class = "btn btn-primary" rel = 'nofollow' >
2023-12-15 17:35:11 +13:00
{{ _('Next page') }} < span aria-hidden = "true" > → < / span >
< / a >
2024-05-30 21:54:25 +12:00
{% endif -%}
2023-12-15 17:35:11 +13:00
< / nav >
2023-08-29 22:01:06 +12:00
< / div >
2024-02-05 08:39:08 +13:00
< aside id = "side_pane" class = "col-12 col-md-4 side_pane" role = "complementary" >
2023-08-29 22:01:06 +12:00
< div class = "card" >
< div class = "card-body" >
< div class = "row" >
2024-05-30 21:54:25 +12: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]) -%}
2024-04-15 12:54:27 +01:00
< div class = "col-6" >
< a class = "w-100 btn btn-primary" href = "/community/{{ community.link() }}/submit" rel = "nofollow" > {{ _('Create post') }}< / a >
< / div >
2024-05-30 21:54:25 +12:00
{% endif -%}
2023-08-29 22:01:06 +12:00
< div class = "col-6" >
2024-05-30 21:54:25 +12:00
{% if current_user.is_authenticated and community_membership(current_user, community) in [SUBSCRIPTION_MEMBER, SUBSCRIPTION_MODERATOR, SUBSCRIPTION_OWNER] -%}
2024-01-16 15:38:56 +13:00
< a class = "w-100 btn btn-primary" href = "/community/{{ community.link() }}/unsubscribe" rel = "nofollow" > {{ _('Leave') }}< / a >
2024-05-30 21:54:25 +12:00
{% elif current_user.is_authenticated and community_membership(current_user, community) == SUBSCRIPTION_PENDING -%}
2024-01-16 15:38:56 +13:00
< a class = "w-100 btn btn-outline-secondary" href = "/community/{{ community.link() }}/unsubscribe" rel = "nofollow" > {{ _('Pending') }}< / a >
2024-05-30 21:54:25 +12:00
{% else -%}
2024-01-16 15:38:56 +13:00
< a class = "w-100 btn btn-primary" href = "/community/{{ community.link() }}/subscribe" rel = "nofollow" > {{ _('Join') }}< / a >
2024-05-30 21:54:25 +12:00
{% endif -%}
2023-08-29 22:01:06 +12:00
< / div >
< / div >
2024-05-09 20:00:22 +12:00
< form method = "get" action = "/search" >
< input type = "search" name = "q" class = "form-control mt-2" placeholder = "{{ _('Search this community') }}" / >
< input type = "hidden" name = "community" value = "{{ community.id }}" >
< / form >
2023-08-29 22:01:06 +12:00
< / div >
< / div >
< div class = "card mt-3" >
< div class = "card-header" >
2023-09-03 16:30:20 +12:00
< h2 > {{ _('About community') }}< / h2 >
2023-08-29 22:01:06 +12:00
< / div >
< div class = "card-body" >
2023-12-27 11:00:30 +13:00
< p > {{ community.description_html|safe if community.description_html else '' }}< / p >
< p > {{ community.rules_html|safe if community.rules_html else '' }}< / p >
2024-05-30 21:54:25 +12:00
{% if len(mods) > 0 and not community.private_mods -%}
2023-09-05 20:25:02 +12:00
< h3 > Moderators< / h3 >
2023-12-27 11:00:30 +13:00
< ul class = "moderator_list" >
2024-05-30 21:54:25 +12:00
{% for mod in mods -%}
2023-10-21 15:49:01 +13:00
< li > {{ render_username(mod) }}< / li >
2024-05-30 21:54:25 +12:00
{% endfor -%}
2023-12-22 14:05:39 +13:00
< / ul >
2024-05-30 21:54:25 +12:00
{% endif -%}
{% if not community.is_local() -%}
2024-05-28 15:40:09 +12:00
< ul >
2024-06-05 13:21:41 +12:00
< li > < p > < a href = "{{ community.public_url() }}" > {{ _('View community on original server') }}< / a > < / p > < / li >
2024-05-28 15:40:09 +12:00
< li > < p > < a href = "{{ url_for('community.retrieve_remote_post', community_id=community.id) }}" > {{ _('Retrieve a post from the original server') }}< / a > < / p > < / li >
< / ul >
2024-05-30 21:54:25 +12:00
{% endif -%}
{% if community.local_only -%}
2024-01-27 11:19:23 +13:00
< p > {{ _('Only people on %(instance_name)s can post or reply in this community.', instance_name=current_app.config['SERVER_NAME']) }}< / p >
2024-05-30 21:54:25 +12:00
{% endif -%}
2024-01-07 14:36:55 +13:00
< p >
< a class = "no-underline" href = "{{ rss_feed }}" rel = "nofollow" > < span class = "fe fe-rss" > < / span > < / a > < a href = "{{ rss_feed }}" rel = "nofollow" > RSS feed< / a >
2023-12-12 18:28:49 +13:00
< / p >
2023-08-29 22:01:06 +12:00
< / div >
< / div >
2024-05-30 21:54:25 +12:00
{% if related_communities -%}
2024-01-15 18:32:58 +13:00
< div class = "card mt-3" >
< div class = "card-header" >
< h2 > {{ _('Related communities') }}< / h2 >
< / div >
< div class = "card-body" >
< ul class = "list-group list-group-flush" >
2024-05-30 21:54:25 +12:00
{% for community in related_communities -%}
2024-01-15 18:32:58 +13:00
< li class = "list-group-item" >
2024-01-23 19:17:05 +13:00
< a href = "/c/{{ community.link() }}" aria-label = "{{ _('Go to community') }}" > < img src = "{{ community.icon_image() }}" class = "community_icon rounded-circle" loading = "lazy" alt = "" / >
2024-01-15 18:32:58 +13:00
{{ community.display_name() }}
< / a >
< / li >
2024-05-30 21:54:25 +12:00
{% endfor -%}
2024-01-15 18:32:58 +13:00
< / ul >
< p class = "mt-4" > < a class = "btn btn-primary" href = "/communities" > {{ _('Explore communities') }}< / a > < / p >
< / div >
< / div >
2024-05-30 21:54:25 +12:00
{% endif -%}
{% if is_moderator or is_admin -%}
2024-01-15 19:18:21 +13:00
< div class = "card mt-3" >
< div class = "card-header" >
< h2 > {{ _('Community Settings') }}< / h2 >
< / div >
< div class = "card-body" >
2024-05-30 21:54:25 +12:00
{% if is_owner or is_admin -%}
2024-03-26 23:17:10 +01:00
< p > < a href = "{{ url_for('community.community_edit', community_id=community.id) }}" class = "btn btn-primary" > {{ _('Settings & Moderation') }}< / a > < / p >
2024-05-30 21:54:25 +12:00
{% elif is_moderator -%}
2024-03-26 23:17:10 +01:00
< p > < a href = "/community/{{ community.link() }}/moderate" class = "btn btn-primary" > {{ _('Moderation') }}< / a > < / p >
2024-05-30 21:54:25 +12:00
{% endif -%}
2024-01-15 19:18:21 +13:00
< / div >
< / div >
2024-05-30 21:54:25 +12:00
{% endif -%}
{% include "_inoculation_links.html" -%}
2024-01-28 21:38:04 +13:00
< / aside >
2023-08-29 22:01:06 +12:00
< / div >
< div class = "row" >
< / div >
2024-05-30 21:54:25 +12:00
{% endblock -%}