pyfedi/app/templates/list_communities.html

58 lines
2.6 KiB
HTML
Raw Normal View History

2023-08-22 02:24:11 -07:00
{% extends "base.html" %}
{% from 'bootstrap5/form.html' import render_form %}
{% block app_content %}
<div class="row g-2 justify-content-between">
<div class="col-auto">
<div class="btn-group">
<a href="#" class="btn btn-outline-secondary">{{ _('All') }}</a>
<a href="#" class="btn btn-outline-secondary">{{ _('Local') }}</a>
<a href="#" class="btn btn-outline-secondary">{{ _('Subscribed') }}</a>
</div>
</div>
<div class="col-auto">
<div class="btn-group">
2023-09-02 21:30:20 -07:00
<a href="{{ url_for('community.add_local') }}" class="btn btn-outline-secondary">{{ _('Create local') }}</a>
<a href="{{ url_for('community.add_remote') }}" class="btn btn-outline-secondary">{{ _('Add remote') }}</a>
</div>
<input type="search" placeholder="Find a community" class="form-control">
</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-02 21:30:20 -07:00
<td><a href="/c/{{ community.link() }}"><img src="{{ community.icon_image() }}" class="community_icon rounded-circle" loading="lazy" /></a></td>
<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) %}
<a class="btn btn-primary btn-sm" href="/c/{{ community.link() }}/unsubscribe">Unsubscribe</a>
{% else %}
<a class="btn btn-primary btn-sm" href="/c/{{ community.link() }}/subscribe">Subscribe</a>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<p>{{ _('There are no communities yet.') }}</p>
{% endif %}
2023-08-22 02:24:11 -07:00
{% endblock %}