2023-08-29 22:01:06 +12:00
|
|
|
{% extends "base.html" %}
|
|
|
|
{% from 'bootstrap/form.html' import render_form %}
|
|
|
|
|
|
|
|
{% block app_content %}
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-8 position-relative">
|
|
|
|
{% if community.header_image() != '' %}
|
|
|
|
<div class="community_header" style="height: 240px; background-image: url({{ community.header_image() }});"></div>
|
|
|
|
<img class="community_icon_big bump_up rounded-circle" src="{{ community.icon_image() }}" />
|
|
|
|
<h1 class="mt-2">{{ community.title }}</h1>
|
2023-09-17 21:19:51 +12:00
|
|
|
{% elif community.icon_image() != '' %}
|
2023-08-29 22:01:06 +12:00
|
|
|
<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>
|
2023-09-17 21:19:51 +12:00
|
|
|
{% else %}
|
|
|
|
<h1 class="mt-3">{{ community.title }}</h1>
|
2023-08-29 22:01:06 +12:00
|
|
|
{% endif %}
|
2023-10-02 22:16:44 +13:00
|
|
|
<div class="post_list">
|
|
|
|
{% for post in posts %}
|
|
|
|
<div class="post_teaser">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col">{{ post.author.user_name }} · {{ moment(post.posted_at).fromNow() }}</div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col{% if post.image_id %}-8{% endif %}">
|
|
|
|
<h3>
|
|
|
|
<a href="{{ url_for('community.show_post', post_id=post.id) }}">{{ post.title }}</a>
|
|
|
|
{% if post.type == post_type_link %}
|
|
|
|
<span class="domain_link">(<a href="/d/{{ post.domain_id }}">domain</a>)</span>
|
|
|
|
{% endif %}
|
|
|
|
</h3>
|
|
|
|
</div>
|
|
|
|
{% if post.image_id %}
|
|
|
|
<div class="col-4">
|
|
|
|
<img src="{{ post.image.source_url}}" alt="{{ post.image.alt_text }}"
|
|
|
|
width="100" />
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-4">
|
|
|
|
up {{ post.score }} down
|
|
|
|
</div>
|
|
|
|
<div class="col-6">
|
|
|
|
<a href="{{ url_for('community.show_post', post_id=post.id, _anchor='replies') }}">{{post.reply_count}}</a> additional tools
|
|
|
|
</div>
|
|
|
|
<div class="col-2">...</div>
|
|
|
|
</div>
|
2023-08-29 22:01:06 +12:00
|
|
|
|
2023-10-02 22:16:44 +13:00
|
|
|
</div>
|
|
|
|
{% else %}
|
|
|
|
<p>{{ _('No posts in this community yet.') }}</p>
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
2023-08-29 22:01:06 +12:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="col-4">
|
|
|
|
<div class="card">
|
|
|
|
<div class="card-body">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-6">
|
2023-10-02 22:16:44 +13:00
|
|
|
{% if current_user.is_authenticated and current_user.subscribed(community) %}
|
2023-09-05 20:25:02 +12:00
|
|
|
<a class="w-100 btn btn-primary" href="/community/{{ community.link() }}/unsubscribe">{{ _('Unsubscribe') }}</a>
|
2023-08-29 22:01:06 +12:00
|
|
|
{% else %}
|
2023-09-05 20:25:02 +12:00
|
|
|
<a class="w-100 btn btn-primary" href="/community/{{ community.link() }}/subscribe">{{ _('Subscribe') }}</a>
|
2023-08-29 22:01:06 +12:00
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
<div class="col-6">
|
2023-09-17 21:19:51 +12:00
|
|
|
<a class="w-100 btn btn-primary" href="/community/{{ community.link() }}/submit">{{ _('Create a post') }}</a>
|
2023-08-29 22:01:06 +12:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<form method="get">
|
2023-10-02 22:16:44 +13:00
|
|
|
<input type="search" name="search" class="form-control mt-2" placeholder="{{ _('Search this community') }}" />
|
2023-08-29 22:01:06 +12:00
|
|
|
</form>
|
|
|
|
</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-09-17 21:19:51 +12:00
|
|
|
<p>{{ community.description|safe }}</p>
|
|
|
|
<p>{{ community.rules|safe }}</p>
|
2023-09-08 20:04:01 +12:00
|
|
|
{% if len(mods) > 0 and not community.private_mods %}
|
2023-09-05 20:25:02 +12:00
|
|
|
<h3>Moderators</h3>
|
|
|
|
<ol>
|
|
|
|
{% for mod in mods %}
|
|
|
|
<li><a href="/u/{{ mod.user_name }}">{{ mod.user_name }}</a></li>
|
|
|
|
{% endfor %}
|
|
|
|
</ol>
|
|
|
|
{% endif %}
|
2023-08-29 22:01:06 +12:00
|
|
|
</div>
|
|
|
|
</div>
|
2023-09-05 20:25:02 +12:00
|
|
|
{% 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 %}
|
2023-08-29 22:01:06 +12:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
{% endblock %}
|