diff --git a/app/admin/routes.py b/app/admin/routes.py index ee222409..579dc19d 100644 --- a/app/admin/routes.py +++ b/app/admin/routes.py @@ -1178,45 +1178,6 @@ def admin_users(): ) -@bp.route('/users/trash', methods=['GET']) -@login_required -@permission_required('administer all users') -def admin_users_trash(): - - page = request.args.get('page', 1, type=int) - search = request.args.get('search', '') - local_remote = request.args.get('local_remote', '') - type = request.args.get('type', 'bad_rep') - - users = User.query.filter_by(deleted=False) - if local_remote == 'local': - users = users.filter_by(ap_id=None) - if local_remote == 'remote': - users = users.filter(User.ap_id != None) - if search: - users = users.filter(User.email.ilike(f"%{search}%")) - - if type == '' or type == 'bad_rep': - users = users.filter(User.last_seen > utcnow() - timedelta(days=7)) - users = users.filter(User.reputation < -10) - users = users.order_by(User.reputation).paginate(page=page, per_page=1000, error_out=False) - elif type == 'bad_attitude': - users = users.filter(User.last_seen > utcnow() - timedelta(days=7)) - users = users.filter(User.attitude < 0.0).filter(User.reputation < -10) - users = users.order_by(User.attitude).paginate(page=page, per_page=1000, error_out=False) - - next_url = url_for('admin.admin_users_trash', page=users.next_num, search=search, local_remote=local_remote, type=type) if users.has_next else None - prev_url = url_for('admin.admin_users_trash', page=users.prev_num, search=search, local_remote=local_remote, type=type) if users.has_prev and page != 1 else None - - return render_template('admin/users_trash.html', title=_('Problematic users'), next_url=next_url, prev_url=prev_url, users=users, - local_remote=local_remote, search=search, type=type, - moderating_communities=moderating_communities(current_user.get_id()), - joined_communities=joined_communities(current_user.get_id()), - menu_topics=menu_topics(), - site=g.site - ) - - @bp.route('/content/trash', methods=['GET']) @login_required @permission_required('administer all users') diff --git a/app/templates/admin/_nav.html b/app/templates/admin/_nav.html index dea6efd2..addf534b 100644 --- a/app/templates/admin/_nav.html +++ b/app/templates/admin/_nav.html @@ -6,7 +6,6 @@ {{ _('Communities') }} | {{ _('Topics') }} | {{ _('Users') }} | - {{ _('Watch') }} | {% if site.registration_mode == 'RequireApplication' %} {{ _('Registration applications') }} | {% endif %} diff --git a/app/templates/admin/users_trash.html b/app/templates/admin/users_trash.html deleted file mode 100644 index 2257353f..00000000 --- a/app/templates/admin/users_trash.html +++ /dev/null @@ -1,73 +0,0 @@ -{% 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 %} -{% set active_child = 'admin_users_trash' %} - -{% block app_content %} -
-
-

{{ _('Users') }}

- {{ _('Add local user') }} -
- - - - - - -
- - - - - - - - - - - {% for user in users.items %} - - - - - - - - - - {% endfor %} -
NameSeenAttitudeRepBannedReportsActions
{{ render_username(user, add_domain=False) }}
- {{ user.user_name }}{% if not user.is_local() %}@{{ user.ap_domain }}{% endif %}
{% if request.args.get('local_remote', '') == 'local' %} - {{ arrow.get(user.last_seen).humanize(locale=locale) }} - {% else %} - {{ user.last_seen }} - {% endif %} - {% if user.attitude != 1 %}{{ (user.attitude * 100) | round | int }}%{% endif %}{% if user.reputation %}R {{ user.reputation | round | int }}{% endif %}{{ 'Banned'|safe if user.banned }} {{ user.reports if user.reports > 0 }} Edit | - Delete -
- -
-
-
-
-
- {% include 'admin/_nav.html' %} -
-
-
-{% endblock %} diff --git a/app/templates/base.html b/app/templates/base.html index a7467df1..ab2ad7b1 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -217,7 +217,6 @@
  • {{ _('Communities') }}
  • {{ _('Topics') }}
  • {{ _('Users') }}
  • -
  • {{ _('Monitoring - users') }}
  • {{ _('Monitoring - content') }}
  • {{ _('Monitoring - spammy content') }}
  • {{ _('Deleted content') }}