master
Aevann1 2022-05-02 00:56:19 +02:00
parent 94e6eb1ef6
commit 195ea385e3
5 changed files with 5 additions and 21 deletions

View File

@ -306,7 +306,6 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, ccmode="false"
posts = posts.filter(Submission.id.notin_(voted))
if sub: posts = posts.filter_by(sub=sub.name)
elif not v: posts = posts.filter(Submission.sub == None)
else: posts = posts.filter(or_(Submission.sub == None, Submission.sub.notin_(v.all_blocks)))
if gt: posts = posts.filter(Submission.created_utc > gt)
@ -378,7 +377,6 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, ccmode="false"
if (sort == "hot" or (v and v.id == Q_ID)) and page == 1 and ccmode == "false" and not gt and not lt:
pins = g.db.query(Submission).filter(Submission.stickied != None, Submission.is_banned == False)
if sub: pins = pins.filter_by(sub=sub.name)
elif not v: pins = pins.filter(Submission.sub == None)
else: pins = pins.filter(or_(Submission.sub == None, Submission.sub.notin_(v.all_blocks)))
if v and v.admin_level < 2:

View File

@ -41,11 +41,13 @@
<div class="row" style="overflow: visible;padding-top:5px;">
<div class="col">
{% if v %}
<div class="mt-3 d-lg-none">
{% if sub %}
{% if sub %}
<div class="mt-3">
{% if v %}
<a class="btn btn-primary btn-block {% if v.blocks(sub.name) %}d-none{% endif %}" onclick="post_toast(this,'/h/{{sub.name}}/block','block-sub','unblock-sub');this.classList.toggle('d-none');nextElementSibling.classList.toggle('d-none')">Block /h/{{sub.name}}</a>
<a class="btn btn-primary btn-block {% if not v.blocks(sub.name) %}d-none{% endif %}" onclick="post_toast(this,'/h/{{sub.name}}/unblock','block-sub','unblock-sub');this.classList.toggle('d-none');previousElementSibling.classList.toggle('d-none')">Unblock /h/{{sub.name}}</a>
{% else %}
<a class="btn btn-primary btn-block" href="/login">Block /h/{{sub.name}}</a>
{% endif %}
</div>
{% endif %}

View File

@ -13,11 +13,6 @@
<div class="mb-4">{{sub.sidebar_html|safe}}</div>
{% endif %}
{% if v %}
<div class="d-lg-block d-none btn-block">
<a class="btn btn-primary btn-block mb-3 {% if v.blocks(sub.name) %}d-none{% endif %}" onclick="post_toast(this,'/h/{{sub.name}}/block','block-sub','unblock-sub');this.classList.toggle('d-none');nextElementSibling.classList.toggle('d-none')">Block /h/{{sub.name}}</a>
<a class="btn btn-primary btn-block mb-3 {% if not v.blocks(sub.name) %}d-none{% endif %}" onclick="post_toast(this,'/h/{{sub.name}}/unblock','block-sub','unblock-sub');this.classList.toggle('d-none');previousElementSibling.classList.toggle('d-none')">Unblock /h/{{sub.name}}</a>
</div>
<a class="btn btn-primary btn-block mb-3" href="/create_sub">CREATE HOLE</a>
{% if v.mods(sub.name) %}
<a class="btn btn-primary btn-block mb-3" href="/h/{{sub.name}}/settings">HOLE SETTINGS</a>

View File

@ -7,12 +7,6 @@
{% if v and v.mods(sub.name) %}
<a class="btn btn-primary btn-block" href="/h/{{sub.name}}/settings">SUB SETTINGS</a>
{% endif %}
{% if v %}
<div class="d-lg-block d-none btn-block">
<a class="btn btn-primary btn-block {% if v.blocks(sub.name) %}d-none{% endif %}" onclick="post_toast(this,'/h/{{sub.name}}/block','block-sub','unblock-sub');this.classList.toggle('d-none');nextElementSibling.classList.toggle('d-none')">Block /h/{{sub.name}}</a>
<a class="btn btn-primary btn-block {% if not v.blocks(sub.name) %}d-none{% endif %}" onclick="post_toast(this,'/h/{{sub.name}}/unblock','block-sub','unblock-sub');this.classList.toggle('d-none');previousElementSibling.classList.toggle('d-none')">Unblock /h/{{sub.name}}</a>
</div>
{% endif %}
<a class="btn btn-primary btn-block" href="/h/{{sub.name}}/mods">HOLE MODS</a>
<a class="btn btn-primary btn-block" href="/h/{{sub.name}}/exilees">HOLE EXILEES</a>
<a class="btn btn-primary btn-block" href="/h/{{sub.name}}/blockers">HOLE BLOCKERS</a>

View File

@ -18,11 +18,6 @@
<div class="mb-4">{{sub.sidebar_html|safe}}</div>
{% endif %}
{% if v %}
<div class="d-lg-block d-none btn-block">
<a class="btn btn-primary btn-block mb-3 {% if v.blocks(sub.name) %}d-none{% endif %}" onclick="post_toast(this,'/h/{{sub.name}}/block','block-sub','unblock-sub');this.classList.toggle('d-none');nextElementSibling.classList.toggle('d-none')">Block /h/{{sub.name}}</a>
<a class="btn btn-primary btn-block mb-3 {% if not v.blocks(sub.name) %}d-none{% endif %}" onclick="post_toast(this,'/h/{{sub.name}}/unblock','block-sub','unblock-sub');this.classList.toggle('d-none');previousElementSibling.classList.toggle('d-none')">Unblock /h/{{sub.name}}</a>
</div>
{% if v.admin_level > 2 %}
<a class="btn btn-primary btn-block mb-3" href="/create_sub">CREATE HOLE</a>
{% endif %}