remotes/1693045480750635534/spooky-22
Aevann1 2021-09-13 23:04:28 +02:00
parent 06d2a3fd12
commit 0c97ade24d
5 changed files with 12 additions and 9 deletions

View File

@ -157,6 +157,9 @@ class User(Base, Stndrd, Age_times):
return g.db.query(UserBlock).filter_by(
user_id=self.id, target_id=target.id).first()
def paid_dues(self):
return self.truecoins > environ.get("DUES").strip()
def any_block_exists(self, other):
return g.db.query(UserBlock).filter(
@ -229,7 +232,7 @@ class User(Base, Stndrd, Age_times):
if not v:
comments = comments.filter(Submission.club == False)
elif v.admin_level < 3 and (v.coins < 750 or v.club_banned):
elif v.admin_level < 3 and (not v.paid_dues or v.club_banned):
comments = comments.filter(Submission.club == False)
now = int(time.time())

View File

@ -42,7 +42,7 @@ def post_pid_comment_cid(cid, pid=None, anything=None, v=None):
if comment.post and comment.post.club:
if not v:
abort(403)
elif v.admin_level < 3 and (v.coins < 750 or v.club_banned):
elif v.admin_level < 3 and (not v.paid_dues or v.club_banned):
abort(403)
if not comment.parent_submission and not (v and (comment.author.id == v.id or comment.sentto == v.id)) and not (v and v.admin_level == 6) : abort(403)

View File

@ -99,7 +99,7 @@ def post_id(pid, anything=None, v=None):
if post.club:
if not v:
abort(403)
elif v.admin_level < 3 and (v.coins < 750 or v.club_banned):
elif v.admin_level < 3 and (not v.paid_dues or v.club_banned):
abort(403)

View File

@ -132,7 +132,7 @@
<button id="save2-{{p.id}}" class="{% if p.id in v.saved_idlist() %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-left text-muted"><a href="javascript:void(0)" onclick="post_toast2('/save_post/{{p.id}}','save2-{{p.id}}','unsave2-{{p.id}}')" data-dismiss="modal"><i class="fas fa-save text-center text-muted mr-3"></i>Save</a></button>
<button id="unsave2-{{p.id}}" class="{% if not p.id in v.saved_idlist() %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-left text-muted"><a href="javascript:void(0)" onclick="post_toast2('/unsave_post/{{p.id}}','save2-{{p.id}}','unsave2-{{p.id}}')" data-dismiss="modal"><i class="fas fa-save text-center text-muted mr-3"></i>Unsave</a></button>
{% if v.admin_level >=3 or v.id == p.author.id and v.coins > 750 %}
{% if v.admin_level >=3 or v.id == p.author.id and v.paid_dues %}
<button id="club2-{{p.id}}" class="{% if p.club %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-info text-left" href="javascript:void(0)" onclick="post_toast2('/toggle_club/{{p.id}}','club2-{{p.id}}','unclub2-{{p.id}}')" data-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" href="javascript:void(0)" onclick="post_toast2('/toggle_club/{{p.id}}','club2-{{p.id}}','unclub2-{{p.id}}')" data-dismiss="modal"><i class="fas fa-eye mr-3"></i>Unmark club</button>
{% endif %}
@ -448,7 +448,7 @@
{% endif %}
{% if v %}
{% if v.admin_level >=3 or v.id == p.author.id and v.coins > 750 %}
{% if v.admin_level >=3 or v.id == p.author.id and v.paid_dues %}
<li id="club-{{p.id}}" class="{% if p.club %}d-none{% endif %} list-inline-item"><a class="text-info" href="javascript:void(0)" onclick="post_toast2('/toggle_club/{{p.id}}','club-{{p.id}}','unclub-{{p.id}}')"><i class="fas fa-eye-slash"></i>Mark club</a></li>
<li id="unclub-{{p.id}}" class="{% if not p.club %}d-none{% endif %} list-inline-item"><a class="text-info" href="javascript:void(0)" onclick="post_toast2('/toggle_club/{{p.id}}','club-{{p.id}}','unclub-{{p.id}}')"><i class="fas fa-eye"></i>Unmark club</a></li>
{% endif %}

View File

@ -64,7 +64,7 @@
<div style="z-index: 3;">
{% if p.club and not (v and v.coins > 750) %}
{% if p.club and not (v and v.paid_dues) %}
<img loading="lazy" src="/assets/images/emojis/marseyglow.webp" class="post-img">
{% elif not p.url %}
<a {% if v and v.newtab %}target="_blank"{% endif %} {% if v %}href="{{p.permalink}}"{% else %}href="/logged_out{{p.permalink}}"{% endif %}>
@ -174,7 +174,7 @@
{% endif %}
{% if v %}
{% if v.admin_level >=3 or v.id == p.author.id and v.coins > 750 %}
{% if v.admin_level >=3 or v.id == p.author.id and v.paid_dues %}
<li id="club-{{p.id}}" class="{% if p.club %}d-none{% endif %} list-inline-item"><a class="text-info" href="javascript:void(0)" onclick="post_toast2('/toggle_club/{{p.id}}','club-{{p.id}}','unclub-{{p.id}}')"><i class="fas fa-eye-slash"></i>Mark club</a></li>
<li id="unclub-{{p.id}}" class="{% if not p.club %}d-none{% endif %} list-inline-item"><a class="text-info" href="javascript:void(0)" onclick="post_toast2('/toggle_club/{{p.id}}','club-{{p.id}}','unclub-{{p.id}}')"><i class="fas fa-eye"></i>Unmark club</a></li>
{% endif %}
@ -321,7 +321,7 @@
<button id="save2-{{p.id}}" class="{% if p.id in v.saved_idlist() %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-left text-muted"><a href="javascript:void(0)" onclick="post_toast2('/save_post/{{p.id}}','save2-{{p.id}}','unsave2-{{p.id}}')" data-dismiss="modal"><i class="fas fa-save text-center text-muted mr-3"></i>Save</a></button>
<button id="unsave2-{{p.id}}" class="{% if not p.id in v.saved_idlist() %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-left text-muted"><a href="javascript:void(0)" onclick="post_toast2('/unsave_post/{{p.id}}','save2-{{p.id}}','unsave2-{{p.id}}')" data-dismiss="modal"><i class="fas fa-save text-center text-muted mr-3"></i>Unsave</a></button>
{% if v.admin_level >=3 or v.id == p.author.id and v.coins > 750 %}
{% if v.admin_level >=3 or v.id == p.author.id and v.paid_dues %}
<button id="club2-{{p.id}}" class="{% if p.club %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-info text-left" href="javascript:void(0)" onclick="post_toast2('/toggle_club/{{p.id}}','club2-{{p.id}}','unclub2-{{p.id}}')" data-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" href="javascript:void(0)" onclick="post_toast2('/toggle_club/{{p.id}}','club2-{{p.id}}','unclub2-{{p.id}}')" data-dismiss="modal"><i class="fas fa-eye mr-3"></i>Unmark club</button>
{% endif %}
@ -377,7 +377,7 @@
</div>
{% if not p.club or v and v.coins > 750 %}
{% if not p.club or v and v.paid_dues %}
{% if p.active_flags %}
<div id="flaggers-{{p.id}}" class="flaggers d-none">
<strong><i class="far fa-fw fa-flag"></i> Reported by:</strong>