2023-08-22 21:24:11 +12:00
|
|
|
{% extends "base.html" %}
|
|
|
|
{% from 'bootstrap5/form.html' import render_form %}
|
|
|
|
|
|
|
|
{% block app_content %}
|
2023-08-29 22:01:06 +12:00
|
|
|
<div class="row g-2 justify-content-between">
|
|
|
|
<div class="col-auto">
|
|
|
|
<div class="btn-group">
|
2023-09-05 20:25:02 +12:00
|
|
|
<a href="/communities" class="btn {{ 'btn-primary' if request.path == '/communities' else 'btn-outline-secondary' }}">
|
|
|
|
{{ _('All') }}
|
|
|
|
</a>
|
|
|
|
<a href="/communities/local" class="btn {{ 'btn-primary' if request.path == '/communities/local' else 'btn-outline-secondary' }}">
|
|
|
|
{{ _('Local') }}
|
|
|
|
</a>
|
|
|
|
<a href="/communities/subscribed" class="btn {{ 'btn-primary' if request.path == '/communities/subscribed' else 'btn-outline-secondary' }}">
|
|
|
|
{{ _('Subscribed') }}
|
|
|
|
</a>
|
2023-08-29 22:01:06 +12:00
|
|
|
</div>
|
2023-09-05 20:25:02 +12:00
|
|
|
|
2023-08-29 22:01:06 +12:00
|
|
|
</div>
|
|
|
|
<div class="col-auto">
|
|
|
|
|
|
|
|
<div class="btn-group">
|
|
|
|
|
2023-09-03 16:30:20 +12:00
|
|
|
<a href="{{ url_for('community.add_local') }}" class="btn btn-outline-secondary">{{ _('Create local') }}</a>
|
2023-08-29 22:01:06 +12:00
|
|
|
<a href="{{ url_for('community.add_remote') }}" class="btn btn-outline-secondary">{{ _('Add remote') }}</a>
|
|
|
|
</div>
|
2023-09-05 20:25:02 +12:00
|
|
|
<form method="get" action="/communities">
|
|
|
|
<input name='search' type="search" placeholder="Find a community" class="form-control" value="{{ search }}" />
|
|
|
|
</form>
|
2023-08-29 22:01:06 +12:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% if len(communities) > 0 %}
|
|
|
|
<div class="table-responsive-md">
|
|
|
|
<table class="table table-striped table-hover w-100">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th scope="col" colspan="2">{{ _('Name') }}</th>
|
|
|
|
<th scope="col">{{ _('Posts') }}</th>
|
|
|
|
<th scope="col">{{ _('Comments') }}</th>
|
|
|
|
<th scope="col">{{ _('Active') }}</th>
|
|
|
|
<th scope="col">{{ _('Actions') }}</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{% for community in communities %}
|
|
|
|
<tr class="">
|
2023-09-03 16:30:20 +12:00
|
|
|
<td><a href="/c/{{ community.link() }}"><img src="{{ community.icon_image() }}" class="community_icon rounded-circle" loading="lazy" /></a></td>
|
2023-08-29 22:01:06 +12:00
|
|
|
<th scope="row"><a href="/c/{{ community.link() }}">{{ community.display_name() }}</a></th>
|
|
|
|
<td>{{ community.post_count }}</td>
|
|
|
|
<td>{{ community.post_reply_count }}</td>
|
|
|
|
<td>{{ moment(community.last_active).fromNow(refresh=True) }}</td>
|
|
|
|
<td>{% if current_user.subscribed(community) %}
|
2023-09-05 20:25:02 +12:00
|
|
|
<a class="btn btn-primary btn-sm" 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="btn btn-primary btn-sm" href="/community/{{ community.link() }}/subscribe">Subscribe</a>
|
2023-08-29 22:01:06 +12:00
|
|
|
{% endif %}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
{% else %}
|
|
|
|
<p>{{ _('There are no communities yet.') }}</p>
|
|
|
|
{% endif %}
|
2023-08-22 21:24:11 +12:00
|
|
|
{% endblock %}
|