forked from rDrama/rDrama
1
0
Fork 0
master
Aevann1 2021-12-17 07:28:04 +02:00
parent 5c9206a59a
commit 2c9f48d3a1
9 changed files with 12 additions and 12 deletions

View File

@ -32,8 +32,8 @@ if path.exists(f'snappy_{site_name}.txt'):
@auth_required
def toggle_club(pid, v):
if v.club_banned: abort(403)
post = get_post(pid)
if post.author_id != v.id and v.admin_level == 0: abort(403)
post.club = not post.club
@ -943,7 +943,7 @@ def submit_post(v):
if request.headers.get("Authorization"): return {"error": reason}, 403
else: return render_template("submit.html", v=v, error=reason, title=title, url=url, body=request.values.get("body", "")), 403
if v.paid_dues: club = bool(request.values.get("club",""))
if not v.club_banned: club = bool(request.values.get("club",""))
else: club = False
if embed and len(embed) > 1500: embed = None

View File

@ -93,7 +93,7 @@
</button>
</li>
{% if v.admin_level > 1 or v.id == p.author.id and v.paid_dues %}
{% if v.admin_level > 1 or v.id == p.author.id and not v.club_banned %}
<li id="club2-{{p.id}}" class="{% if p.club %}hidden{% endif %}">
<button class="btn btn-gray w-full text-left" onclick="post_toast2('/toggle_club/{{p.id}}','club2-{{p.id}}','unclub2-{{p.id}}')">
<i class="fas fa-eye-slash fa-fw mr-4"></i>Mark club

View File

@ -96,7 +96,7 @@
</button>
</li>
{% if v.admin_level > 1 or v.id == p.author.id and v.paid_dues %}
{% if v.admin_level > 1 or v.id == p.author.id and not v.club_banned %}
<li id="club2-{{p.id}}" class="{% if p.club %}hidden{% endif %}">
<button class="btn btn-gray w-full text-left" onclick="post_toast2('/toggle_club/{{p.id}}','club2-{{p.id}}','unclub2-{{p.id}}')">
<i class="fas fa-eye-slash fa-fw mr-4"></i>Mark club

View File

@ -156,7 +156,7 @@
{% endif %}
{% if v %}
<!-- Requires auth and admin and author -->
{% if v.admin_level >=3 or v.id == p.author.id and v.paid_dues %}
{% if v.admin_level >=3 or v.id == p.author.id and not v.club_banned %}
<li>
<hr class="mt-2 mb-1.5 border-t border-black h-1 shadow-inset-t-white-05"/>
</li>

View File

@ -49,7 +49,7 @@
{% endif %}
{% if v %}
{% if v.admin_level >=3 or v.id == p.author.id and v.paid_dues %}
{% if v.admin_level >=3 or v.id == p.author.id and not v.club_banned %}
<a id="club-{{p.id}}" class="{% if p.club %}d-none{% endif %} list-inline-item 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>
<a id="unclub-{{p.id}}" class="{% if not p.club %}d-none{% endif %} list-inline-item 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>
{% endif %}

View File

@ -144,7 +144,7 @@
<input type="checkbox" id="privateCheck-mobile" name="private" form="submitform">
<label class="leading-4 ml-2 inline-blue badge badge-blue select-nonee" for="privateCheck">Draft</label>
</li>
{% if v.paid_dues %}
{% if not v.club_banned %}
<li class="flex items-center">
<input type="checkbox" id="clubCheck-mobile" name="club" form="submitform">
<label class="leading-4 ml-2 inline-block badge badge-yellow select-none" for="clubCheck">Country Club Thread</label>

View File

@ -219,7 +219,7 @@
<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 v.admin_level > 1 or v.id == p.author.id and v.paid_dues %}
{% if v.admin_level > 1 or v.id == p.author.id and not v.club_banned %}
<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-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" href="javascript:void(0)" onclick="post_toast2('/toggle_club/{{p.id}}','club2-{{p.id}}','unclub2-{{p.id}}')" data-bs-dismiss="modal"><i class="fas fa-eye mr-3"></i>Unmark club</button>
{% endif %}
@ -545,7 +545,7 @@
{% endif %}
{% if v %}
{% if v.admin_level > 1 or v.id == p.author.id and v.paid_dues %}
{% if v.admin_level > 1 or v.id == p.author.id and not v.club_banned %}
<a id="club-{{p.id}}" class="{% if p.club %}d-none{% endif %} list-inline-item 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>
<a id="unclub-{{p.id}}" class="{% if not p.club %}d-none{% endif %} list-inline-item 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>
{% endif %}

View File

@ -250,7 +250,7 @@
{% endif %}
{% if v %}
{% if v.admin_level > 1 or v.id == p.author.id and v.paid_dues %}
{% if v.admin_level > 1 or v.id == p.author.id and not v.club_banned %}
<a id="club-{{p.id}}" class="{% if p.club %}d-none{% endif %} list-inline-item 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>
<a id="unclub-{{p.id}}" class="{% if not p.club %}d-none{% endif %} list-inline-item 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>
{% endif %}
@ -406,7 +406,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" href="javascript:void(0)" onclick="post_toast2('/save_post/{{p.id}}','save2-{{p.id}}','unsave2-{{p.id}}')" data-bs-dismiss="modal"><i class="fas fa-save text-center text-muted mr-3"></i>Save</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" href="javascript:void(0)" onclick="post_toast2('/unsave_post/{{p.id}}','save2-{{p.id}}','unsave2-{{p.id}}')" data-bs-dismiss="modal"><i class="fas fa-save text-center text-muted mr-3"></i>Unsave</button>
{% if v.admin_level > 1 or v.id == p.author.id and v.paid_dues %}
{% if v.admin_level > 1 or v.id == p.author.id not v.club_banned %}
<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-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" href="javascript:void(0)" onclick="post_toast2('/toggle_club/{{p.id}}','club2-{{p.id}}','unclub2-{{p.id}}')" data-bs-dismiss="modal"><i class="fas fa-eye mr-3"></i>Unmark club</button>
{% endif %}

View File

@ -138,7 +138,7 @@
<label class="custom-control-label" for="privateCheck">Draft</label>
</div>
{% if v.paid_dues %}
{% if not v.club_banned %}
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="clubCheck" name="club">
<label class="custom-control-label" for="clubCheck">{{cc}} thread</label>