mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 11:26:56 -08:00
116 lines
6.1 KiB
HTML
116 lines
6.1 KiB
HTML
{% 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 -%}
|
|
|
|
{% block app_content -%}
|
|
<div class="row">
|
|
<div class="col-12 col-md-8 position-relative main_pane">
|
|
{% if community.header_image() != '' and not low_bandwidth -%}
|
|
<div class="community_header" style="background-image: url({{ community.header_image() }});">
|
|
<nav aria-label="breadcrumb" id="breadcrumb_nav" title="Navigation">
|
|
<ol class="breadcrumb">
|
|
{% 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 -%}
|
|
<li class="breadcrumb-item active">{{ (community.title + '@' + community.ap_domain)|shorten }}</li>
|
|
</ol>
|
|
</nav>
|
|
</div>
|
|
<img class="community_icon_big bump_up rounded-circle" src="{{ community.icon_image() }}" alt="Community icon" />
|
|
<h1 class="mt-2" aria-live="assertive">{{ community.title }}
|
|
{% 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 -%}
|
|
</h1>
|
|
{% elif community.icon_id and not low_bandwidth -%}
|
|
<div class="row mb-3">
|
|
<nav class="mb-3" aria-label="breadcrumb" id="breadcrumb_nav" title="Navigation">
|
|
<ol class="breadcrumb">
|
|
{% 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 -%}
|
|
<li class="breadcrumb-item active">{{ (community.title + '@' + community.ap_domain)|shorten }}</li>
|
|
</ol>
|
|
</nav>
|
|
<div class="col-3 col-md-2">
|
|
<img class="community_icon_big rounded-circle" src="{{ community.icon_image() }}" alt="Community icon" />
|
|
</div>
|
|
<div class="col-9 col-md-10">
|
|
<h1 class="mt-3">{{ community.title }}
|
|
{% 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 -%}
|
|
</h1>
|
|
</div>
|
|
</div>
|
|
{% else -%}
|
|
<nav aria-label="breadcrumb" id="breadcrumb_nav" title="Navigation">
|
|
<ol class="breadcrumb">
|
|
{% 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 -%}
|
|
<li class="breadcrumb-item active">{{ (community.title + '@' + community.ap_domain)|shorten }}</li>
|
|
</ol>
|
|
</nav>
|
|
<h1 class="mt-2">{{ community.title }}
|
|
{% 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 -%}
|
|
</h1>
|
|
{% endif -%}
|
|
{% include "community/_community_nav.html" -%}
|
|
{% if post_layout == 'masonry' or post_layout == 'masonry_wide' -%}
|
|
<div class="masonry" id="masonry">
|
|
<!-- Masonry columns will be added here -->
|
|
</div>
|
|
<script nonce="{{ session['nonce'] }}">
|
|
document.addEventListener("DOMContentLoaded", function() {
|
|
const masonry = document.getElementById('masonry');
|
|
const htmlSnippets = [
|
|
{% for post in posts.items -%}
|
|
{% raw -%}`{% endraw -%}{% include 'post/_post_teaser_masonry.html' -%}{% raw -%}`{% endraw -%},
|
|
{% endfor -%}
|
|
];
|
|
renderMasonry(masonry, htmlSnippets);
|
|
});
|
|
</script>
|
|
{% else -%}
|
|
<div class="post_list">
|
|
{% for post in posts.items -%}
|
|
{% include 'post/_post_teaser.html' -%}
|
|
{% else -%}
|
|
<p>{{ _('No posts in this community yet.') }}</p>
|
|
{% endfor -%}
|
|
</div>
|
|
{% endif -%}
|
|
|
|
<nav aria-label="Pagination" class="mt-4" role="navigation">
|
|
{% if prev_url -%}
|
|
<a href="{{ prev_url }}" class="btn btn-primary" rel='nofollow'>
|
|
<span aria-hidden="true">←</span> {{ _('Previous page') }}
|
|
</a>
|
|
{% endif -%}
|
|
{% if next_url -%}
|
|
<a href="{{ next_url }}" class="btn btn-primary" rel='nofollow'>
|
|
{{ _('Next page') }} <span aria-hidden="true">→</span>
|
|
</a>
|
|
{% endif -%}
|
|
</nav>
|
|
</div>
|
|
|
|
{% include "_side_pane.html" %}
|
|
</div>
|
|
<div class="row">
|
|
|
|
|
|
</div>
|
|
{% endblock -%}
|