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-08 11:44:59 +01:00
2023-11-29 22:12:55 +13:00
< div class = "row" >
< div class = "col-12 col-md-8 position-relative main_pane" >
< nav 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 >
2024-03-08 11:44:59 +01:00
< div class = "btn-group mt-1 mb-2" >
< a href = "#" class = "btn {{ 'btn-primary' if sort == 'hot' else 'btn-outline-secondary' }}" rel = "nofollow noindex" >
{{ _('Banned') }}
< / a >
< a href = "#" class = "btn {{ 'btn-primary' if sort == 'top' else 'btn-outline-secondary' }}" rel = "nofollow noindex" >
{{ _('Allowed') }}
< / a >
< a href = "#" class = "btn {{ 'btn-primary' if sort == 'new' else 'btn-outline-secondary' }}" rel = "nofollow noindex" >
{{ _('Blocked') }}
< / a >
< a href = "#" class = "btn {{ 'btn-primary' if sort == 'active' else 'btn-outline-secondary' }}" rel = "nofollow noindex" >
{{ _('Active') }}
< / a >
< / div >
2024-02-02 16:52:23 +13:00
{% if search == '' %}
2023-11-29 22:12:55 +13:00
< h1 class = "mt-2" > {{ _('All known domains') }}< / h1 >
2024-02-02 16:52:23 +13:00
{% else %}
< h1 class = "mt-2" > {{ _('Domains containing %(search)s', search=search) }}< / h1 >
{% endif %}
< form method = "get" > < input type = "search" name = "search" value = "{{ search }}" placeholder = "{{ _('Search') }}" autofocus > < / form >
2024-03-08 11:44:59 +01:00
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 >
< th > < span title = "{{ _('Has the domain been banned or allowed?') }}" > Status< / span > < / th >
< th > Actions< / th >
< / 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 >
< th > {{ 'Banned'|safe if domain.banned else 'Allowed'|safe }}< / th >
< td >
{% if domain.blocked_by(current_user) %}
< a href = "/d/{{ domain.id }}/unblock" title = "{{ _('Unblocking the domain allows you to see posts with that domain again') }}" > {{ _('Unblock') }}< / a >
{% else %}
< a href = "/d/{{ domain.id }}/block" title = "{{ _('Blocking the domain means you wont see posts that reference it') }}" > {{ _('Block') }}< / a >
{% endif %}
{% if user_access('ban users', current_user.id) or user_access('manage users', current_user.id) %}
{% if domain.banned %}
< a class = "confirm_first" title = "{{ _('Unbanning this domain allows future posts linking to that domain.') }}" href = "/d/{{ domain.id }}/unban" > {{ _('Unban') }}< / a >
{% else %}
< a class = "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 >
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-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 >
{% endblock %}
2024-03-08 11:44:59 +01:00