pyfedi/app/templates/domain/domains.html
2024-12-10 12:16:52 +01:00

66 lines
2.5 KiB
HTML

{% if theme() and file_exists('app/templates/themes/' + theme() + '/base.html') %}
{% extends 'themes/' + theme() + '/base.html' %}
{% else %}
{% extends "base.html" %}
{% endif %}
{% 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 search == '' %}
<h1>{{ _('Domains') }}</h1>
{% else %}
<h1>{{ _('Domains containing "%(search)s"', search=search) }}</h1>
{% endif %}
{% if not current_user.is_anonymous and current_user.trustworthy() %}
<div class="row">
<div class="col-auto">
<div class="btn-group">
<a href="/domains" class="btn {{ 'btn-primary' if request.path == '/domains' else 'btn-outline-secondary' }}">
{{ _('Domains') }}
</a>
<a href="/domains/banned" class="btn {{ 'btn-primary' if request.path == '/domains/banned' else 'btn-outline-secondary' }}">
{{ _('Banned domains') }}
</a>
</div>
</div>
<div class="col-auto">
<form method="get"><input type="search" name="search" value="{{ search }}" placeholder="{{ _('Search') }}" autofocus></form>
</div>
</div>
{% endif %}
<div class="table-responsive-sm pt-4">
<table class="table table-striped">
<tr>
<th>Domain</th>
<th><span title="{{ _('How many times has something on this domain been posted') }}"># Posts</span></th>
</tr>
{% for domain in domains %}
<tr>
<td><a href="{{ url_for('domain.show_domain', domain_id=domain.id) }}">{{ domain.name }}</a></td>
<td>{{ domain.post_count }}</td>
</tr>
{% endfor %}
</table>
</div>
<nav aria-label="Pagination" class="mt-4" role="navigation">
{% if prev_url %}
<a href="{{ prev_url }}" class="btn btn-primary" rel="nofollow">
<span aria-hidden="true">&larr;</span> {{ _('Previous page') }}
</a>
{% endif %}
{% if next_url %}
<a href="{{ next_url }}" class="btn btn-primary" rel="nofollow">
{{ _('Next page') }} <span aria-hidden="true">&rarr;</span>
</a>
{% endif %}
</nav>
</div>
</div>
{% endblock %}