-
Notifications
You must be signed in to change notification settings - Fork 19
Pagination #68
base: master
Are you sure you want to change the base?
Pagination #68
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there any way to do a search by content after pagination?
@@ -192,7 +192,7 @@ def get_quote_query(speaker: str = "", submitter: str = "", include_hidden: bool | |||
quote_query = db.session.query(Quote, | |||
func.sum(Vote.direction).label('votes')).outerjoin(Vote).group_by(Quote) | |||
# Put the most recent first | |||
quote_query = quote_query.order_by(Quote.quote_time.desc()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why change this?
begin=max(1, page-6), | ||
end=min(page+6, rows) + 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this logic not be done in jinja? seems kinda weird to pass these when you're already passing the page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Min and Max are not jinja functions
submitter = request.args.get('submitter')) | ||
|
||
rows = query.count() | ||
rows = int(rows//20 + bool(rows%20 > 0)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this really rows? Seems more like it's total number of pages
<li class="page-item"> | ||
<a class="page-link" href="/storage/{{ num }}">{{ num }}</a> | ||
</li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
planning to mark the current page separately?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably should, good point.
Co-authored-by: Max Meinhold <[email protected]>
So you know how Quotefault takes a small fucking eternity to load? Fixed.