diff --git a/app/domain/routes.py b/app/domain/routes.py index db00d930..ea038919 100644 --- a/app/domain/routes.py +++ b/app/domain/routes.py @@ -62,11 +62,39 @@ def domains(): domains = domains.order_by(Domain.name) domains = domains.paginate(page=page, per_page=100, error_out=False) + ban_visibility_permission = False + + if not current_user.is_anonymous: + if not current_user.created_recently() and current_user.reputation > 100 or current_user.is_admin(): + ban_visibility_permission = True + next_url = url_for('domain.domains', page=domains.next_num) if domains.has_next else None prev_url = url_for('domain.domains', page=domains.prev_num) if domains.has_prev and page != 1 else None return render_template('domain/domains.html', title='All known domains', domains=domains, - next_url=next_url, prev_url=prev_url, search=search) + next_url=next_url, prev_url=prev_url, search=search, ban_visibility_permission=ban_visibility_permission) + +@bp.route('/domains/banned', methods=['GET']) +@login_required +def blocked_domains(): + page = request.args.get('page', 1, type=int) + search = request.args.get('search', '') + + domains = Domain.query.filter_by(banned=True) + if search != '': + domains = domains.filter(Domain.name.ilike(f'%{search}%')) + domains = domains.order_by(Domain.name) + domains = domains.paginate(page=page, per_page=100, error_out=False) + + ban_visibility_permission = False + if not current_user.created_recently() and current_user.reputation > 100 or current_user.is_admin(): + ban_visibility_permission = True + + next_url = url_for('domain.domains', page=domains.next_num) if domains.has_next else None + prev_url = url_for('domain.domains', page=domains.prev_num) if domains.has_prev and page != 1 else None + + return render_template('domain/domains_banned.html', title='Domains banned on this instance', domains=domains, + next_url=next_url, prev_url=prev_url, search=search, ban_visibility_permission=ban_visibility_permission) @bp.route('/d//block') diff --git a/app/static/structure.css b/app/static/structure.css index 4f3465ee..ca808a19 100644 --- a/app/static/structure.css +++ b/app/static/structure.css @@ -1288,4 +1288,15 @@ fieldset legend { max-width: 100%; } +@media (orientation: portrait) { + .flex-sm-fill.text-sm-center.nav-link.active{ + border-bottom: var(--bs-nav-tabs-border-width) solid var(--bs-border-color); + border-bottom-right-radius: var(--bs-nav-tabs-border-radius); + border-bottom-left-radius: var(--bs-nav-tabs-border-radius); + } + .card-header-tabs { + margin-bottom:8px; + } +} + /*# sourceMappingURL=structure.css.map */ diff --git a/app/templates/community/add_post.html b/app/templates/community/add_post.html index 70cbdd65..1f0a07c3 100644 --- a/app/templates/community/add_post.html +++ b/app/templates/community/add_post.html @@ -114,7 +114,7 @@