forked from rDrama/rDrama
test smth in staging
parent
bf7fd8382d
commit
6ecfc32317
|
@ -325,15 +325,23 @@ def reported_posts(v):
|
||||||
try: page = max(1, int(request.values.get("page", 1)))
|
try: page = max(1, int(request.values.get("page", 1)))
|
||||||
except: abort(400, "Invalid page input!")
|
except: abort(400, "Invalid page input!")
|
||||||
|
|
||||||
listing = g.db.query(Submission).filter_by(
|
listing = g.db.query(Submission).options(load_only(Submission.id)).filter_by(
|
||||||
is_approved=None,
|
is_approved=None,
|
||||||
is_banned=False,
|
is_banned=False,
|
||||||
deleted_utc=0
|
deleted_utc=0
|
||||||
).join(Submission.flags).order_by(Submission.id.desc()).offset(PAGE_SIZE * (page - 1)).limit(PAGE_SIZE+1)
|
).join(Submission.flags).order_by(Submission.id.desc()).offset(PAGE_SIZE * (page - 1)).limit(PAGE_SIZE+1)
|
||||||
|
|
||||||
|
t = time.time()
|
||||||
|
next_exists = listing.count()
|
||||||
|
print(t - time.time())
|
||||||
|
|
||||||
listing = [p.id for p in listing]
|
listing = [p.id for p in listing]
|
||||||
next_exists = len(listing) > PAGE_SIZE
|
|
||||||
listing = listing[:PAGE_SIZE]
|
t = time.time()
|
||||||
|
next_exists = len(listing)
|
||||||
|
print(t - time.time())
|
||||||
|
|
||||||
|
return "wtf"
|
||||||
|
|
||||||
listing = get_posts(listing, v=v)
|
listing = get_posts(listing, v=v)
|
||||||
|
|
||||||
|
|
|
@ -30,22 +30,5 @@
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block pagenav %}
|
{% block pagenav %}
|
||||||
<nav>
|
{% include "pagination.html" %}
|
||||||
<ul class="pagination pagination-sm py-3 pl-3 mb-0">
|
|
||||||
{% if page>1 %}
|
|
||||||
<li class="page-item">
|
|
||||||
<small><a class="page-link" href="?page={{page-1}}" tabindex="-1">Prev</a></small>
|
|
||||||
</li>
|
|
||||||
{% else %}
|
|
||||||
<li class="page-item disabled"><span class="page-link">Prev</span></li>
|
|
||||||
{% endif %}
|
|
||||||
{% if next_exists %}
|
|
||||||
<li class="page-item">
|
|
||||||
<small><a class="page-link" href="?page={{page+1}}">Next</a></small>
|
|
||||||
</li>
|
|
||||||
{% else %}
|
|
||||||
<li class="page-item disabled"><span class="page-link">Next</span></li>
|
|
||||||
{% endif %}
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
Loading…
Reference in New Issue