From 95a0edf070143ec2a22ba29bc81a6a7724425a1b Mon Sep 17 00:00:00 2001 From: Aevann Date: Sat, 18 Mar 2023 18:10:14 +0200 Subject: [PATCH] disable "GIVE AWARD" button on carp and pizzashill --- files/assets/css/main.css | 11 ++++++----- files/helpers/config/const.py | 4 ++++ files/routes/awards.py | 2 +- files/routes/jinja2.py | 1 + files/templates/comments.html | 4 ++-- files/templates/post_actions.html | 2 +- files/templates/post_actions_mobile.html | 2 +- 7 files changed, 16 insertions(+), 10 deletions(-) diff --git a/files/assets/css/main.css b/files/assets/css/main.css index c2e59db69..d341af38f 100644 --- a/files/assets/css/main.css +++ b/files/assets/css/main.css @@ -1296,11 +1296,6 @@ nav .nav-link:hover, .nav-link:focus { text-decoration: none; } -.disabled { - color: #6c757d !important; - pointer-events: none !important; - cursor: default !important; -} .nav-pills .nav-link { border-radius: 0.35rem; } @@ -7233,3 +7228,9 @@ button, .btn { font-size: 16px; } } + +[disabled], .disabled, button[disabled], .btn[disabled], button.disabled, .btn.disabled { + color: #6c757d !important; + pointer-events: none !important; + cursor: default !important; +} diff --git a/files/helpers/config/const.py b/files/helpers/config/const.py index af7e9eb0a..469cfd9c1 100644 --- a/files/helpers/config/const.py +++ b/files/helpers/config/const.py @@ -666,6 +666,8 @@ TGTW_ID = 0 IDIO_ID = 0 SNALLY_ID = 0 +IMMUNE_TO_AWARDS = {} + MODMAIL_ID = 2 GIFT_NOTIF_ID = 5 SIGNUP_FOLLOW_ID = 0 @@ -761,6 +763,8 @@ if SITE == 'rdrama.net': IDIO_ID = 30 SNALLY_ID = 3336 + IMMUNE_TO_AWARDS = {PIZZASHILL_ID, CARP_ID} + NOTIFIED_USERS = { 'aevan': AEVANN_ID, 'avean': AEVANN_ID, diff --git a/files/routes/awards.py b/files/routes/awards.py index 3aefcd43b..f85f5a479 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -177,7 +177,7 @@ def award_thing(v, thing_type, id): safe_username = f"@{thing.author_name}" - if SITE == 'rdrama.net' and author.id in {PIZZASHILL_ID, CARP_ID}: + if SITE == 'rdrama.net' and author.id in IMMUNE_TO_AWARDS: abort(403, f"{safe_username} is immune to awards!") if kind == "benefactor" and author.id == v.id: diff --git a/files/routes/jinja2.py b/files/routes/jinja2.py index 91ef9cebd..25d19080c 100644 --- a/files/routes/jinja2.py +++ b/files/routes/jinja2.py @@ -144,4 +144,5 @@ def inject_constants(): "DEFAULT_CONFIG_VALUE":DEFAULT_CONFIG_VALUE, "IS_LOCALHOST":IS_LOCALHOST, "BACKGROUND_CATEGORIES":BACKGROUND_CATEGORIES, "PAGE_SIZE":PAGE_SIZE, "TAGLINES":TAGLINES, "IS_FISTMAS":IS_FISTMAS, "get_alt_graph":get_alt_graph, "current_registered_users":current_registered_users, "git_head":git_head, "max_days":max_days, "BIO_FRIENDS_ENEMIES_LENGTH_LIMIT":BIO_FRIENDS_ENEMIES_LENGTH_LIMIT, + "IMMUNE_TO_AWARDS": IMMUNE_TO_AWARDS, } diff --git a/files/templates/comments.html b/files/templates/comments.html index b772ec15c..bc0f85f9d 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -398,7 +398,7 @@ {% if FEATURES['AWARDS'] -%} - + {%- endif %} @@ -599,7 +599,7 @@ {% if FEATURES['AWARDS'] -%} - + {%- endif %} diff --git a/files/templates/post_actions.html b/files/templates/post_actions.html index d231d9ad8..1efc7c99f 100644 --- a/files/templates/post_actions.html +++ b/files/templates/post_actions.html @@ -11,7 +11,7 @@ {% endif %} {% if v and FEATURES['AWARDS'] %} - + {% endif %} diff --git a/files/templates/post_actions_mobile.html b/files/templates/post_actions_mobile.html index 57f470d8e..7bacc94a1 100644 --- a/files/templates/post_actions_mobile.html +++ b/files/templates/post_actions_mobile.html @@ -17,7 +17,7 @@ {% if FEATURES['AWARDS'] -%} - + {%- endif %}