LGB: disable country club.

remotes/1693045480750635534/spooky-22
Snakes 2022-07-19 21:50:08 -04:00
parent aaca126984
commit eb55a6cc01
Signed by: Snakes
GPG Key ID: E745A82778055C7E
11 changed files with 24 additions and 5 deletions

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -31,6 +31,8 @@ titleheaders = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWe
@app.post("/toggle_club/<pid>")
@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

View File

@ -44,7 +44,7 @@
<a class="btn btn-secondary mx-2 smol-fp" href="/toggle_pins/{{sort}}"><i class="fas fas fa-thumbtack fa-rotate--45 mr-2 "></i>Pins</a>
{% endif %}
{% if v and SITE_NAME == 'rDrama' %}
{% if v and SITE_NAME == 'rDrama' and FEATURES['COUNTRY_CLUB'] %}
{% if v.paid_dues %}
{% if ccmode=="true" %}
<a data-bs-toggle="tooltip" data-bs-placement="bottom" title="Only show country club posts" class="btn btn-primary text-primary mx-2 smol-fp" href="?sort={{sort}}&t={{t}}&ccmode=false"><i class="fas fa-golf-club mr-2 "></i>CC</a>

View File

@ -55,7 +55,7 @@
<a id="hole-unpin-{{p.id}}" class="dropdown-item {% if not p.hole_pinned %}d-none{% endif %} list-inline-item text-info" role="button" onclick="post_toast(this,'/hole_unpin/{{p.id}}','hole-pin-{{p.id}}','hole-unpin-{{p.id}}','d-none')"><i class="fas fa-thumbtack fa-rotate--45"></i>Unpin fron /h/{{p.sub}}</a>
{% 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) %}
<a id="club-{{p.id}}" class="dropdown-item {% if p.club %}d-none{% endif %} list-inline-item text-info" role="button" onclick="post_toast(this,'/toggle_club/{{p.id}}','club-{{p.id}}','unclub-{{p.id}}','d-none')"><i class="fas fa-eye-slash"></i>Mark club</a>
<a id="unclub-{{p.id}}" class="dropdown-item {% if not p.club %}d-none{% endif %} list-inline-item text-info" role="button" onclick="post_toast(this,'/toggle_club/{{p.id}}','club-{{p.id}}','unclub-{{p.id}}','d-none')"><i class="fas fa-eye"></i>Unmark club</a>
{% endif %}

View File

@ -39,8 +39,10 @@
<button id="delete-{{p.id}}" class="{% if p.deleted_utc %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-left text-danger" data-bs-toggle="modal" data-bs-dismiss="modal" data-bs-target="#deletePostModal" onclick="delete_postModal('{{p.id}}')"><i class="far fa-trash-alt mr-3"></i>Delete</button>
{% if FEATURES['COUNTRY_CLUB'] -%}
<button id="club3-{{p.id}}" class="{% if p.club %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-danger text-left" role="button" onclick="post_toast(this,'/toggle_club/{{p.id}}','club3-{{p.id}}','unclub3-{{p.id}}','d-none')" data-bs-dismiss="modal"><i class="fas fa-eye-slash mr-3"></i>Mark club</button>
<button id="unclub3-{{p.id}}" class="{% if not p.club %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-success text-left" role="button" onclick="post_toast(this,'/toggle_club/{{p.id}}','club3-{{p.id}}','unclub3-{{p.id}}','d-none')" data-bs-dismiss="modal"><i class="fas fa-eye mr-3"></i>Unmark club</button>
{%- endif %}
<button id="mark3-{{p.id}}" class="{% if p.over_18 %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-left text-danger" onclick="post_toast(this,'/toggle_post_nsfw/{{p.id}}','mark3-{{p.id}}','unmark3-{{p.id}}','d-none')" data-bs-dismiss="modal"><i class="far fa-eye-evil text-center mr-3"></i>Mark +18</button>
<button id="unmark3-{{p.id}}" class="{% if not p.over_18 %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-left text-success" onclick="post_toast(this,'/toggle_post_nsfw/{{p.id}}','mark3-{{p.id}}','unmark3-{{p.id}}','d-none')" data-bs-dismiss="modal"><i class="far fa-eye-evil text-center mr-3"></i>Unmark +18</button>

View File

@ -13,8 +13,10 @@
<button class="nobackground btn btn-link btn-block btn-lg text-left text-muted" data-bs-dismiss="modal" onclick="togglePostEdit('{{p.id}}')"><i class="far fa-edit text-center text-muted mr-3"></i>Edit</button>
{% endif %}
{% if FEATURES['COUNTRY_CLUB'] -%}
<button id="club2-{{p.id}}" class="{% if p.club %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-info text-left" role="button" onclick="post_toast(this,'/toggle_club/{{p.id}}','club2-{{p.id}}','unclub2-{{p.id}}','d-none')" data-bs-dismiss="modal"><i class="fas fa-eye-slash mr-3"></i>Mark club</button>
<button id="unclub2-{{p.id}}" class="{% if not p.club %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-info text-left" role="button" onclick="post_toast(this,'/toggle_club/{{p.id}}','club2-{{p.id}}','unclub2-{{p.id}}','d-none')" data-bs-dismiss="modal"><i class="fas fa-eye mr-3"></i>Unmark club</button>
{%- endif %}
<button id="distinguish2-{{p.id}}" class="{% if p.distinguish_level %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-left text-primary" role="button" onclick="post_toast(this,'/distinguish/{{p.id}}','distinguish2-{{p.id}}','undistinguish2-{{p.id}}','d-none')" data-bs-dismiss="modal"><i class="fas fa-crown text-center text-primary mr-3"></i>Distinguish</button>

View File

@ -176,10 +176,12 @@
<label class="custom-control-label" for="private">Draft</label>
</div>
{% if FEATURES['COUNTRY_CLUB'] -%}
<div class="custom-control custom-checkbox">
<input autocomplete="off" type="checkbox" class="custom-control-input" id="club" name="club">
<label class="custom-control-label" for="club">{{CC_TITLE}} thread</label>
</div>
{%- endif %}
<div class="custom-control custom-checkbox">
<input onchange='draft(this);' autocomplete="off" type="checkbox" class="custom-control-input" id="ghost" name="ghost" {% if v.coins < 100 %}disabled{% endif %}>

View File

@ -29,7 +29,7 @@
<span id="profile--lastactive" class="ml-2">last active <span id="profile--lastactive--time" data-bs-toggle="tooltip" data-bs-placement="bottom" onmouseover="timestamp('profile--lastactive--time','{{u.last_active}}')">{{u.last_active_date}}</span></span>
{%- endif %}
{% if not hide_bios and u.bio_html %}
{% if FEATURES['USERS_PROFILE_BODYTEXT'] and not hide_bios and u.bio_html %}
<div class="card-text mt-3">{{u.bio_html | safe}}</div>
{% endif %}
</div>

View File

@ -328,8 +328,11 @@
<input type="submit" onclick="disable(this)" class="btn btn-danger" value="Remove User's Content">
</form>
<pre></pre>
{% if FEATURES['COUNTRY_CLUB'] -%}
<button id="grant2" class="{% if u.paid_dues %}d-none{% endif %} btn btn-success" onclick="post_toast(this,'/@{{u.username}}/club_allow','grant2','bar2','d-none')">Grant club access</button>
<button id="bar2" class="{% if u.club_allowed == False %}d-none{% endif %} btn btn-danger" onclick="post_toast(this,'/@{{u.username}}/club_ban','grant2','bar2','d-none')">Bar from club</button>
{%- endif %}
{% endif %}
<pre></pre>
<div id="profile--info">
@ -579,8 +582,10 @@
{% if v.admin_level > 1 %}
{% if FEATURES['COUNTRY_CLUB'] -%}
<button id="grant" class="{% if u.paid_dues %}d-none{% endif %} btn btn-success" onclick="post_toast(this,'/@{{u.username}}/club_allow','grant','bar','d-none')">Grant club access</button>
<button id="bar" class="{% if u.club_allowed == False %}d-none{% endif %} btn btn-danger" onclick="post_toast(this,'/@{{u.username}}/club_ban','grant','bar','d-none')">Bar from club</button>
{%- endif %}
<br><br>
<div class="body d-lg-flex border-bottom">