pyfedi/app/templates/community/community.html

148 lines
7 KiB
HTML
Raw Normal View History

{% extends "base.html" %}
{% from 'bootstrap/form.html' import render_form %}
{% block app_content %}
<div class="row">
2023-11-09 21:32:29 +13:00
<div class="col-12 col-md-8 position-relative main_pane">
{% if community.header_image() != '' %}
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">
<li class="breadcrumb-item"><a href="/">{{ _('Home') }}</a></li>
<li class="breadcrumb-item"><a href="/communities">{{ _('Communities') }}</a></li>
<li class="breadcrumb-item active">{{ community.title|shorten }}</li>
</ol>
</nav>
</div>
<img class="community_icon_big bump_up rounded-circle" src="{{ community.icon_image() }}" />
2024-01-07 12:47:06 +13:00
<h1 class="mt-2">{{ community.title }}
{% if current_user.is_authenticated %}
{% include 'community/_notification_toggle.html' %}
{% endif %}
</h1>
2024-01-06 15:30:50 +13:00
{% elif community.icon_id %}
<div class="row">
2024-01-06 15:30:50 +13:00
<nav aria-label="breadcrumb" id="breadcrumb_nav" title="Navigation">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/">{{ _('Home') }}</a></li>
<li class="breadcrumb-item"><a href="/communities">{{ _('Communities') }}</a></li>
<li class="breadcrumb-item active">{{ community.title|shorten }}</li>
</ol>
</nav>
<div class="col-2">
<img class="community_icon_big rounded-circle" src="{{ community.icon_image() }}" />
</div>
<div class="col-10">
2024-01-07 12:47:06 +13:00
<h1 class="mt-3">{{ community.title }}
{% if current_user.is_authenticated %}
{% include 'community/_notification_toggle.html' %}
{% endif %}
</h1>
</div>
</div>
2023-09-17 21:19:51 +12:00
{% else %}
2023-10-03 22:29:13 +13:00
<nav aria-label="breadcrumb" id="breadcrumb_nav" title="Navigation">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/">{{ _('Home') }}</a></li>
<li class="breadcrumb-item"><a href="/communities">{{ _('Communities') }}</a></li>
<li class="breadcrumb-item active">{{ community.title|shorten }}</li>
</ol>
</nav>
2024-01-07 12:47:06 +13:00
<h1 class="mt-2">{{ community.title }}
{% if current_user.is_authenticated %}
{% include 'community/_notification_toggle.html' %}
{% endif %}
</h1>
{% endif %}
2024-01-03 20:14:39 +13:00
{% include "community/_community_nav.html" %}
<div class="post_list">
{% for post in posts %}
{% include 'post/_post_teaser.html' %}
{% else %}
<p>{{ _('No posts in this community yet.') }}</p>
{% endfor %}
</div>
2023-12-15 17:35:11 +13:00
<nav aria-label="Pagination" class="mt-4">
{% 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">&larr;</span> {{ _('Previous page') }}
</a>
{% 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">&rarr;</span>
</a>
{% endif %}
</nav>
</div>
2024-01-04 22:21:31 +13:00
<div class="col-12 col-md-4 side_pane">
<div class="card">
<div class="card-body">
<div class="row">
2024-01-06 08:16:50 +13:00
<div class="col-6">
<a class="w-100 btn btn-primary" href="/community/{{ community.link() }}/submit">{{ _('Create a post') }}</a>
</div>
<div class="col-6">
{% if current_user.is_authenticated and community_membership(current_user, community) == SUBSCRIPTION_MEMBER %}
<a class="w-100 btn btn-primary" href="/community/{{ community.link() }}/unsubscribe">{{ _('Leave') }}</a>
{% elif current_user.is_authenticated and community_membership(current_user, community) == SUBSCRIPTION_PENDING %}
<a class="w-100 btn btn-outline-secondary" href="/community/{{ community.link() }}/unsubscribe">{{ _('Pending') }}</a>
{% else %}
<a class="w-100 btn btn-primary" href="/community/{{ community.link() }}/subscribe">{{ _('Join') }}</a>
{% endif %}
</div>
</div>
<form method="get">
<input type="search" name="search" class="form-control mt-2" placeholder="{{ _('Search this community') }}" />
</form>
</div>
</div>
<div class="card mt-3">
<div class="card-header">
2023-09-03 16:30:20 +12:00
<h2>{{ _('About community') }}</h2>
</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>
{% 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">
2023-09-05 20:25:02 +12:00
{% for mod in mods %}
2023-10-21 15:49:01 +13:00
<li>{{ render_username(mod) }}</li>
2023-09-05 20:25:02 +12:00
{% endfor %}
2023-12-22 14:05:39 +13:00
</ul>
2023-09-05 20:25:02 +12:00
{% endif %}
{% if not community.is_local() %}
<p>
<a href="{{ community.profile_id() }}">View community on original server</a>
</p>
{% endif %}
<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>
</div>
</div>
2023-12-22 14:05:39 +13:00
{% if is_moderator or is_admin %}
2023-09-05 20:25:02 +12:00
<div class="card mt-3">
<div class="card-header">
<h2>{{ _('Community Settings') }}</h2>
</div>
<div class="card-body">
<p><a href="#" class="btn btn-primary">{{ _('Moderate') }}</a></p>
<p><a href="#" class="btn btn-primary">{{ _('Settings') }}</a></p>
{% if community.is_owner() or current_user.is_admin() %}
<p><a class="btn btn-primary btn-warning" href="{{ url_for('community.community_delete', community_id=community.id) }}" rel="nofollow">Delete community</a></p>
{% endif %}
2023-09-05 20:25:02 +12:00
</div>
</div>
{% endif %}
</div>
</div>
<div class="row">
</div>
{% endblock %}