From d06ea7d349ace498213bd875d5aae9937723aeb9 Mon Sep 17 00:00:00 2001 From: TLSM Date: Tue, 19 Jul 2022 20:07:38 -0400 Subject: [PATCH 1/9] LGB: disable markup commands. --- files/helpers/const.py | 2 ++ files/helpers/sanitize.py | 3 ++- files/templates/formatting.html | 7 +++++++ files/templates/sidebar_LGBDropTheT.html | 1 - 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/files/helpers/const.py b/files/helpers/const.py index 1ca3624448..a58254c37e 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -153,6 +153,7 @@ FEATURES = { 'HOUSES': False, 'USERS_SUICIDE': True, 'GAMBLING': True, + 'MARKUP_COMMANDS': True, } EMOJI_MARSEYS = True @@ -333,6 +334,7 @@ elif SITE == 'lgbdropthet.com': FEATURES['BADGES'] = False FEATURES['USERS_SUICIDE'] = False FEATURES['GAMBLING'] = False + FEATURES['MARKUP_COMMANDS'] = False EMOJI_MARSEYS = False EMOJI_SRCS = ['files/assets/emojis.lgbdropthet.json'] diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index 692c17beda..ec33d66560 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -230,7 +230,8 @@ def sanitize(sanitized, edit=False): sanitized = link_fix_regex.sub(r'\1https://\2', sanitized) - sanitized = command_regex.sub(command_regex_matcher, sanitized) + if FEATURES['MARKUP_COMMANDS']: + sanitized = command_regex.sub(command_regex_matcher, sanitized) sanitized = markdown(sanitized) diff --git a/files/templates/formatting.html b/files/templates/formatting.html index 248d0acb6d..2b3a2f6364 100644 --- a/files/templates/formatting.html +++ b/files/templates/formatting.html @@ -116,6 +116,7 @@ Text 2 :marseyrandom: ??? + {% if FEATURES['MARKUP_COMMANDS'] -%} Random Fortune #fortune @@ -131,6 +132,12 @@ Text 2 #factcheck ??? + + Roll + #roll + A number 1–9999. + + {%- endif %} Poll — Pick Multiple
diff --git a/files/templates/sidebar_LGBDropTheT.html b/files/templates/sidebar_LGBDropTheT.html index 73eb2b2f36..92954131e0 100644 --- a/files/templates/sidebar_LGBDropTheT.html +++ b/files/templates/sidebar_LGBDropTheT.html @@ -24,7 +24,6 @@ {% endif %}

- From b4fdf248ef77a7207777fdeb13031e16b36c5fc5 Mon Sep 17 00:00:00 2001 From: TLSM Date: Tue, 19 Jul 2022 21:16:59 -0400 Subject: [PATCH 2/9] LGB: disable profile bio, banner, song. --- .../assets/js/comments+submission_listing.js | 4 +- files/classes/user.py | 5 +- files/helpers/const.py | 10 ++- files/routes/settings.py | 15 ++++- files/templates/comments.html | 3 + files/templates/settings_profile.html | 10 ++- files/templates/submission_listing.html | 3 + files/templates/userpage.html | 63 ++++++++++--------- files/templates/util/assetcache.html | 2 +- 9 files changed, 76 insertions(+), 39 deletions(-) diff --git a/files/assets/js/comments+submission_listing.js b/files/assets/js/comments+submission_listing.js index c081efc81c..7642585dbb 100644 --- a/files/assets/js/comments+submission_listing.js +++ b/files/assets/js/comments+submission_listing.js @@ -50,7 +50,9 @@ function popclick(e) { popover.getElementsByClassName('pop-banner')[0].src = author["bannerurl"] popover.getElementsByClassName('pop-picture')[0].src = author["profile_url"] popover.getElementsByClassName('pop-username')[0].innerHTML = author["username"] - popover.getElementsByClassName('pop-bio')[0].innerHTML = author["bio_html"] + if (popover.getElementsByClassName('pop-bio').length > 0) { + popover.getElementsByClassName('pop-bio')[0].innerHTML = author["bio_html"] + } popover.getElementsByClassName('pop-postcount')[0].innerHTML = author["post_count"] popover.getElementsByClassName('pop-commentcount')[0].innerHTML = author["comment_count"] popover.getElementsByClassName('pop-coins')[0].innerHTML = author["coins"] diff --git a/files/classes/user.py b/files/classes/user.py index 74a75fe28c..e39d29cf8d 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -592,8 +592,9 @@ class User(Base): @property @lazy def banner_url(self): - if self.bannerurl: return self.bannerurl - else: return f"/i/{SITE_NAME}/site_preview.webp?v=3001" + if FEATURES['USERS_PROFILE_BANNER'] and self.bannerurl: + return self.bannerurl + return f"/i/{SITE_NAME}/site_preview.webp?v=3001" @property @lazy diff --git a/files/helpers/const.py b/files/helpers/const.py index a58254c37e..168f9e9628 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -151,8 +151,11 @@ FEATURES = { 'PRONOUNS': False, 'BADGES': True, 'HOUSES': False, - 'USERS_SUICIDE': True, 'GAMBLING': True, + 'USERS_PROFILE_BANNER': True, + 'USERS_PROFILE_BODYTEXT': True, + 'USERS_PROFILE_SONG': True, + 'USERS_SUICIDE': True, 'MARKUP_COMMANDS': True, } @@ -332,8 +335,11 @@ elif SITE == 'lgbdropthet.com': FEATURES['AWARDS'] = False FEATURES['CHAT'] = False FEATURES['BADGES'] = False - FEATURES['USERS_SUICIDE'] = False FEATURES['GAMBLING'] = False + FEATURES['USERS_PROFILE_BANNER'] = False + FEATURES['USERS_PROFILE_BODYTEXT'] = False + FEATURES['USERS_PROFILE_SONG'] = False + FEATURES['USERS_SUICIDE'] = False FEATURES['MARKUP_COMMANDS'] = False EMOJI_MARSEYS = False diff --git a/files/routes/settings.py b/files/routes/settings.py index 24f65a49c2..fd76b9db28 100644 --- a/files/routes/settings.py +++ b/files/routes/settings.py @@ -144,7 +144,7 @@ def settings_profile_post(v): - elif request.values.get("friends"): + elif FEATURES['USERS_PROFILE_BODYTEXT'] and request.values.get("friends"): friends = request.values.get("friends")[:500] friends_html = sanitize(friends) @@ -170,7 +170,7 @@ def settings_profile_post(v): msg="Your friends list has been updated.") - elif request.values.get("enemies"): + elif FEATURES['USERS_PROFILE_BODYTEXT'] and request.values.get("enemies"): enemies = request.values.get("enemies")[:500] enemies_html = sanitize(enemies) @@ -196,7 +196,8 @@ def settings_profile_post(v): msg="Your enemies list has been updated.") - elif request.values.get("bio") or request.files.get('file'): + elif FEATURES['USERS_PROFILE_BODYTEXT'] and \ + (request.values.get("bio") or request.files.get('file')): bio = request.values.get("bio")[:1500] bio += process_files() @@ -536,6 +537,9 @@ def settings_images_profile(v): @limiter.limit("1/second;30/minute;200/hour;1000/day", key_func=lambda:f'{SITE}-{session.get("lo_user")}') @auth_required def settings_images_banner(v): + if not FEATURES['USERS_PROFILE_BANNER']: + abort(403) + if request.headers.get("cf-ipcountry") == "T1": return {"error":"Image uploads are not allowed through TOR."}, 403 file = request.files["banner"] @@ -746,6 +750,8 @@ def settings_name_change(v): @limiter.limit("3/second;10/day", key_func=lambda:f'{SITE}-{session.get("lo_user")}') @auth_required def settings_song_change_mp3(v): + if not FEATURES['USERS_PROFILE_SONG']: + abort(403) file = request.files['file'] if file.content_type != 'audio/mpeg': @@ -776,6 +782,9 @@ def settings_song_change_mp3(v): @limiter.limit("3/second;10/day", key_func=lambda:f'{SITE}-{session.get("lo_user")}') @auth_required def settings_song_change(v): + if not FEATURES['USERS_PROFILE_SONG']: + abort(403) + song=request.values.get("song").strip() if song == "" and v.song: diff --git a/files/templates/comments.html b/files/templates/comments.html index 1cc43559ca..94bf925067 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -21,9 +21,12 @@

+ + {% if FEATURES['USERS_PROFILE_BODYTEXT'] -%}
+ {%- endif %} {% if FEATURES['BADGES'] -%}
diff --git a/files/templates/settings_profile.html b/files/templates/settings_profile.html index 3c306b5beb..58b95cb32d 100644 --- a/files/templates/settings_profile.html +++ b/files/templates/settings_profile.html @@ -242,6 +242,8 @@
+ + {% if FEATURES['USERS_PROFILE_BANNER'] -%}

Profile Banner

@@ -275,6 +277,7 @@
+ {%- endif %}

Referrals

@@ -389,6 +392,8 @@ + + {% if FEATURES['USERS_PROFILE_SONG'] -%}
@@ -422,6 +427,8 @@
+ {%- endif %} +
@@ -599,7 +606,7 @@ {% endif %} - + {% if FEATURES['USERS_PROFILE_BODYTEXT'] -%}
@@ -671,6 +678,7 @@
+ {%- endif %} {% if v.patron or v.id == MOOSE_ID %} diff --git a/files/templates/submission_listing.html b/files/templates/submission_listing.html index d9e0e233c2..478dfb5158 100644 --- a/files/templates/submission_listing.html +++ b/files/templates/submission_listing.html @@ -24,9 +24,12 @@
+ + {% if FEATURES['USERS_PROFILE_BODYTEXT'] -%}
+ {%- endif %} {% if FEATURES['BADGES'] -%}
diff --git a/files/templates/userpage.html b/files/templates/userpage.html index 55ea71fe9b..1da3d67408 100644 --- a/files/templates/userpage.html +++ b/files/templates/userpage.html @@ -33,7 +33,7 @@
-
+
@@ -140,22 +140,24 @@
{% if u.basedcount %}

Based Count: {{u.basedcount}}

{% endif %} - {% if u.bio_html %} -

-					
{{u.bio_html | safe}}
- {% else %} -

No bio...

- {% endif %} + {% if FEATURES['USERS_PROFILE_BODYTEXT'] -%} + {% if u.bio_html %} +

+						
{{u.bio_html | safe}}
+ {% else %} +

No bio...

+ {% endif %} - {% if u.friends_html %} -

Friends:

-
{{u.friends_html | safe}}
- {% endif %} + {% if u.friends_html %} +

Friends:

+
{{u.friends_html | safe}}
+ {% endif %} - {% if u.enemies_html %} -

Enemies:

-
{{u.enemies_html | safe}}
- {% endif %} + {% if u.enemies_html %} +

Enemies:

+
{{u.enemies_html | safe}}
+ {% endif %} + {%- endif %} {% if u.received_awards and FEATURES['AWARDS'] %}
@@ -249,7 +251,7 @@ Profile views {% endif %} - {% if u.song and v and (v.id == u.id or v.mute and not u.unmutable) %} + {% if FEATURES['USERS_PROFILE_SONG'] and u.song and v and (v.id == u.id or v.mute and not u.unmutable) %} Toggle anthem {% endif %} @@ -458,19 +460,22 @@
last active {{u.last_active_date}} {%- endif %}
- {% if u.bio_html %} -
{{u.bio_html | safe}}
- {% endif %} - {% if u.friends_html %} -

Friends:

-
{{u.friends_html | safe}}
- {% endif %} + {% if FEATURES['USERS_PROFILE_BODYTEXT'] -%} + {% if u.bio_html %} +
{{u.bio_html | safe}}
+ {% endif %} - {% if u.enemies_html %} -

Enemies:

-
{{u.enemies_html | safe}}
- {% endif %} + {% if u.friends_html %} +

Friends:

+
{{u.friends_html | safe}}
+ {% endif %} + + {% if u.enemies_html %} +

Enemies:

+
{{u.enemies_html | safe}}
+ {% endif %} + {%- endif %} {% if u.received_awards and FEATURES['AWARDS'] %}
@@ -509,7 +514,7 @@ Profile views {% endif %} - {% if u.song and v and (v.id == u.id or v.mute and not u.unmutable) %} + {% if FEATURES['USERS_PROFILE_SONG'] and u.song and v and (v.id == u.id or v.mute and not u.unmutable) %} Toggle anthem {% endif %} @@ -770,7 +775,7 @@
-{% if u.song %} +{% if FEATURES['USERS_PROFILE_SONG'] and u.song %} {% if v and v.id == u.id %}
{{v.username}}
{% else %} diff --git a/files/templates/util/assetcache.html b/files/templates/util/assetcache.html index 302320ad81..dbf447130a 100644 --- a/files/templates/util/assetcache.html +++ b/files/templates/util/assetcache.html @@ -18,7 +18,7 @@ set CACHE_VER = { 'js/award_modal.js': 253, 'js/bootstrap.js': 275, - 'js/comments+submission_listing.js': 264, + 'js/comments+submission_listing.js': 265, 'js/submission_listing.js': 261, 'js/emoji_modal.js': 312, 'js/formatting.js': 240, From aaca1269842cfbdea1161c1b0ea10a0de0c6ed6b Mon Sep 17 00:00:00 2001 From: TLSM Date: Tue, 19 Jul 2022 21:19:34 -0400 Subject: [PATCH 3/9] LGB: Content update /kb/resourcesorgs. --- .../kb/LGBDropTheT/resourcesorgs.html | 84 +++++++++---------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/files/templates/kb/LGBDropTheT/resourcesorgs.html b/files/templates/kb/LGBDropTheT/resourcesorgs.html index 9c6a0f980d..08866b4127 100644 --- a/files/templates/kb/LGBDropTheT/resourcesorgs.html +++ b/files/templates/kb/LGBDropTheT/resourcesorgs.html @@ -2,7 +2,7 @@ {% block content %}

LGB RESOURCES AND ORGANIZATIONS


-

If you would like to add additional resources, or find any information on this page is out-of-date, please visit our Resources & Organizations mega-thread. to alert site Admins.

+

If you would like to add additional resources, or find any information on this page is out-of-date, please visit our Resources & Organizations mega-thread to alert site Admins.



@@ -26,7 +26,7 @@
  • About: US organization that advocates for the rights of lesbians and gay men.
-

Get The L Out - this link will be updated from SaidIt once we get a proper Wiki on this site

+

Get The L Out - this link will be updated from SaidIt once we get a proper Wiki on this site

  • About: GetTheLOut is primarily a UK-based group representing lesbians. There are a few other chapters around the world.
@@ -49,7 +49,7 @@

SUPPORTIVE / RELEVANT / ALLIES

-

Society for Evidence-based Gender Medicine

+

Society for Evidence-Based Gender Medicine

  • About: Organization of physical and mental health practitioners, researchers and experts who are concerned about the lack of scientific evidence for popular treatments of gender dysphoria.
  • Example Article: A Typology of Gender Detransition and Its Implications for Healthcare Providers
  • @@ -150,51 +150,51 @@ The Tavistock’s experiment with puberty blockers, part 5: the belated results< margin: 2rem 1rem; } - /******** Hides the checkbox/radio button */ + /******** Hides the checkbox/radio button */ - .sources-wrapper input { - position: absolute; - opacity: 0; - z-index: -1; - } - .sources-wrapper input[type='radio'] { - display: none; - } + .sources-wrapper input { + position: absolute; + opacity: 0; + z-index: -1; + } + .sources-wrapper input[type='radio'] { + display: none; + } - /******** SOURCE TITLES */ + /******** SOURCE TITLES */ - .sources { - color: var(--black); - margin-bottom: 3rem; - } - .sources-label { - font-size: 1.5rem; - display: flex; - align-items: center; - justify-content: space-between; - padding: 1em; - color: var(--primary); + .sources { + color: var(--black); + margin-bottom: 3rem; + } + .sources-label { + font-size: 1.5rem; + display: flex; + align-items: center; + justify-content: space-between; + padding: 1em; + color: var(--primary); border: 1px solid var(--primary); border-radius: 1rem; - font-weight: bold; - cursor: pointer; - user-select: none; - } + font-weight: bold; + cursor: pointer; + user-select: none; + } - /******** SOURCE CONTENT */ + /******** SOURCE CONTENT */ - .sources-content { - max-height: 0; - padding: 0 1em; - background: transparent !important; - transition: all 0.35s; - display: none; - } - .sources-wrapper input:checked ~ .sources-content { - max-height: 100%; - padding: 1em; - display: block; - transition: all 0.35s; - } + .sources-content { + max-height: 0; + padding: 0 1em; + background: transparent !important; + transition: all 0.35s; + display: none; + } + .sources-wrapper input:checked ~ .sources-content { + max-height: 100%; + padding: 1em; + display: block; + transition: all 0.35s; + } {% endblock %} From eb55a6cc01f16e63b709d832a97fdccf21c4a111 Mon Sep 17 00:00:00 2001 From: TLSM Date: Tue, 19 Jul 2022 21:50:08 -0400 Subject: [PATCH 4/9] LGB: disable country club. --- files/classes/user.py | 2 ++ files/helpers/const.py | 2 ++ files/routes/front.py | 2 +- files/routes/posts.py | 6 +++++- files/templates/home.html | 2 +- files/templates/post_actions.html | 2 +- files/templates/post_actions_mobile.html | 2 ++ files/templates/post_admin_actions_mobile.html | 2 ++ files/templates/submit.html | 2 ++ files/templates/user_listing.html | 2 +- files/templates/userpage.html | 5 +++++ 11 files changed, 24 insertions(+), 5 deletions(-) diff --git a/files/classes/user.py b/files/classes/user.py index e39d29cf8d..b8de28f125 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -278,6 +278,8 @@ class User(Base): @property @lazy def paid_dues(self): + if not FEATURES['COUNTRY_CLUB']: + return True return not self.shadowbanned and not (self.is_banned and not self.unban_utc) and (self.admin_level or self.club_allowed or (self.club_allowed != False and self.truecoins > dues)) @lazy diff --git a/files/helpers/const.py b/files/helpers/const.py index 168f9e9628..348da529cc 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -148,6 +148,7 @@ FEATURES = { 'AWARDS': True, 'CHAT': True, 'PINS': True, + 'COUNTRY_CLUB': True, 'PRONOUNS': False, 'BADGES': True, 'HOUSES': False, @@ -334,6 +335,7 @@ elif SITE == 'lgbdropthet.com': FEATURES['PROCOINS'] = False FEATURES['AWARDS'] = False FEATURES['CHAT'] = False + FEATURES['COUNTRY_CLUB'] = False FEATURES['BADGES'] = False FEATURES['GAMBLING'] = False FEATURES['USERS_PROFILE_BANNER'] = False diff --git a/files/routes/front.py b/files/routes/front.py index 3f3d464f29..a39265eb64 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -98,7 +98,7 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, ccmode="false" if not gt and not lt: posts = apply_time_filter(t, posts, Submission) - if (ccmode == "true"): + if (ccmode == "true") and FEATURES['COUNTRY_CLUB']: posts = posts.filter(Submission.club == True) posts = posts.filter_by(is_banned=False, private=False, deleted_utc = 0) diff --git a/files/routes/posts.py b/files/routes/posts.py index 1a4b1712ff..38079c260d 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -31,6 +31,8 @@ titleheaders = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWe @app.post("/toggle_club/") @auth_required def toggle_club(pid, v): + if not FEATURES['COUNTRY_CLUB']: + abort(403) post = get_post(pid) if post.author_id != v.id and v.admin_level < 2: abort(403) @@ -906,7 +908,9 @@ def submit_post(v, sub=None): if len(body_html) > 40000: return error("Submission body_html too long! (max 40k characters)") - club = bool(request.values.get("club","")) + club = False + if FEATURES['COUNTRY_CLUB']: + club = bool(request.values.get("club","")) if embed and len(embed) > 1500: embed = None diff --git a/files/templates/home.html b/files/templates/home.html index 530893658d..a03b9647bc 100644 --- a/files/templates/home.html +++ b/files/templates/home.html @@ -44,7 +44,7 @@ Pins {% endif %} - {% if v and SITE_NAME == 'rDrama' %} + {% if v and SITE_NAME == 'rDrama' and FEATURES['COUNTRY_CLUB'] %} {% if v.paid_dues %} {% if ccmode=="true" %} CC diff --git a/files/templates/post_actions.html b/files/templates/post_actions.html index 713d027e95..c510f8903f 100644 --- a/files/templates/post_actions.html +++ b/files/templates/post_actions.html @@ -55,7 +55,7 @@ Unpin fron /h/{{p.sub}} {% endif %} - {% if v.admin_level > 1 or v.id == p.author_id %} + {% if FEATURES['COUNTRY_CLUB'] and (v.admin_level > 1 or v.id == p.author_id) %} Mark club Unmark club {% endif %} diff --git a/files/templates/post_actions_mobile.html b/files/templates/post_actions_mobile.html index 0956392e9b..7a950e1588 100644 --- a/files/templates/post_actions_mobile.html +++ b/files/templates/post_actions_mobile.html @@ -39,8 +39,10 @@ + {% if FEATURES['COUNTRY_CLUB'] -%} + {%- endif %} diff --git a/files/templates/post_admin_actions_mobile.html b/files/templates/post_admin_actions_mobile.html index 49d6b22bce..08201df2eb 100644 --- a/files/templates/post_admin_actions_mobile.html +++ b/files/templates/post_admin_actions_mobile.html @@ -13,8 +13,10 @@ {% endif %} + {% if FEATURES['COUNTRY_CLUB'] -%} + {%- endif %} diff --git a/files/templates/submit.html b/files/templates/submit.html index 19c83553d2..59000d3f8a 100644 --- a/files/templates/submit.html +++ b/files/templates/submit.html @@ -176,10 +176,12 @@
+ {% if FEATURES['COUNTRY_CLUB'] -%}
+ {%- endif %}
diff --git a/files/templates/user_listing.html b/files/templates/user_listing.html index b57bf91604..884857fd23 100644 --- a/files/templates/user_listing.html +++ b/files/templates/user_listing.html @@ -29,7 +29,7 @@ last active {{u.last_active_date}} {%- endif %} - {% if not hide_bios and u.bio_html %} + {% if FEATURES['USERS_PROFILE_BODYTEXT'] and not hide_bios and u.bio_html %}
{{u.bio_html | safe}}
{% endif %}
diff --git a/files/templates/userpage.html b/files/templates/userpage.html index 1da3d67408..66eec2ebbe 100644 --- a/files/templates/userpage.html +++ b/files/templates/userpage.html @@ -328,8 +328,11 @@

+						{% if FEATURES['COUNTRY_CLUB'] -%}
 						
 						
+						{%- endif %}
+
 						{% endif %}
 					

 					
@@ -579,8 +582,10 @@ {% if v.admin_level > 1 %} + {% if FEATURES['COUNTRY_CLUB'] -%} + {%- endif %}

From f23b93fbe9f28417be69545fa271ea3eccef20f9 Mon Sep 17 00:00:00 2001 From: TLSM Date: Tue, 19 Jul 2022 22:20:57 -0400 Subject: [PATCH 5/9] LGB: add sidebar rDrama shoutout. --- files/assets/css/main.css | 9 +++++++++ .../assets/images/LGBDropTheT/sidebar_host.webp | Bin 0 -> 8440 bytes files/templates/sidebar_LGBDropTheT.html | 5 +++++ files/templates/util/assetcache.html | 2 +- 4 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 files/assets/images/LGBDropTheT/sidebar_host.webp diff --git a/files/assets/css/main.css b/files/assets/css/main.css index 3a74c52585..d6aba2d1a6 100644 --- a/files/assets/css/main.css +++ b/files/assets/css/main.css @@ -5594,6 +5594,15 @@ audio, video { text-decoration: none; } +#sidebar-lgb--host-notice img { + display: block; + margin: 1.5rem auto 1rem auto; +} +#sidebar-lgb--host-notice a { + display: block; + text-align: center; +} + #sidebar--directory--head { display: block; font-size: 1.35rem; diff --git a/files/assets/images/LGBDropTheT/sidebar_host.webp b/files/assets/images/LGBDropTheT/sidebar_host.webp new file mode 100644 index 0000000000000000000000000000000000000000..1f79f81981fd8b9ce9a4d935f3b15d0e86155c5f GIT binary patch literal 8440 zcmaKRbxWmx!v?awE`qgPJYEW<~F7luekgbGr7Dj@D(rq z!<+pV{`(KM{ulq76po9An)qvOIIldp^?$=={|%elxPV_ZT(25x3$VlM_^>+vg)RQU ze*a*wz5DCh{mza0KfYh?uh7exSorV9Y?CIJ9N|G(ifqJhUWHXthgCdU zl=88xkYbYM1>}^1DJ4+aCLB0yAY!M226%JWgDhz`1|VgEhk~#`Ijam%OPG_Yr*cAXqkm9cCw@sq~g!jOY1>; z%=#8g#mLpV>w!eH#D;*Tdh>lUHfOMP)e>`fijS#){FdC%DMtI1R~}^aGNjSzI zyR2RL&t%xAL&n|g=g?Uc%5htNyagpLRfQ?IDO^blwC|8(W^=@a528V`Y~QutSWV=+ z^-pF~`c{qFa?l?Tz@k4C?%e|oR%=}7t{5wa&$rdAa_TunwxKnr#2$Ussq$ps$#>6T)tvg z@#IFuF=UDc7Iwz6PKGu}J>d9dCgge)a4#oA-7&TTmh2_^gs^;!i|*Gd%0GmVWv0Og zrLXgp<}l}mbXZN#*zq{JKSHIkRFTL0)~;aZzsHaYgr@$wH(o@jE{kczof1VJk1^rw zZw=X(M%D`RLuTxk{6T%EX@NlRAo@r{K<|P)r|c&E^#QhCN23MIzN?Okv~!*36WjBt z{Z1w@HA0{XD-BA4eDkF*OWsLzhtuGQI+>0Gc>#>vj;$LtLiJHQ*07O!wlqBbfoyYv z)&)1qD$}NH5Kf0o&HKi8rh4v?+21J=#Pf-ocuQFn5wbDh;=vu5e!WzV5CC=MBPVeLN&2s z4@%18pGc2O*~6Qde+(dpd+w;JJvtIonG2*=^VQ#_e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v!c(Y&wG~Ll;&R#dZi2g z<|F&zJ1}jY1XYtJ3oGb~!SgvKB${ou+0rQci+{n=G!a8uzBP%Nw>v~i&<8tqD7!A!AH`I7oc~=gFK$7F6;A zS-6?0Vv&KE6H&BrxZ&7>3~p5)*caIMQZ0v2{%
{% endif %} +
+
 
 
diff --git a/files/templates/util/assetcache.html b/files/templates/util/assetcache.html
index dbf447130a..9a37d231e7 100644
--- a/files/templates/util/assetcache.html
+++ b/files/templates/util/assetcache.html
@@ -1,6 +1,6 @@
 {%-
 set CACHE_VER = {
-	'css/main.css': 426,
+	'css/main.css': 427,
 	'css/catalog.css': 2,
 
 	'css/4chan.css': 61,

From a2ca535ce347ec2378d6eb81cc0a59f819cfa546 Mon Sep 17 00:00:00 2001
From: TLSM 
Date: Tue, 19 Jul 2022 22:29:45 -0400
Subject: [PATCH 6/9] LGB: extend block & follower vis permissioning.

---
 files/routes/settings.py      |  5 +++--
 files/templates/userpage.html | 12 ++++++++----
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/files/routes/settings.py b/files/routes/settings.py
index fd76b9db28..20669bcc84 100644
--- a/files/routes/settings.py
+++ b/files/routes/settings.py
@@ -641,7 +641,8 @@ def settings_block_user(v):
 						  )
 	g.db.add(new_block)
 
-	send_notification(user.id, f"@{v.username} has blocked you!")
+	if user.admin_level >= PERMS['USER_BLOCKS_VISIBLE']:
+		send_notification(user.id, f"@{v.username} has blocked you!")
 
 	cache.delete_memoized(frontlist)
 
@@ -663,7 +664,7 @@ def settings_unblock_user(v):
 
 	g.db.delete(x)
 
-	if not v.shadowbanned:
+	if not v.shadowbanned and user.admin_level >= PERMS['USER_BLOCKS_VISIBLE']:
 		send_notification(user.id, f"@{v.username} has unblocked you!")
 
 	cache.delete_memoized(frontlist)
diff --git a/files/templates/userpage.html b/files/templates/userpage.html
index 66eec2ebbe..65727fef00 100644
--- a/files/templates/userpage.html
+++ b/files/templates/userpage.html
@@ -128,9 +128,11 @@
 						marseybux  
 					{% endif %}
 
-					{{u.stored_subscriber_count}} follower{{'s' if u.stored_subscriber_count != 1 else ''}}  
+					{% if PERMS['USER_FOLLOWS_VISIBLE'] == 0 or (v and v.admin_level >= PERMS['USER_FOLLOWS_VISIBLE']) -%}
+						{{u.stored_subscriber_count}} follower{{'s' if u.stored_subscriber_count != 1 else ''}}  
 
-					follows {{u.follow_count}} user{{'s' if u.follow_count != 1 else ''}}  
+						follows {{u.follow_count}} user{{'s' if u.follow_count != 1 else ''}}  
+					{%- endif %}
 
 					joined {{u.created_date}}
 
@@ -449,9 +451,11 @@
 						marseybux  
 					{% endif %}
 
-					{{u.stored_subscriber_count}} follower{{'s' if u.stored_subscriber_count != 1 else ''}}  
+					{% if PERMS['USER_FOLLOWS_VISIBLE'] == 0 or (v and v.admin_level >= PERMS['USER_FOLLOWS_VISIBLE']) -%}
+						{{u.stored_subscriber_count}} follower{{'s' if u.stored_subscriber_count != 1 else ''}}  
 
-					follows {{u.follow_count}} user{{'s' if u.follow_count != 1 else ''}}  
+						follows {{u.follow_count}} user{{'s' if u.follow_count != 1 else ''}}  
+					{%- endif %}
 
 					{% if u.basedcount %}
 						
Based count: {{u.basedcount}} From 0fe1e57ecd7b2db3a252be5fba1815e8672ae34e Mon Sep 17 00:00:00 2001 From: TLSM Date: Thu, 21 Jul 2022 14:11:04 -0400 Subject: [PATCH 7/9] Fix cfa6c13ea: cron.py missing import. --- files/helpers/cron.py | 54 +++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/files/helpers/cron.py b/files/helpers/cron.py index fb0945d3f7..6b80ababe5 100644 --- a/files/helpers/cron.py +++ b/files/helpers/cron.py @@ -10,8 +10,35 @@ import files.routes.static as route_static from sys import stdout import datetime +import time import requests +@app.cli.command('cron', help='Run scheduled tasks.') +@click.option('--every-5m', is_flag=True, help='Call every 5 minutes.') +@click.option('--every-1h', is_flag=True, help='Call every 1 hour.') +@click.option('--every-1d', is_flag=True, help='Call every 1 day.') +@click.option('--every-1mo', is_flag=True, help='Call every 1 month.') +def cron(every_5m, every_1h, every_1d, every_1mo): + g.db = db_session() + + if every_5m: + lottery.check_if_end_lottery_task() + offsitementions.offsite_mentions_task() + + if every_1h: + awards.award_timers_bots_task() + + if every_1d: + stats.generate_charts_task(SITE) + route_static.stats_cached() + sub_inactive_purge_task() + + if every_1mo: + give_monthly_marseybux_task() + + g.db.commit() + g.db.close() + stdout.flush() def sub_inactive_purge_task(): if not HOLE_INACTIVITY_DELETION: @@ -77,30 +104,3 @@ def give_monthly_marseybux_task(): return True - -@app.cli.command('cron', help='Run scheduled tasks.') -@click.option('--every-5m', is_flag=True, help='Call every 5 minutes.') -@click.option('--every-1h', is_flag=True, help='Call every 1 hour.') -@click.option('--every-1d', is_flag=True, help='Call every 1 day.') -@click.option('--every-1mo', is_flag=True, help='Call every 1 month.') -def cron(every_5m, every_1h, every_1d, every_1mo): - g.db = db_session() - - if every_5m: - lottery.check_if_end_lottery_task() - offsitementions.offsite_mentions_task() - - if every_1h: - awards.award_timers_bots_task() - - if every_1d: - stats.generate_charts_task(SITE) - route_static.stats_cached() - sub_inactive_purge_task() - - if every_1mo: - give_monthly_marseybux_task() - - g.db.commit() - g.db.close() - stdout.flush() \ No newline at end of file From be1023f7347d50c37099a0faf3354b2f5c70782c Mon Sep 17 00:00:00 2001 From: TLSM Date: Thu, 21 Jul 2022 14:28:52 -0400 Subject: [PATCH 8/9] cron.py bugs: missing import; lottery edge case --- files/helpers/cron.py | 1 + files/helpers/lottery.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/files/helpers/cron.py b/files/helpers/cron.py index 6b80ababe5..9282cc716f 100644 --- a/files/helpers/cron.py +++ b/files/helpers/cron.py @@ -1,6 +1,7 @@ from files.cli import g, app, db_session import click from files.helpers.const import * +from files.classes import * import files.helpers.lottery as lottery import files.helpers.offsitementions as offsitementions diff --git a/files/helpers/lottery.py b/files/helpers/lottery.py index c2143abd93..80185332cd 100644 --- a/files/helpers/lottery.py +++ b/files/helpers/lottery.py @@ -38,6 +38,10 @@ def end_lottery_session(): for _ in range(user.currently_held_lottery_tickets): raffle.append(user.id) + if len(raffle) == 0: + active_lottery.is_active = False + return True, "Lottery ended with no participants." + winner = choice(raffle) active_lottery.winner_id = winner winning_user = next(filter(lambda x: x.id == winner, participating_users)) @@ -58,7 +62,6 @@ def end_lottery_session(): active_lottery.is_active = False - return True, f'{winning_user.username} won {active_lottery.prize} coins!' From 09506d2e4eb6e0a63150d31b2ccbeadc8a6f8151 Mon Sep 17 00:00:00 2001 From: TLSM Date: Thu, 21 Jul 2022 17:27:33 -0400 Subject: [PATCH 9/9] WPD: add sidebar flair 'Discussion'. --- files/templates/sidebar_WPD.html | 1 + 1 file changed, 1 insertion(+) diff --git a/files/templates/sidebar_WPD.html b/files/templates/sidebar_WPD.html index 2111c7c057..f802940350 100644 --- a/files/templates/sidebar_WPD.html +++ b/files/templates/sidebar_WPD.html @@ -53,6 +53,7 @@ Child Misc Request + Discussion Meta