diff --git a/files/routes/subs.py b/files/routes/subs.py index 7c296c6b1..c0737ee51 100644 --- a/files/routes/subs.py +++ b/files/routes/subs.py @@ -157,7 +157,7 @@ def unblock_sub(v, sub): return {"message": "Sub unblocked successfully!"} @app.get("/s//mods") -@is_not_permabanned +@auth_required def mods(v, sub): sub = g.db.query(Sub).filter_by(name=sub.strip().lower()).one_or_none() if not sub: abort(404) @@ -167,6 +167,29 @@ def mods(v, sub): return render_template("sub/mods.html", v=v, sub=sub, users=users) +@app.get("/s//exilees") +@auth_required +def exilees(v, sub): + sub = g.db.query(Sub).filter_by(name=sub.strip().lower()).one_or_none() + if not sub: abort(404) + + users = g.db.query(User).join(Exile, Exile.user_id==User.id).filter_by(sub=sub.name).all() + + return render_template("sub/exilees.html", v=v, sub=sub, users=users) + + +@app.get("/s//blockers") +@auth_required +def blockers(v, sub): + sub = g.db.query(Sub).filter_by(name=sub.strip().lower()).one_or_none() + if not sub: abort(404) + + users = g.db.query(User).join(SubBlock, SubBlock.user_id==User.id).filter_by(sub=sub.name).all() + + return render_template("sub/blockers.html", v=v, sub=sub, users=users) + + + @app.post("/s//add_mod") @limiter.limit("1/second;5/day") @is_not_permabanned @@ -342,6 +365,7 @@ def get_sub_css(sub): resp.headers.add("Content-Type", "text/css") return resp + @app.post("/s//banner") @limiter.limit("1/second;10/day") @is_not_permabanned diff --git a/files/templates/home.html b/files/templates/home.html index ae6c74e3c..ded9c6584 100644 --- a/files/templates/home.html +++ b/files/templates/home.html @@ -88,13 +88,13 @@ {{sort | capitalize}} diff --git a/files/templates/sidebar_Drama.html b/files/templates/sidebar_Drama.html index dd040e0f4..b1dc159f7 100644 --- a/files/templates/sidebar_Drama.html +++ b/files/templates/sidebar_Drama.html @@ -7,15 +7,12 @@ {% set image = "/static/" + path + "/" + listdir('files/' + path)|random() + '?a=33' %} {% endif %} - - - + sidebar image {% if sub %} {% if sub.sidebar_html %} -
{{sub.sidebar_html|safe}}
+
{{sub.sidebar_html|safe}}
{% endif %} - MODS {% if v and v.mods(sub.name) %} SUB SETTINGS {% endif %} @@ -23,6 +20,9 @@ BLOCK SUB UNBLOCK SUB {% endif %} + MODS + EXILEES + BLOCKERS {% else %} EMOJI MEGATHREAD BUGS/SUGGESTIONS MEGATHREAD diff --git a/files/templates/sidebar_PCM.html b/files/templates/sidebar_PCM.html index c8879b777..561dbccce 100644 --- a/files/templates/sidebar_PCM.html +++ b/files/templates/sidebar_PCM.html @@ -2,9 +2,8 @@ {% if sub %} {% if sub.sidebar_html %} -
{{sub.sidebar_html|safe}}
+
{{sub.sidebar_html|safe}}
{% endif %} - MODS {% if v and v.mods(sub.name) %} SUB SETTINGS {% endif %} @@ -12,6 +11,9 @@ BLOCK SUB UNBLOCK SUB {% endif %} + MODS + EXILEES + BLOCKERS {% endif %} CREATE SUB diff --git a/files/templates/sidebar_Ruqqus.html b/files/templates/sidebar_Ruqqus.html index b9fff5ae0..49595ad20 100644 --- a/files/templates/sidebar_Ruqqus.html +++ b/files/templates/sidebar_Ruqqus.html @@ -5,13 +5,12 @@ {% set image='/static/assets/images/' + SITE_NAME + '/sidebar.webp?a=1041' %} {% endif %} - sidebar image + sidebar image {% if sub %} {% if sub.sidebar_html %} -
{{sub.sidebar_html|safe}}
+
{{sub.sidebar_html|safe}}
{% endif %} - MODS {% if v and v.mods(sub.name) %} SUB SETTINGS {% endif %} @@ -19,6 +18,9 @@ BLOCK SUB UNBLOCK SUB {% endif %} + MODS + EXILEES + BLOCKERS {% else %}

Rules: No doxxing, No CP or other clearly illegal shit. Also no nazis, go to communities.win. Thanks!

{% endif %} diff --git a/files/templates/sub/blockers.html b/files/templates/sub/blockers.html new file mode 100644 index 000000000..8c6087879 --- /dev/null +++ b/files/templates/sub/blockers.html @@ -0,0 +1,21 @@ +{% extends "default.html" %} +{% block content %} +

+
Users blocking /s/{{sub.name}}
+

+
+ + + + + + +{% for user in users %} + + + + +{% endfor %} +
#Name
{{loop.index}}@{{user.username}}'s profile picture{{user.username}}
+ +{% endblock %} \ No newline at end of file diff --git a/files/templates/sub/exilees.html b/files/templates/sub/exilees.html new file mode 100644 index 000000000..5d7ace83b --- /dev/null +++ b/files/templates/sub/exilees.html @@ -0,0 +1,21 @@ +{% extends "default.html" %} +{% block content %} +

+
Users exiled from /s/{{sub.name}}
+

+
+ + + + + + +{% for user in users %} + + + + +{% endfor %} +
#Name
{{loop.index}}@{{user.username}}'s profile picture{{user.username}}
+ +{% endblock %} \ No newline at end of file