pyfedi/app/templates/community/community.html

101 lines
4.3 KiB
HTML

{% extends "base.html" %}
{% 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() != '' %}
<div class="community_header" style="height: 240px; background-image: url({{ community.header_image() }});">
<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() }}" />
<h1 class="mt-2">{{ community.title }}</h1>
{% elif community.icon_image() != '' %}
<div class="row">
<div class="col-2">
<img class="community_icon_big rounded-circle" src="{{ community.icon_image() }}" />
</div>
<div class="col-10">
<h1 class="mt-3">{{ community.title }}</h1>
</div>
</div>
{% else %}
<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>
<h1 class="mt-2">{{ community.title }}</h1>
{% endif %}
<div class="post_list">
{% for post in posts %}
{% include 'post/_post_teaser.html' %}
{% else %}
<p>{{ _('No posts in this community yet.') }}</p>
{% endfor %}
</div>
</div>
<div class="col-12 col-md-4">
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-6">
{% if current_user.is_authenticated and current_user.subscribed(community) %}
<a class="w-100 btn btn-primary" href="/community/{{ community.link() }}/unsubscribe">{{ _('Unsubscribe') }}</a>
{% else %}
<a class="w-100 btn btn-primary" href="/community/{{ community.link() }}/subscribe">{{ _('Subscribe') }}</a>
{% endif %}
</div>
<div class="col-6">
<a class="w-100 btn btn-primary" href="/community/{{ community.link() }}/submit">{{ _('Create a post') }}</a>
</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">
<h2>{{ _('About community') }}</h2>
</div>
<div class="card-body">
<p>{{ community.description|safe }}</p>
<p>{{ community.rules|safe }}</p>
{% if len(mods) > 0 and not community.private_mods %}
<h3>Moderators</h3>
<ol>
{% for mod in mods %}
<li>{{ render_username(mod) }}</li>
{% endfor %}
</ol>
{% endif %}
</div>
</div>
{% if is_moderator %}
<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>
</div>
</div>
{% endif %}
</div>
</div>
<div class="row">
</div>
{% endblock %}