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

71 lines
3.3 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>{{ _('Blocked domains') }}</h1>
{% else %}
<h1>{{ _('Blocked 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>
{% if user_access('ban users', current_user.id) or user_access('manage users', current_user.id) %}<th>Actions</th>{% endif %}
</tr>
{% for domain in domains %}
<tr>
<td><a href="{{ url_for('domain.show_domain', domain_id=domain.id) }}">{{ domain.name }}</a></td>
<td>
{% if user_access('ban users', current_user.id) or user_access('manage users', current_user.id) %}
{% if domain.banned %}
<a class="btn btn-primary confirm_first" title="{{ _('Unbanning this domain allows future posts linking to that domain.') }}" href="/d/{{ domain.id }}/unban">{{ _('Unban') }}</a>
{% else %}
<a class="btn btn-primary confirm_first" title="{{ _('Banning this domain will delete all posts linking to this domain and prevent future posts linking to that domain.') }}" href="/d/{{ domain.id }}/ban">{{ _('Ban') }}</a>
{% endif %}
{% endif %}
</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 %}