From dbc08a2579ee774a9a9464778890940cf1952653 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Tue, 12 Oct 2021 07:39:03 +0200 Subject: [PATCH] sdfdsf --- files/routes/front.py | 8 +++++++- files/templates/authforms.html | 6 +++--- files/templates/default.html | 8 ++++---- files/templates/emoji_modal.html | 2 +- files/templates/log.html | 6 +++--- files/templates/login_2fa.html | 2 +- files/templates/settings.html | 4 ++-- files/templates/settings2.html | 4 ++-- files/templates/sign_up.html | 2 +- files/templates/sign_up_failed_ref.html | 2 +- files/templates/submit.html | 8 ++++---- 11 files changed, 29 insertions(+), 23 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index 6260bb913..070eee2ab 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -218,7 +218,13 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, filter_words=' posts = posts[:size] - if page == 1: posts = g.db.query(Submission.id).options(lazyload('*')).filter(Submission.stickied != None).all() + posts + pins = g.db.query(Submission.id).options(lazyload('*')).filter(Submission.stickied != None) + if v and v.admin_level == 0: + blocking = [x[0] for x in g.db.query(UserBlock.target_id).filter_by(user_id=v.id).all()] + blocked = [x[0] for x in g.db.query(UserBlock.user_id).filter_by(target_id=v.id).all()] + pins = pins.filter(Submission.author_id.notin_(blocking), Submission.author_id.notin_(blocked)) + + if page == 1: posts = pins + posts if ids_only: posts = [x[0] for x in posts] diff --git a/files/templates/authforms.html b/files/templates/authforms.html index 03ad7dddb..5556b35de 100644 --- a/files/templates/authforms.html +++ b/files/templates/authforms.html @@ -15,11 +15,11 @@ {% if v %} - - {% if v.agendaposter %}{% elif v.css %}{% endif %} + + {% if v.agendaposter %}{% elif v.css %}{% endif %} {% else %} - + {% endif %} diff --git a/files/templates/default.html b/files/templates/default.html index 7af6b65cb..63287cfa6 100644 --- a/files/templates/default.html +++ b/files/templates/default.html @@ -250,12 +250,12 @@ {% if v %} - - - {% if v.agendaposter %}{% elif v.css %}{% endif %} + + + {% if v.agendaposter %}{% elif v.css %}{% endif %} {% else %} - + {% endif %} {% endblock %} diff --git a/files/templates/emoji_modal.html b/files/templates/emoji_modal.html index 7c1a0ecdc..7ce3c798c 100644 --- a/files/templates/emoji_modal.html +++ b/files/templates/emoji_modal.html @@ -1,4 +1,4 @@ - + - - {% if v.agendaposter %}{% elif v.css %}{% endif %} + + {% if v.agendaposter %}{% elif v.css %}{% endif %} {% else %} - + {% endif %}
diff --git a/files/templates/login_2fa.html b/files/templates/login_2fa.html index 4c75f4153..175859287 100644 --- a/files/templates/login_2fa.html +++ b/files/templates/login_2fa.html @@ -12,7 +12,7 @@ 2-Step Login - {{'SITE_NAME' | app_config}} - + diff --git a/files/templates/settings.html b/files/templates/settings.html index 12b8c3819..d15e6774b 100644 --- a/files/templates/settings.html +++ b/files/templates/settings.html @@ -55,8 +55,8 @@ - - {% if v.agendaposter %}{% elif v.css %}{% endif %} + + {% if v.agendaposter %}{% elif v.css %}{% endif %} diff --git a/files/templates/settings2.html b/files/templates/settings2.html index 7f0d8bc76..8f00cb072 100644 --- a/files/templates/settings2.html +++ b/files/templates/settings2.html @@ -40,10 +40,10 @@ {% if v %} - + {% else %} - + {% endif %} diff --git a/files/templates/sign_up.html b/files/templates/sign_up.html index 51e6138c0..95ff12425 100644 --- a/files/templates/sign_up.html +++ b/files/templates/sign_up.html @@ -36,7 +36,7 @@ - + diff --git a/files/templates/sign_up_failed_ref.html b/files/templates/sign_up_failed_ref.html index a75da1cdb..3c6d3d2d2 100644 --- a/files/templates/sign_up_failed_ref.html +++ b/files/templates/sign_up_failed_ref.html @@ -31,7 +31,7 @@ - + diff --git a/files/templates/submit.html b/files/templates/submit.html index 87c9a73e5..5cc3cb5cf 100644 --- a/files/templates/submit.html +++ b/files/templates/submit.html @@ -25,12 +25,12 @@ {% block stylesheets %} {% if v %} - - {% if v.agendaposter %}{% elif v.css %}{% endif %} + + {% if v.agendaposter %}{% elif v.css %}{% endif %} {% else %} - - + + {% endif %} {% endblock %}