From dd75c8818960faa73e393fb838efe69c74cd252b Mon Sep 17 00:00:00 2001 From: Hendrik L Date: Fri, 27 Dec 2024 23:42:41 +0100 Subject: [PATCH] rename template --- app/admin/routes.py | 12 ++++++------ app/templates/admin/{posts.html => content.html} | 4 ++-- app/templates/base.html | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) rename app/templates/admin/{posts.html => content.html} (95%) diff --git a/app/admin/routes.py b/app/admin/routes.py index e4978f38..5444b0f2 100644 --- a/app/admin/routes.py +++ b/app/admin/routes.py @@ -1192,20 +1192,20 @@ def admin_users(): ) -@bp.route('/content/trash', methods=['GET']) +@bp.route('/content', methods=['GET']) @login_required @permission_required('administer all users') -def admin_content_trash(): +def admin_content(): page = request.args.get('page', 1, type=int) posts = Post.query.filter(Post.posted_at > utcnow() - timedelta(days=3), Post.deleted == False, Post.down_votes > 0).order_by(Post.score) posts = posts.paginate(page=page, per_page=100, error_out=False) - next_url = url_for('admin.admin_content_trash', page=posts.next_num) if posts.has_next else None - prev_url = url_for('admin.admin_content_trash', page=posts.prev_num) if posts.has_prev and page != 1 else None + next_url = url_for('admin.admin_content', page=posts.next_num) if posts.has_next else None + prev_url = url_for('admin.admin_content', page=posts.prev_num) if posts.has_prev and page != 1 else None - return render_template('admin/posts.html', title=_('Bad posts'), next_url=next_url, prev_url=prev_url, posts=posts, + return render_template('admin/content.html', title=_('Bad posts'), next_url=next_url, prev_url=prev_url, posts=posts, moderating_communities=moderating_communities(current_user.get_id()), joined_communities=joined_communities(current_user.get_id()), menu_topics=menu_topics(), @@ -1217,7 +1217,7 @@ def admin_content_trash(): @login_required @permission_required('administer all users') def admin_content_spam(): - # Essentially the same as admin_content_trash() except only shows heavily downvoted posts by new users - who are usually spammers + # Essentially the same as admin_content() except only shows heavily downvoted posts by new users - who are usually spammers page = request.args.get('page', 1, type=int) replies_page = request.args.get('replies_page', 1, type=int) diff --git a/app/templates/admin/posts.html b/app/templates/admin/content.html similarity index 95% rename from app/templates/admin/posts.html rename to app/templates/admin/content.html index 69d8aa8d..4059190e 100644 --- a/app/templates/admin/posts.html +++ b/app/templates/admin/content.html @@ -4,7 +4,7 @@ {% extends "base.html" %} {% endif %} {% from 'bootstrap/form.html' import render_form %} -{% set active_child = 'admin_content_trash' %} +{% set active_child = 'admin_content' %} {% block app_content %}
@@ -36,4 +36,4 @@

-{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/app/templates/base.html b/app/templates/base.html index 4070cce7..aa8b9894 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -229,7 +229,7 @@
  • {{ _('Communities') }}
  • {{ _('Topics') }}
  • {{ _('Users') }}
  • -
  • {{ _('Monitoring - content') }}
  • +
  • {{ _('Monitoring - content') }}
  • {{ _('Monitoring - spammy content') }}
  • {{ _('Deleted content') }}
  • {% if g.site.registration_mode == 'RequireApplication' %}