From 04c08699003e060daf0fea6a3d753871e4f395fe Mon Sep 17 00:00:00 2001 From: Aevann Date: Fri, 8 Mar 2024 03:56:24 +0200 Subject: [PATCH] use versions verbiage --- files/helpers/config/const.py | 2 +- files/routes/admin.py | 6 +++--- files/templates/comments.html | 4 ++-- files/templates/edits.html | 4 ++-- files/templates/util/macros.html | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/files/helpers/config/const.py b/files/helpers/config/const.py index af511aa72..bf7e332ec 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_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..f37e86765 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("/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 VIEW_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_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..52d85a802 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_VERSIONS']) %} +   Edited {{c.edited_string}} {% else %} diff --git a/files/templates/edits.html b/files/templates/edits.html index b7e688909..22770b26c 100644 --- a/files/templates/edits.html +++ b/files/templates/edits.html @@ -1,7 +1,7 @@ {% extends "default.html" %} -{% block pagetitle %}Edits of {{obj.shortlink}}{% endblock %} +{% block pagetitle %}Versions of /{% if obj.fullname.startswith('p_') %}post{% else %}comment{% endif %}/{{obj.id}}{% endblock %} {% block content %} -

Edits of {{obj.textlink | safe}}

+

Versions of /{% if obj.fullname.startswith('p_') %}post{% else %}comment{% endif %}/{{obj.id}}

diff --git a/files/templates/util/macros.html b/files/templates/util/macros.html index 9a7a8935f..4ff6bc49d 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_VERSIONS']) %} + Edited {{p.edited_string}} {% else %} Edited {{p.edited_string}} {% endif %}