forked from MarseyWorld/MarseyWorld
use versions verbiage
parent
f1328681cd
commit
04c0869900
|
@ -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,
|
||||
|
|
|
@ -2232,18 +2232,18 @@ def unmark_effortpost(pid, v):
|
|||
|
||||
return {"message": "Post has been unmarked as an effortpost!"}
|
||||
|
||||
@app.get("/edits/<link>")
|
||||
@app.get("/versions/<link>")
|
||||
@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)
|
||||
|
|
|
@ -233,8 +233,8 @@
|
|||
|
||||
<a class="vertical-align ml-1" href="{{c.permalink}}">#{{c.id}}</a>
|
||||
|
||||
{% if c.edited_utc and v and (v.id == c.author_id or v.admin_level >= PERMS['VIEW_EDITS']) %}
|
||||
<a href="/edits/{{c.fullname}}" class="font-italic" data-nonce="{{g.nonce}}" data-bs-toggle="tooltip" data-bs-placement="bottom" data-onmouseover="timestamp(this, '{{c.edited_utc}}')">
|
||||
{% if c.edited_utc and v and (v.id == c.author_id or v.admin_level >= PERMS['VIEW_VERSIONS']) %}
|
||||
<a href="/versions/{{c.fullname}}" class="font-italic" data-nonce="{{g.nonce}}" data-bs-toggle="tooltip" data-bs-placement="bottom" data-onmouseover="timestamp(this, '{{c.edited_utc}}')">
|
||||
Edited <span id="comment-edited_string-{{c.id}}">{{c.edited_string}}</span>
|
||||
</a>
|
||||
{% else %}
|
||||
|
|
|
@ -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 %}
|
||||
<h2>Edits of {{obj.textlink | safe}}</h2>
|
||||
<h2 class="my-4 py-md-2">Versions of <a href="{{obj.permalink}}">/{% if obj.fullname.startswith('p_') %}post{% else %}comment{% endif %}/{{obj.id}}</h2>
|
||||
<div class="overflow-x-auto">
|
||||
<table>
|
||||
<thead>
|
||||
|
|
|
@ -125,8 +125,8 @@
|
|||
{% endif %}
|
||||
|
||||
{% if p.edited_utc %}
|
||||
{% if v and (v.id == p.author_id or v.admin_level >= PERMS['VIEW_EDITS']) %}
|
||||
<a href="/edits/{{p.fullname}}" class="ml-2 d-inline-block">Edited <span data-bs-toggle="tooltip" data-bs-placement="bottom" id="edited_timestamp-{{p.id}}" data-nonce="{{g.nonce}}" data-onmouseover="timestamp(this, '{{p.edited_utc}}')">{{p.edited_string}}</span></a>
|
||||
{% if v and (v.id == p.author_id or v.admin_level >= PERMS['VIEW_VERSIONS']) %}
|
||||
<a href="/versions/{{p.fullname}}" class="ml-2 d-inline-block">Edited <span data-bs-toggle="tooltip" data-bs-placement="bottom" id="edited_timestamp-{{p.id}}" data-nonce="{{g.nonce}}" data-onmouseover="timestamp(this, '{{p.edited_utc}}')">{{p.edited_string}}</span></a>
|
||||
{% else %}
|
||||
<span class="ml-2 d-inline-block">Edited <span data-bs-toggle="tooltip" data-bs-placement="bottom" id="edited_timestamp-{{p.id}}" data-nonce="{{g.nonce}}" data-onmouseover="timestamp(this, '{{p.edited_utc}}')">{{p.edited_string}}</span></span>
|
||||
{% endif %}
|
||||
|
|
Loading…
Reference in New Issue