forked from rDrama/rDrama
1
0
Fork 0

delete the holes filter button

master
Aevann 2023-05-04 19:48:30 +03:00
parent f20829707a
commit 2d5a1ad95e
4 changed files with 7 additions and 39 deletions

View File

@ -1,7 +0,0 @@
@media (max-width: 427px) {
.smol-fp {
font-size: 2.7vw;
padding-left: 2.5vw;
padding-right: 2.1vw;
}
}

View File

@ -48,7 +48,6 @@ def front_all(v, sub=None, subdomain=None):
else: default = False
pins = session.get(sort, default)
holes = session.get('holes', True)
ids, next_exists, size = frontlist(sort=sort,
page=page,
@ -59,7 +58,6 @@ def front_all(v, sub=None, subdomain=None):
lt=lt,
sub=sub,
pins=pins,
holes=holes
)
posts = get_posts(ids, v=v, eager=True)
@ -69,13 +67,13 @@ def front_all(v, sub=None, subdomain=None):
award_timers(v)
if v and v.client: return {"data": [x.json(g.db) for x in posts], "next_exists": next_exists}
return render_template("home.html", v=v, listing=posts, next_exists=next_exists, sort=sort, t=t, page=page, sub=sub, home=True, pins=pins, holes=holes, size=size)
return render_template("home.html", v=v, listing=posts, next_exists=next_exists, sort=sort, t=t, page=page, sub=sub, home=True, pins=pins, size=size)
LIMITED_WPD_HOLES = ('gore', 'aftermath', 'selfharm', 'meta', 'discussion', 'social', 'music', 'request')
@cache.memoize()
def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, filter_words='', gt=0, lt=0, sub=None, pins=True, holes=True):
def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, filter_words='', gt=0, lt=0, sub=None, pins=True):
posts = g.db.query(Submission)
if v and v.hidevotedon:
@ -102,9 +100,6 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, filter_words='
if sub: posts = posts.filter(Submission.hole_pinned == None)
else: posts = posts.filter(Submission.stickied == None)
if not sub and not holes:
posts = posts.filter(or_(Submission.sub == None, Submission.sub == 'changelog'))
if v:
posts = posts.filter(Submission.author_id.notin_(v.userblocks))

View File

@ -1277,20 +1277,6 @@ def toggle_pins(sort):
return redirect('/')
@app.get("/toggle_holes")
@limiter.limit(DEFAULT_RATELIMIT)
def toggle_holes():
if SITE_NAME == 'WPD':
abort(404)
holes = session.get('holes', True)
session["holes"] = not holes
if is_site_url(request.referrer):
return redirect(request.referrer)
return redirect('/')
@app.get("/badge_owners/<int:bid>")
@limiter.limit(DEFAULT_RATELIMIT)
@limiter.limit(DEFAULT_RATELIMIT, key_func=get_ID)

View File

@ -76,18 +76,12 @@
{% block navbar %}
<div class="d-flex align-items-center">
{% if SITE_NAME != 'WPD' and not sub %}
<link rel="stylesheet" href="{{('css/smolfp.css') | asset}}">
{% set hcolor = "primary" if holes else "secondary" %}
<a class="btn btn-{{hcolor}} text-{{hcolor}} mx-2 smol-fp" href="/toggle_holes"><i class="fas fas fa-manhole mr-2"></i>Holes</a>
{% endif %}
{% set pcolor = "primary" if pins else "secondary" %}
<a class="btn btn-{{pcolor}} text-{{pcolor}} mx-2 smol-fp" href="/toggle_pins/{{sort}}"><i class="fas fas fa-thumbtack fa-rotate--45 mr-2"></i>Pins</a>
<a class="btn btn-{{pcolor}} text-{{pcolor}} mx-2" href="/toggle_pins/{{sort}}"><i class="fas fas fa-thumbtack fa-rotate--45 mr-2"></i>Pins</a>
<div class="dropdown dropdown-actions mx-2">
<button type="button" class="btn btn-secondary dropdown-toggle smol-fp" id="dropdownMenuButton" data-bs-toggle="dropdown">
<button type="button" class="btn btn-secondary dropdown-toggle" id="dropdownMenuButton" data-bs-toggle="dropdown">
{% if t=="hour" %}<i class="fas fa-clock mr-2"></i>
{% elif t=="day" %}<i class="fas fa-calendar-day mr-2"></i>
{% elif t=="week" %}<i class="fas fa-calendar-week mr-2"></i>
@ -97,7 +91,7 @@
{% endif %}
{{t | capitalize}}
</button>
<div class="dropdown-menu smol-fp" x-placement="bottom-start" style="position: absolute; will-change: transform; top: 0px; left: 0px;">
<div class="dropdown-menu" x-placement="bottom-start" style="position: absolute; will-change: transform; top: 0px; left: 0px;">
{% if t != "hour" %}<a class="dropdown-item" href="?sort={{sort}}&t=hour"><i class="fas fa-clock mr-2"></i>Hour</a>{% endif %}
{% if t != "day" %}<a class="dropdown-item" href="?sort={{sort}}&t=day"><i class="fas fa-calendar-day mr-2"></i>Day</a>{% endif %}
{% if t != "week" %}<a class="dropdown-item" href="?sort={{sort}}&t=week"><i class="fas fa-calendar-week mr-2"></i>Week</a>{% endif %}
@ -108,7 +102,7 @@
</div>
<div class="dropdown dropdown-actions ml-2">
<button type="button" class="btn btn-secondary dropdown-toggle smol-fp" id="dropdownMenuButton2" data-bs-toggle="dropdown">
<button type="button" class="btn btn-secondary dropdown-toggle" id="dropdownMenuButton2" data-bs-toggle="dropdown">
{% if sort=="hot" %}<i class="fas fa-fire mr-1"></i>{% endif %}
{% if sort=="views" %}<i class="fas fa-eye mr-1"></i>{% endif %}
{% if sort=="bump" %}<i class="fas fa-arrow-up mr-1"></i>{% endif %}
@ -122,7 +116,7 @@
{% if sort=="saves" %}<i class="fas fa-save mr-1"></i>{% endif %}
{{sort | capitalize}}
</button>
<div class="dropdown-menu smol-fp" x-placement="bottom-start" style="position: absolute; will-change: transform; top: 0px; left: 0px;">
<div class="dropdown-menu" x-placement="bottom-start" style="position: absolute; will-change: transform; top: 0px; left: 0px;">
{% if sort != "hot" %}<a class="dropdown-item" href="?sort=hot&t={{t}}"><i class="fas fa-fire mr-2"></i>Hot</a>{% endif %}
{% if sort != "views" %}<a class="dropdown-item" href="?sort=views&t={{t}}"><i class="fas fa-eye mr-2"></i>Views</a>{% endif %}
{% if sort != "bump" %}<a class="dropdown-item" href="?sort=bump&t={{t}}"><i class="fas fa-arrow-up mr-2"></i>Bump</a>{% endif %}