From adb048c61b8d51227b3c518a77d12e5882ed8f63 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 14 Feb 2022 02:44:57 +0200 Subject: [PATCH] fd --- files/classes/__init__.py | 3 +- files/classes/sub_block.py | 12 +++ files/routes/subs.py | 2 +- files/templates/authforms.html | 4 +- files/templates/comments.html | 110 ++++++++++++------------ files/templates/default.html | 4 +- files/templates/log.html | 4 +- files/templates/login.html | 2 +- files/templates/login_2fa.html | 2 +- files/templates/settings.html | 2 +- files/templates/settings2.html | 4 +- files/templates/sidebar_Ruqqu.html | 0 files/templates/sign_up.html | 2 +- files/templates/sign_up_failed_ref.html | 2 +- files/templates/sub/create_sub.html | 2 +- files/templates/submission.html | 104 +++++++++++----------- files/templates/submit.html | 4 +- 17 files changed, 143 insertions(+), 120 deletions(-) create mode 100644 files/classes/sub_block.py create mode 100644 files/templates/sidebar_Ruqqu.html diff --git a/files/classes/__init__.py b/files/classes/__init__.py index 11a5cc67a..ee4ae58d9 100644 --- a/files/classes/__init__.py +++ b/files/classes/__init__.py @@ -16,4 +16,5 @@ from .subscriptions import * from files.__main__ import app from .mod_logs import * from .award import * -from .marsey import * \ No newline at end of file +from .marsey import * +from .sub_block import * \ No newline at end of file diff --git a/files/classes/sub_block.py b/files/classes/sub_block.py new file mode 100644 index 000000000..56ae099b1 --- /dev/null +++ b/files/classes/sub_block.py @@ -0,0 +1,12 @@ +from sqlalchemy import * +from sqlalchemy.orm import relationship +from files.__main__ import Base + +class SubBlock(Base): + + __tablename__ = "sub_blocks" + user_id = Column(Integer, ForeignKey("users.id"), primary_key=True) + sub = Column(String, ForeignKey("subs.name"), primary_key=True) + + def __repr__(self): + return f"" \ No newline at end of file diff --git a/files/routes/subs.py b/files/routes/subs.py index a3af3ff45..baac36135 100644 --- a/files/routes/subs.py +++ b/files/routes/subs.py @@ -4,7 +4,7 @@ from files.helpers.wrappers import * from files.classes import * from .front import frontlist -valid_sub_regex = re.compile("^[a-zA-Z0-9_\-]{3,25}$") +valid_sub_regex = re.compile("^[a-zA-Z0-9_\-]{3,20}$") @app.get("/s//mods") @is_not_permabanned diff --git a/files/templates/authforms.html b/files/templates/authforms.html index 280381a81..6879728fd 100644 --- a/files/templates/authforms.html +++ b/files/templates/authforms.html @@ -15,7 +15,7 @@ {% if v %} - + {% if v.agendaposter %} - + {% endif %} diff --git a/files/templates/comments.html b/files/templates/comments.html index 5287f9f23..aa349b17c 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -490,62 +490,66 @@ {% endif %} {% endif %} - {% if v and v.admin_level and v.id==c.author_id %} - - - {% endif %} - - {% if v and v.id != c.author_id and not c.ghost %} - - - - - - {% endif %} - - {% if v and c.post %} - {% set url = "" %} + {% if v %} + + {% endif %} - - - {% if v and v.admin_level > 1 %} - {% if "/reported/" in request.path %} - - - {% else %} - - - {% endif %} - {% endif %} - - {% if v and c.parent_submission and (c.author_id==v.id or v.admin_level > 1) %} - - - {% endif %} - - {% if v and v.admin_level > 1 and v.id != c.author_id %} - - - {% endif %} - - {% if v and v.admin_level > 1 and c.oauth_app %} - API App - {% endif %} - + + {% endif %} diff --git a/files/templates/default.html b/files/templates/default.html index a2b05c846..726fa76b5 100644 --- a/files/templates/default.html +++ b/files/templates/default.html @@ -7,7 +7,7 @@ {% if v %} - + {% if v.agendaposter %} - + {% endif %} {% if sub and sub.css and not request.path.endswith('settings') %} diff --git a/files/templates/log.html b/files/templates/log.html index d5a6df6f9..91e912c7e 100644 --- a/files/templates/log.html +++ b/files/templates/log.html @@ -6,7 +6,7 @@ {% block content %} {% if v %} - + {% if v.agendaposter %} - + {% endif %}
diff --git a/files/templates/login.html b/files/templates/login.html index c8a56c7fc..9c780a8be 100644 --- a/files/templates/login.html +++ b/files/templates/login.html @@ -18,7 +18,7 @@ {% endblock %} - + diff --git a/files/templates/login_2fa.html b/files/templates/login_2fa.html index 9e1208e4c..89865d0cd 100644 --- a/files/templates/login_2fa.html +++ b/files/templates/login_2fa.html @@ -14,7 +14,7 @@ 2-Step Login - {{SITE_NAME}} - + diff --git a/files/templates/settings.html b/files/templates/settings.html index 47e2f8deb..0a3f7875f 100644 --- a/files/templates/settings.html +++ b/files/templates/settings.html @@ -34,7 +34,7 @@ - + {% if v.agendaposter %} - + {% else %} - + {% endif %} diff --git a/files/templates/sidebar_Ruqqu.html b/files/templates/sidebar_Ruqqu.html new file mode 100644 index 000000000..e69de29bb diff --git a/files/templates/sign_up.html b/files/templates/sign_up.html index d1e2f061f..f9dd09d98 100644 --- a/files/templates/sign_up.html +++ b/files/templates/sign_up.html @@ -31,7 +31,7 @@ {% if ref_user %}{{ref_user.username}} invites you to {{SITE_NAME}}{% else %}Sign up - {{SITE_NAME}}{% endif %} - + diff --git a/files/templates/sign_up_failed_ref.html b/files/templates/sign_up_failed_ref.html index 2fcb7aa77..adeaf6ebe 100644 --- a/files/templates/sign_up_failed_ref.html +++ b/files/templates/sign_up_failed_ref.html @@ -32,7 +32,7 @@ {% if ref_user %}{{ref_user.username}} invites you to {{SITE_NAME}}{% else %}{{SITE_NAME}}{% endif %} - + diff --git a/files/templates/sub/create_sub.html b/files/templates/sub/create_sub.html index 258486cbe..b71c29404 100644 --- a/files/templates/sub/create_sub.html +++ b/files/templates/sub/create_sub.html @@ -30,7 +30,7 @@ - Names must be 3-25 characters + Names must be 3-20 characters
diff --git a/files/templates/submission.html b/files/templates/submission.html index ee4cefa15..f2085032b 100644 --- a/files/templates/submission.html +++ b/files/templates/submission.html @@ -691,15 +691,17 @@ Give Award {% endif %} - Copy link + Copy link {% if v %} Subscribe Unsubscribe + {% endif %} + {% if v %} Save Unsave - + Report {% endif %} @@ -708,66 +710,70 @@ Pin to profile Unpin from profile {% endif %} - - Undelete - Delete - {% endif %} + Undelete - {% if v %} - {% if v.admin_level %} - Distinguish - Undistinguish + Delete {% endif %} - {% if v.admin_level > 1 %} - Pin - Unpin - {% endif %} - - {% if v.admin_level > 1 or v.id == p.author.id and v.club_allowed != False %} - Mark club - Unmark club - {% endif %} - - {% if v.admin_level > 1 %} - {% if "/reported/" in request.path %} - {% if v.id != p.author.id %}Remove{% endif %} - Approve - {% else %} - {% if v.id != p.author.id %}Remove{% endif %} - Approve + {% if v %} + + {% endif %} - - + diff --git a/files/templates/submit.html b/files/templates/submit.html index 860b18765..5de66a12b 100644 --- a/files/templates/submit.html +++ b/files/templates/submit.html @@ -26,7 +26,7 @@ {% block stylesheets %} {% if v %} - + {% if v.agendaposter %} - + {% endif %} {% endblock %}