From 55f4c6c3f13c846ae2e1ddd394c4301805174055 Mon Sep 17 00:00:00 2001 From: Aevann Date: Fri, 8 Mar 2024 03:48:25 +0200 Subject: [PATCH] edits -> old versions --- files/helpers/config/const.py | 2 +- files/routes/admin.py | 6 +++--- files/templates/comments.html | 4 ++-- files/templates/edits.html | 2 +- files/templates/util/macros.html | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/files/helpers/config/const.py b/files/helpers/config/const.py index af511aa72..f53a8879b 100644 --- a/files/helpers/config/const.py +++ b/files/helpers/config/const.py @@ -171,7 +171,7 @@ PERMS = { # Minimum admin_level to perform action. 'VIEW_ACTIVE_USERS': 1, 'VIEW_ALT_VOTES': 1, 'VIEW_LAST_ACTIVE': 1, - 'VIEW_EDITS': 1, + 'VIEW_OLD_VERSIONS': 1, 'ENABLE_VOTE_BUTTONS_ON_USER_PAGE': 1, 'NOTIFICATIONS_MODERATOR_ACTIONS': 1, 'EXEMPT_FROM_IP_LOGGING': 1, diff --git a/files/routes/admin.py b/files/routes/admin.py index 0cbd02957..2bdc8fc06 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -2232,18 +2232,18 @@ def unmark_effortpost(pid, v): return {"message": "Post has been unmarked as an effortpost!"} -@app.get("/edits/") +@app.get("/old_versions/") @limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400) @limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400, key_func=get_ID) @auth_required -def view_edits(v, link): +def old_versions(v, link): try: if "p_" in link: obj = get_post(int(link.split("p_")[1]), v=v) elif "c_" in link: obj = get_comment(int(link.split("c_")[1]), v=v) else: abort(400) except: abort(400) - if v.id != obj.author_id and v.admin_level < PERMS['VIEW_EDITS']: + if v.id != obj.author_id and v.admin_level < PERMS['VIEW_OLD_VERSIONS']: abort(403, "You can't view other people's edits!") return render_template("edits.html", v=v, obj=obj) diff --git a/files/templates/comments.html b/files/templates/comments.html index a338fe7d9..480c846ad 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -233,8 +233,8 @@ #{{c.id}} - {% if c.edited_utc and v and (v.id == c.author_id or v.admin_level >= PERMS['VIEW_EDITS']) %} - + {% if c.edited_utc and v and (v.id == c.author_id or v.admin_level >= PERMS['VIEW_OLD_VERSIONS']) %} +   Edited {{c.edited_string}} {% else %} diff --git a/files/templates/edits.html b/files/templates/edits.html index de99f44f1..87d2b0d9f 100644 --- a/files/templates/edits.html +++ b/files/templates/edits.html @@ -1,5 +1,5 @@ {% extends "default.html" %} -{% block pagetitle %}Edits on {{obj.shortlink}}{% endblock %} +{% block pagetitle %}Old versions of {{obj.shortlink}}{% endblock %} {% block content %}

Old versions of {{obj.textlink | safe}}

diff --git a/files/templates/util/macros.html b/files/templates/util/macros.html index 9a7a8935f..8469eaa52 100644 --- a/files/templates/util/macros.html +++ b/files/templates/util/macros.html @@ -125,8 +125,8 @@ {% endif %} {% if p.edited_utc %} - {% if v and (v.id == p.author_id or v.admin_level >= PERMS['VIEW_EDITS']) %} - Edited {{p.edited_string}} + {% if v and (v.id == p.author_id or v.admin_level >= PERMS['VIEW_OLD_VERSIONS']) %} + Edited {{p.edited_string}} {% else %} Edited {{p.edited_string}} {% endif %}