2024-02-07 17:31:12 +13:00
{% 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 %}
2024-03-11 20:14:12 +13:00
< div class = "row" >
< div class = "col-12 col-md-8 position-relative main_pane" >
2024-02-02 16:52:23 +13:00
{% if search == '' %}
2024-03-11 20:14:12 +13:00
< h1 > {{ _('Domains') }}< / h1 >
2024-02-02 16:52:23 +13:00
{% else %}
2024-03-11 20:14:12 +13:00
< 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 %}
2024-03-08 11:44:59 +01:00
2024-03-11 20:14:12 +13:00
< div class = "table-responsive-sm pt-4" >
2024-02-02 16:52:23 +13:00
< table class = "table table-striped" >
2024-03-08 11:44:59 +01:00
< tr >
< th > Domain< / th >
< th > < span title = "{{ _('How many times has something on this domain been posted?') }}" > # Posts< / span > < / th >
2024-03-10 20:17:53 +01:00
{% 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%}
2024-03-08 11:44:59 +01:00
< / tr >
{% for domain in domains %}
2024-02-02 16:52:23 +13:00
< tr >
2024-03-08 11:44:59 +01:00
< 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) %}
2024-03-08 11:44:59 +01:00
< td >
2024-03-11 20:14:12 +13:00
< 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 >
2024-03-08 11:44:59 +01:00
< / td >
2024-03-10 20:27:55 +01:00
{% endif %}
{% endif %}
2024-02-02 16:52:23 +13:00
< / tr >
2024-03-08 11:44:59 +01:00
{% endfor %}
2024-02-02 16:52:23 +13:00
< / table >
2024-03-10 20:17:53 +01:00
< / 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" > ← < / span > {{ _('Previous page') }}
< / a >
{% endif %}
{% if next_url %}
< a href = "{{ next_url }}" class = "btn btn-primary" rel = "nofollow" >
{{ _('Next page') }} < span aria-hidden = "true" > → < / span >
< / a >
{% endif %}
< / nav >
2023-11-29 22:12:55 +13:00
< / div >
< / div >
2024-03-11 20:14:12 +13:00
2023-11-29 22:12:55 +13:00
{% endblock %}
2024-03-08 11:44:59 +01:00