pyfedi/app/templates/domain/domains.html

79 lines
3.7 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="card col-md-8" style="max-width:unset;">
<div class="card-header">
<nav class="mb-2" aria-label="breadcrumb" id="breadcrumb_nav" title="Navigation">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/">{{ _('Home') }}</a></li>
<li class="breadcrumb-item active">Domains</li>
</ol>
</nav>
<ul class="nav nav-tabs flex-column flex-sm-row card-header-tabs">
<li class="nav-item">
<a class="flex-sm-fill text-sm-center nav-link active" href="/domains">All Domains</a>
</li>
{% if not current_user.is_anonymous %}
<li class="nav-item">
{% if not ban_visibility_permission %}
<span title="{{ _('Your account is either too new or too low reputation to be able to see banned domains') }}">
<a class="flex-sm-fill text-sm-center nav-link disabled" href="/domains/banned">Banned Domains</a></span>{% else %}
<a class="flex-sm-fill text-sm-center nav-link" href="/domains/banned">Banned Domains</a>
{% endif %}
</li>
{% endif %}
</ul>
</div>
<div class="card-body">
<h1 class="">{{ _('Domains') }}</h1>
{% if search == '' %}
<p class="card-text">All domains this instance knows about</p>
{% else %}
<p class="card-text">Domains containing "{{ _('%(search)s', search=search) }}"</p>
{% endif %}
<form method="get"><input type="search" name="search" value="{{ search }}" placeholder="{{ _('Search') }}" autofocus></form>
<div class="table-responsive-sm">
<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 %}
<tr>
<td><a href="{{ url_for('domain.show_domain', domain_id=domain.id) }}">{{ domain.name }}</a></td>
<td>{{ domain.post_count }}</td>
<td>
{% if not current_user.is_anonymous %}
{% if user_access('ban users', current_user.id) or user_access('manage users', current_user.id) %}
<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>
{% 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>
</div>
{% endblock %}