pyfedi/app/templates/domain/domains.html

75 lines
3.2 KiB
HTML
Raw Normal View History

{% if theme() and file_exists('app/templates/themes/' + theme() + '/base.html') %}
{% extends 'themes/' + theme() + '/base.html' %}
{% else %}
{% extends "base.html" %}
{% endif %} %}
2023-11-29 22:12:55 +13:00
{% from 'bootstrap/form.html' import render_form %}
{% block app_content %}
<div class="row">
<div class="col-12 col-md-8 position-relative main_pane">
2024-02-02 16:52:23 +13:00
{% if search == '' %}
<h1>{{ _('Domains') }}</h1>
2024-02-02 16:52:23 +13:00
{% 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>
2024-02-02 16:52:23 +13:00
{% endif %}
<div class="table-responsive-sm pt-4">
2024-02-02 16:52:23 +13:00
<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>
{% if not current_user.is_anonymous %}{% if user_access('ban users', current_user.id) or user_access('manage users', current_user.id) %}<th>Actions</th>{%endif%}{%endif%}
</tr>
{% for domain in domains %}
2024-02-02 16:52:23 +13:00
<tr>
<td><a href="{{ url_for('domain.show_domain', domain_id=domain.id) }}">{{ domain.name }}</a></td>
<td>{{ domain.post_count }}</td>
2024-03-10 20:27:55 +01:00
{% if not current_user.is_anonymous %}
{% if user_access('ban users', current_user.id) or user_access('manage users', current_user.id) %}
<td>
<a class="confirm_first btn btn-primary" 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>
</td>
2024-03-10 20:27:55 +01:00
{% endif %}
{% endif %}
2024-02-02 16:52:23 +13:00
</tr>
{% endfor %}
2024-02-02 16:52:23 +13:00
</table>
</div>
2024-02-02 16:58:30 +13:00
<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>
2023-11-29 22:12:55 +13:00
</div>
</div>
2023-11-29 22:12:55 +13:00
{% endblock %}